Draft: Retire the environment_key string-matching routing mechanism

What does this MR do and why?

Sixth and final MR in the resumed-CI-job routing stack. The previous five MRs built a DB-driven mechanism that's been dual-running alongside the original string-matching one since !247560 (merged). This MR is the actual cutover: it removes the old mechanism now that the new one covers the same routing decision more cheaply.

Specifically, this removes:

  • Gitlab::Ci::Matching::EnvironmentKey and its spec — the class that parsed a runner-emitted "<runner_id>/<system_id>/<executor-data>" string to decide, per poll, whether the polling runner owned a suspended environment.
  • The ci_resume_environment_runner_routing gate and resume_environment_available_to_runner? in Ci::RegisterJobService#runner_matched? — the only caller of the class above.
  • The corresponding feature flag definition.
  • Writing build.options[:suspend_options] from Gitlab::Ci::Pipeline::Seed::Build — now that Ci::BuildRuntimeEnvironment (populated since !247560 (merged)) is the sole source of truth for suspend/resume routing, nothing reads the options-blob copy anymore.

This is deliberately the last commit in the stack, not folded into an earlier one: removing the old path is only safe once the new path (!247560 (merged)-!247563) has actually been running in production and validated — pulling the string-matching mechanism out from under live traffic before that would be the risky move this whole split was meant to avoid.

Part of routing resumed builds to the runner machine that holds their suspended environment Resumable Jobs for CI and Agent Sessions (gitlab-org#21159).

References

Depends on !247563 (the consuming code path that replaces what this MR removes).

Issue: Resumable Jobs for CI and Agent Sessions (gitlab-org#21159)

Blueprint: Add blueprint for suspendable environments (gitlab-com/content-sites/handbook!18954 - merged)

How to set up and validate locally

  1. Confirm ci_resume_environment_runner_routing is disabled (it should already be off by the time this merges).
  2. Run the full suspend → queue → resume flow from the earlier MRs' validation steps and confirm resume routing still works correctly with the old mechanism fully removed.
  3. Confirm Ci::RegisterJobService#runner_matched? no longer references the removed method, and specs pass with the deleted feature-flag branch gone.

MR acceptance checklist

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

Edited by Ashvin Sharma

Merge request reports

Loading