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) whengroup_keyis 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
Related
- Fixes CI failure introduced by !3849 (merged)
Edited by David Dieulivol