Skip to content

feat: wire in support for additional types of tests when pushing to Try - #3667

Open
bhearsum wants to merge 5 commits into
mozilla:masterfrom
bhearsum:refactor-wire-in-support-for-p
Open

bhearsum wants to merge 5 commits into
mozilla:masterfrom
bhearsum:refactor-wire-in-support-for-p

Conversation

@bhearsum

Copy link
Copy Markdown
Contributor

This is a functionally equivalent refactor that is a useful precursor to https://bugzilla.mozilla.org/show_bug.cgi?id=2065267. It's best looked at commit-by-commit (each one has some additional details in the commit message). The high level overview is that it allows different code paths to be taken in analysis and publication mode that will allow us to push to try with different parameters, and analyze and publish results in different ways.

Perhaps the most notable part here is the adjustment of where build_target_phid is fetched from. This is not strictly necessary as part of this refactor, but when we add a build&test try push, we won't have a code-review task that we can fetch this from, and it's already available in the decision task parameters so I figured we may as well be consistent with where we fetch it from.

This has been tested locally against phabricator-dev. I managed to kick off a sane looking try push, and when I re-ran publication mode against a previous code review bot run, it produced identical results.

…e another

build/test workflows will load revisions the same way that linting workflows do, but they will need to call a separate `Workflow` method. We'll be able to distinguish between the two by looking at the decision task parameters of the `try_group_id`. By putting these next to each other, we can call the right method without needing to leak the parameters out of this block into areas where they aren't appropriate.
While these are available in the `code-review` task metadata for the existing linting tasks, upcoming work to add builds and tests on phabricator revisions will not have such tasks. Luckily, all reviewbot pushes to Try already have `phabricator_diff` in their parameters, and we can fetch it from there.

Note that while this makes `try_task_id` unneeded in `cli.py`, it's still needed in `workflow.py` to find the tasks that need to be analyzed.
The existing publication mode for linting checks requires this, but this won't exist when we start dealing with builds & tests (we'll be looking at the entire `try_group_id` instead). Given this, we can't require it to be there to have `try_group_id` set in the settings.
This requires two main things:
1) The ability to signal a mode when the bot starts
2) Raising the currently hardcoded taskgraph parameters up to `start_analysis`, to allow them to be set differently for different modes

This will allow us to start additional analyses for builds, tests, etc. by setting the appropriate parameters when pushing to Try.
…sis modes

This is similar to the previous commit in that we need a signal to the bot to indicate which mode to use, and to handle it. The details differ, however:
* Our best signal for which mode to operate in comes from the decision task parameters, so that choice is deferred to cli.py. This is because the only way to process non-lint groups is to fire on task group completion (there will be no `code-review` task for these, and thus no way to feed that signal into the code review task payload itself).
* `Workflow.run` is very clearly oriented specifically towards linting, and we'll need a substantially different version of it to process build and test results. For this reason, it's been moved entirely to its own method, with the intention of providing a new method when support for build and test results is added. This is different than `start_analysis`, where the only difference is in the parameters that get fed into the try push.
@bhearsum
bhearsum marked this pull request as ready for review September 18, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant