Skip to content
This repository has been archived by the owner on May 15, 2018. It is now read-only.

Add blacklist for locales (#309) #491

Closed
wants to merge 3 commits into from

Conversation

andreeamatei
Copy link
Contributor

This is for issue #309. I added here the changes for the pulse script and also the blacklist for staging beta and release, for testing. So as discussed, the blacklist will have priority when there are both.

@andreeamatei
Copy link
Contributor Author

Travis job passed, @whimboo, @andreieftimie please have a look.

@@ -202,10 +202,14 @@ def on_build(self, data):
target_platform = self.get_platform_identifier(data['platform'])

# Check locale restrictions and stop processing if locale is not wanted
if target_branch['locales'] and \
if target_branch['locales'] and not target_branch['blacklist'] and \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this check has been put in here. It should really be part of the following if condition.

@andreeamatei
Copy link
Contributor Author

Build passed, please check it out when you have time.

"fa",
"ff",
"ku"
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why those entries got added to the blacklist on staging only. You also want this for production.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add the blacklist in production now too and we merge this, we'll run all locales except those blacklisted and we're not ready yet with the jobs retention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we? There is still the white-list present, which skips locales, which are not wanted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have both a blacklist and a whitelist simultaneously. That doesn't make any sense.
We're implementing a blacklist to avoid a 90+ locale list for beta.

We still want to keep a whitelist for nightly only to not maintain a 90+ locale list.

Thus one of them needs to obsolete the other. (I think it can work either way).

So if a blacklist is present (or has items), we allow all builds that are inside. We don't check the whiltelist at all in this case.

If there's no blacklist (or empty) we proceed to check the whitelist and allow only items from it to run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, then we also need no blacklist for the staging config. In that environment we only run a limited set of locales, here en-US only. So the changes as done in this PR already include a whitelist AND a blacklist.

In any case, both features will remain in the script file even they are not used simultaneously. Checking both lists I would call a feature here, also for safety. Keep in mind that having both lists e.g. for email filters is pretty common. BL is for definitive spam, and WL for always pass through. Everything else is handled by clients, which we don't explicitly have here.

Means we could leave the blacklist check in the white-list check, but it feels a bit off the place for me.

@andreeamatei
Copy link
Contributor Author

I wanted to go ahead with the locales property and have the blacklist and whitelist underneath as we do with platforms:
https://github.com/mozilla/mozmill-ci/blob/master/config/production/daily.json#L82
Please let me know what do you think and how would you prefer/suggest. @andreieftimie, @whimboo
Regarding if we'd have other blacklists, I think those will be in their related structure.
Also, I want to make sure we agree on what we want first, the changes on staging and later push to production (as we usually do and it's what I thought from the start) or have in production everything too?

The changes in the pulse script and the structure will be changed everywhere anyway in the next commit, but I refer to the blacklist addition.
Thanks.

@andreieftimie
Copy link
Contributor

As discussed yesterday what we convened upon is the following:

  1. check for blacklist and return early if locale is blacklisted
  2. check for whitelist and return if locale is not whitelisted // we'll have to change this check later to be able to remove the whole whitelist for beta

For the config file I like the approach:

locales: {
  blacklist: [],
  whitelist: []
}

@whimboo
Copy link
Contributor

whimboo commented Sep 23, 2014

I just want to add that we might have different black lists in the future. Therefore it might be good to not have a separation as mentioned above, but something like:

  locales: [..],
  blacklist: {
    locales: [..],
    platforms: [..]
  }

That would clutter the config way lesser and keeps the blacklist stuff really optional. Means if no blacklist is needed, you also won't need a whitelist, but can directly use locales.

@andreieftimie
Copy link
Contributor

Also works to group all blacklists together.

@andreeamatei
Copy link
Contributor Author

So Henrik and I discussed on IRC and seems the better way to go now is to add the remaining batches and have this PR cleaning everything after we confirm everything works well.
By Thursday we'll have batches 7 and 8 landed and by Tuesday 9 and 10. Then quickly add the blacklist so we'll be right on time.

@andreeamatei
Copy link
Contributor Author

@whimboo, @andreieftimie updated the PR:

  • removed the blacklist from staging as we want to run only en-US there
  • created the structure we decided on for blacklist
  • added az and ku as broken locales, we established the test failing on fa and ff will be fixed by a workaround
  • removed the previous list of locales to run for beta and release, since we tested them all

"blacklist": {
"locales": [
"az",
"ku"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks beautiful! Lets hope we can keep this number that low.

@whimboo
Copy link
Contributor

whimboo commented Oct 1, 2014

Beside the mentioned review comments I have to add that the PR got bitrotted with the merge of the last two locale batches. So please refresh the config files too.

@andreeamatei
Copy link
Contributor Author

Updated as requested.

if target_branch['locales'] and \
# Check the locale against the locales blacklist if one is present and
# stop processing it if listed there
if 'blacklist' in target_branch and 'locales' in target_branch['blacklist'] and \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in my last review please separate the checks for the blacklist in general and locales. Make the latter another if condition in the blacklist block. When we add more blacklist types later we can easily add one more if conditions, so we do not end-up with a huge list of conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we add more items to the blacklist, we will change the pulse script anyway to handle those. I don't see why this change is important now.

@andreeamatei
Copy link
Contributor Author

Updated again.

@whimboo
Copy link
Contributor

whimboo commented Oct 2, 2014

Looks fine. Can you please get the commits squashed? I will do a final test then, and get it landed on master. Thanks.

@andreeamatei
Copy link
Contributor Author

@whimboo, all done!

# stop processing it if listed there
if 'locales' in target_branch['blacklist'] and \
data['locale'] in target_branch['blacklist']['locales']:
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. We missed something here... We cannot silently return, but have to give a proper log entry so that we know why the build has not been processed.

@andreeamatei
Copy link
Contributor Author

@whimboo added log entries.

@whimboo
Copy link
Contributor

whimboo commented Oct 6, 2014

Sorry, I commented on the commit instead on the PR. Just nits. Once those are fixed we can get this PR landed. Thanks @andreeamatei

@andreeamatei
Copy link
Contributor Author

@whimboo, updated again.

@whimboo
Copy link
Contributor

whimboo commented Oct 7, 2014

This PR has been merged as b5be34d

@whimboo whimboo closed this Oct 7, 2014
@whimboo whimboo mentioned this pull request Oct 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants