Skip to content

New processor: Apply ~"Support Team Contributions" label automatically

What does this MR do and why?

This is a re-implementation of !1953 (closed) as a processor instead of a policy.

The goal is to add the Support Team Contributions label to any MR that is opened by a Support Team member in any GitLab project besides internal Support projects. We use this label to track contributions from the Support Team, but it's easy to forget adding it. Considering that we can easily determine if someone is a Support Team member, adding this label can and should be automated.

Notes:

  • As I originally implemented this as a policy in !1953 (closed) and continued working based off that branch, this still includes the new has_department() method in lib/team_member_helper.rb (and spec/lib/team_member_helper_spec.rb). I used that in the policy to determine if someone was a Support Team member. In the processor, I'm using gitlab-com/support membership instead, so this helper method is not needed anymore. I figured I'd leave it in as it might be useful for others in the future, but I'm absolulely fine with dropping it from the MR.
  • Direct gitlab-com/support membership is a good enough criteria to determine Support Team members (probably even better than relying on the team YAML). I basically copied the approach I saw in approved_by_appsec() in triage/processor/appsec_processor.rb to implement this.

Expected impact & dry-runs

I think for a processor I can't do dry-runs (in the sandbox)? Would the right approach here be to follow these instructions and run it against a test instance?

The expected impact is pretty straightforward: For any MR that a Support Team Member opens within a project in the gitlab-org namespace, the Support Team Contributions label should be added if not already present. It should not affect anyone who's not working in Support.

Action items

Edited by Manuel Grabowski

Merge request reports