Rollout: security_tracked_context_quota_enforcement feature flag

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Rollout tracking for the security_tracked_context_quota_enforcement feature flag, introduced in !239435 (merged).

This flag gates enforcement of two tracked security context quotas. The root namespace quota (Security::RootNamespaceTrackedContextQuotaService) was added in !265368. The organization quota (Security::TrackedContextQuotaService) was added in !239435 (merged). The root namespace quota is checked first. The organization quota applies only when it is set explicitly. The flag is separate from vulnerabilities_across_contexts. We can roll out quota enforcement independently of VAC tracking, and disable it in an emergency.

The actor is the root namespace, because the quota belongs to it. A project is checked against its root namespace, the same as Security::VAC.enabled?. If you enable the flag for a top-level group, the quota applies to all projects in that group. If you enable it for a subgroup or a single project, it has no effect.

Before the first rollout step, the post-deployment migration of !265368 must have run on GitLab.com. The quota check uses its partial index. Release managers run post-deployment migrations separately, so the index can appear days after the code is deployed.

Before we enable enforcement on GitLab.com, we must complete #639598. Without it, each quota check reads all tracked rows of the root namespace.

Rollout steps

  • Change the flag type from wip to beta once !265369, !268334 and !268821 are merged
  • Enable for internal/test root namespaces in the closed beta
  • Enable for trusted closed-beta customers
  • Monitor quota-exceeded errors and usage counting
  • Decide default-on timing for GA

Part of &20475.

Edited by Gregory Havenga