-
Notifications
You must be signed in to change notification settings - Fork 50
add support for running bugbug-selected tasks for autoland-based reviewbot pushes #3578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,12 @@ def __init__(self): | |
| # Indexed by their Phabricator ID | ||
| self.user_blacklist = {} | ||
|
|
||
| # bugbug test configuration | ||
| self.bugbug_enabled_repositories = ["firefox-autoland"] | ||
| # Because it's unclear how much load this will add, this is being rolled out gradually. | ||
| self.bugbug_enabled_percent = 0.1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect variable name |
||
| self.bugbug_optimize_strategy = "gecko_taskgraph.optimize:tryselect.bugbug_reduced_manifests_config_selection_medium" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In an ideal world, I'd want to use the exact same strategy as autoland. In reality that doesn't seem possible because it uses a long composite strategy that takes into account push id, backstops, and other things. I'm not sure if what I have here is the best one; I'm happy to be corrected on this.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On autoland, the builds for various operating systems get scheduled. On try, the fewer builds the better, and they better are fast ones and without a small machine pool to run one. By default Linux opt should run, debug if the penalty for slower tests is acceptable. macOS and Windows shall get test tasks if the changes are expected to affect operating systems differently. |
||
|
|
||
| # Always cleanup at the end of the execution | ||
| atexit.register(self.cleanup) | ||
| # caching the versions of the app | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| from code_review_bot import vcs | ||
| from code_review_bot.config import settings | ||
|
|
||
|
|
||
| def test_bugbug_default_configuration(): | ||
| """ | ||
| The shipped rollout configuration is usable: a percentage expressed as a | ||
| ratio, a non empty allow list and a non empty optimize strategy | ||
| """ | ||
| assert 0 <= settings.bugbug_enabled_percent <= 1 | ||
| assert settings.bugbug_enabled_repositories | ||
| assert settings.bugbug_optimize_strategy | ||
|
|
||
|
|
||
| def test_bugbug_disabled_for_unlisted_repository(monkeypatch): | ||
| """ | ||
| Repositories outside of the allow list are never selected, even when the | ||
| rollout percentage is at its maximum | ||
| """ | ||
| monkeypatch.setattr(settings, "bugbug_enabled_percent", 1) | ||
|
|
||
| assert vcs.bugbug_enabled("mozilla-central") is False | ||
| assert vcs.bugbug_enabled("nss") is False | ||
|
|
||
|
|
||
| def test_bugbug_enabled_for_listed_repository(monkeypatch): | ||
| """ | ||
| Repositories from the allow list are selected by the rollout percentage | ||
| """ | ||
| monkeypatch.setattr(settings, "bugbug_enabled_repositories", ["autoland"]) | ||
|
|
||
| monkeypatch.setattr(settings, "bugbug_enabled_percent", 1) | ||
| assert vcs.bugbug_enabled("autoland") is True | ||
|
|
||
| monkeypatch.setattr(settings, "bugbug_enabled_percent", 0) | ||
| assert vcs.bugbug_enabled("autoland") is False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that a bunch of config for bugbug is in tc secrets. I wasn't sure if that was helpful or desired here; I can make that adjustment if needed.