Fix security_section_intro argument mismatch

Context

After !3849 (merged) was merged, team-summary policy jobs started failing with:

security_section_intro': wrong number of arguments (given 1, expected 0) (ArgumentError)

Failed pipeline: https://gitlab.com/gitlab-org/quality/triage-ops/-/pipelines/2342734379

The SecurityContext module defines security_section_intro(group_key:) but GroupTriageHelperContext overrides it with a no-argument version. Since GroupTriageHelperContext includes SecurityContext, the local definition takes precedence, breaking generated team-summary policies that call with group_key:.

What's in this MR?

Update security_section_intro in group_triage_helper.rb to:

  • Accept optional group_key: parameter
  • Delegate to super (SecurityContext) when group_key is provided
  • Preserve backward compatibility for runner policies that call without arguments

Proof of Work

bundle exec gitlab-triage --dry-run --debug \
  --source-id gitlab-org/gitlab \
  --token "$GITLAB_API_PRIVATE_TOKEN" \
  -r ./plugins/all.rb \
  --policies policies/generated/team-summary.yml.erb/gitaly.yml

On master: Fails with wrong number of arguments (given 1, expected 0) (ArgumentError)

With fix: Completes successfully

Edited by David Dieulivol

Merge request reports

Loading