Allow runner tags to be set on the dependency scanning auto-remediation job

Release notes

Dependency scanning auto-remediation generates its update job without any runner tags, and the job can only be picked up by a runner that accepts untagged jobs. This proposal adds a way to set tags on that job, so that customers with managed runner fleets can direct auto-remediation to the runners they intend to use.

Problem to solve

The auto-remediation workload job is generated by GitLab, not read from the project's .gitlab-ci.yml. Ci::Workloads::RunWorkloadService passes generated content into Ci::CreatePipelineService, so the project's CI configuration is never consulted for this pipeline. As a result:

  • The job is untagged, so only a runner configured to run untagged jobs can pick it up. In a fleet where every runner is restricted to tags, the job sits pending and no merge request is ever created.
  • default: tags: in the project's .gitlab-ci.yml has no effect, which is surprising, because it is the mechanism customers already use to steer every other job in the project.
  • There is no other way to influence runner selection for this job.

The only workaround is to stand up a runner that accepts untagged jobs purely for this feature, which defeats the point of a tagged fleet: that runner is then eligible for any untagged job in scope, not just auto-remediation.

Intended users

User experience goal

The user should be able to choose which runners execute auto-remediation jobs, using the same tag mechanism they already use for every other CI/CD job, without having to introduce a runner that accepts untagged jobs.

Proposal

Provide a way to set tags on the generated workload job. In rough order of preference:

  1. A tags field on the dependency scanning auto-remediation profile, which keeps runner selection alongside the rest of the auto-remediation configuration and allows different values per project through profile inheritance.
  2. A project-level setting.
  3. An instance-level setting, which would help GitLab Self-Managed administrators apply a fleet-wide default.

The plumbing already exists. lib/ci/workloads/workload_definition.rb emits result[:tags] = tags if tags.present? in to_job_hash, so the change is to make the value configurable and set it in DependencyManagement::SecurityUpdate::UpdateService#build_workload_definition, which today sets services, image, commands, variables and artifacts_paths but never tags.

Because Ci::Workloads already supports tags, the change is contained in Sec-owned code and does not require a change to lib/ci/workloads/.

Further details

Verified against the 19-2-stable-ee branch and cross-checked against master.

Note that this is not a GitLab Duo Agent Platform flow. The dependency version bump path is non-agentic and runs the orchestrator container, so the runner tags and eligibility rules that apply to Duo flow execution do not apply here.

Permissions and Security

Tags would be configured by a user who can already edit the auto-remediation profile or the project settings. Directing a job to a tagged runner is a capability those users already have for every other job in the project, so this does not introduce a new permission model.

Documentation

The runner requirements are currently undocumented. They are being added in !253354 (merged), which documents that a runner accepting untagged jobs is required today. That prerequisite would need updating when this proposal is implemented.

Availability & Testing

Unit coverage for the workload definition receiving and emitting tags, and a test confirming the generated job hash contains the configured tags.

Available Tier

Ultimate.

Feature Usage Metrics

Share of projects with auto-remediation enabled that set explicit tags, and the rate of auto-remediation jobs that remain pending without being picked up by a runner.

What does success look like, and how can we measure that?

A customer whose runner fleet is fully tagged can enable dependency scanning auto-remediation and have it run on their intended runners, without adding a runner that accepts untagged jobs.

  • Roadmap epic: &19244
  • Corroborates that the version bump path is non-agentic: #606935

Raised by a customer through GitLab Support on GitLab Self-Managed 19.2.1 Ultimate (internal: ZD 16198).

Edited by 🤖 GitLab Bot 🤖