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_branch reads project.default_branch from the webhook payload.
  • TriggerReview sends it as source_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.rb
  • SIMPLECOV=0 bundle exec rspec spec/triage/event_spec.rb
  • bundle exec rubocop on the changed files

🤖 Generated with Claude Code

Merge request reports

Loading
Loading