Loading
Start MR approval flow sessions on the default branch
What does this MR do and why?
TriggerReview starts the MR approval flows through the Duo Agent Platform API. It now passes the project's default branch as source_branch when it starts one, so each automated session starts on the default branch and its environment doesn't depend on the merge request's contents.
The flows need no checkout of the merge request. The MR Approval Action Labeler, the MR Risk Labeler and the MR Dependency Risk Labeler read the merge request, its diff and its discussions through the API, and their agents have no tools.
Triage::Event#project_default_branchreadsproject.default_branchfrom the webhook payload.TriggerReviewsends it assource_branch. It starts no session when the payload names no default branch, rather than leaving the branch to the API's default.
Expected impact & dry-runs
Sessions that TriggerReview starts check out the project's default branch. What the flows read, and the labels and notes they write, are unchanged.
Checked locally:
SIMPLECOV=0 bundle exec rspec spec/processor/mr_approval_flow spec/processor/mr_approval_flow_spec.rbSIMPLECOV=0 bundle exec rspec spec/triage/event_spec.rbbundle exec rubocopon the changed files