Loading
docs(adr): trim ADR-022 to its rules and decisions
Summary
- Problem: ADR-022 is 3,208 words, and much of it is history, a schema block, URL examples, and sections that describe how other ADRs used to work: a token exchange through the Artifact Registry,
o/<org_id>scopes, and owner roles from Rails membership. ADR-020 and ADR-021 decide those differently. Several specs also cite ADR-022 for rules it doesn't hold. - Decision: unchanged. The trim keeps the three namespace properties, the anchor rules, slug design, the namespace lifecycle, organization merges, Cells routing, slug discovery, and the consequences.
- Change:
- ADR commits: trim ADR-022 to 1,808 words.
- The schema block becomes rules under Anchors: an opaque
entity_id, the Organizations v1 anchor and why it is the UUID, uniqueness among unpurged namespaces, the separate billing anchor, no schema defaults. ADR-007 and the specs own the columns. - The slug-first, no-numeric-ID URL rule moves under Slug Design. ADR-009 owns the routes.
- Request Flow, Authorization Compatibility and Impact on ADRs leave, with the "all auth routes through the Artifact Registry" negative.
- History, meeting links and work-item links leave. The reasoning stays: why the anchor needs an indirection, why
namespace_idis a sufficient partition key under Cells, and what a merge would cost without the namespace.
- The schema block becomes rules under Anchors: an opaque
- Citation commits, for citations that were wrong before the trim:
- S12 and the storage doc cite ADR-007 for moving a namespace between deployments.
- S14, S15 and S16 cite ADR-007 for upstreams staying in one namespace, as S13 already does.
monolith/S01describes slug discovery as ADR-022 decides it: Rails resolves the slug by namespace UUID and caches it.- S08 and S11 stop naming ADR-022 as the owner of the slug grammar.
- ADR commits: trim ADR-022 to 1,808 words.
Checklist
- Reach: every surface that addresses a namespace: client and management URLs, the GitLab API, usage data, storage, and Rails. No rule changes, so no new constraint.
- Least sure: dropping the Authorization Compatibility section. It describes a token flow and scope format that ADR-020 and ADR-021 replaced, so nothing in ADR-022's own decision depends on it.
- Agreement: the Engineering Lead or a Staff+ cover, as for any ADR.
- Durability: revisit if a second anchor type or organization merges arrive, or if billing moves to the organization.
Every other ADR-022 citation in ADRs, specs, dev docs, e2e, Go comments and migrations cites a rule the trimmed ADR keeps, and every anchor into it still resolves.
Related to https://gitlab.com/gitlab-org/ops/artifact-registry/-/work_items/1783
Edited by João Pereira