Share an approver budget in ReviewerDataBuilder

What does this merge request do and why?

The recommend_reviewers flow sends the reviewer data in the DUO_WORKFLOW_ADDITIONAL_CONTEXT_CONTENT CI variable, which is limited to 128 KiB. Each approval rule could send up to 100 approvers, and nothing limited the number of rules. A merge request that matched many CODEOWNERS sections made the workload job fail with exec /usr/bin/dumb-init: argument list too long.

The rules now share a budget of 400 approvers, with 10 to 50 approvers for each rule. When a rule has more approvers than its limit, the builder keeps the ones that are not busy and have the fewest pending reviews, as before. The builder also stops sending username, which the prompt and the post_suggested_reviewers tool do not use, and leaves out user fields that have no value. The prompt reads those fields only when they have a value.

References

#630285 (closed)

Screenshots or screen recordings

Before After

Merge request acceptance checklist

Evaluate this merge request against the merge request acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading