Loading
Draft: Amend AR ADR-004, ADR-010 and ADR-022: billing states and re-anchoring
Why is this change being made?
This MR brings three Artifact Registry ADRs in line with the billing decisions on namespace service states and on payer changes. Only a plan lapse suspends a namespace now, and reaching the usage limit gives a separate, softer block. Rails can also replace the stored billing anchor when the payer changes, so the anchor is no longer fixed at namespace creation.
- ADR-010, Subscription Expiration: only a plan lapse (the subscription expires or is downgraded below Premium) suspends the namespace and starts the three-phase lifecycle (trigger decision). Exhausted GitLab Credits no longer suspend it: they reach the usage limit instead (usage-limit decision).
- ADR-010, suspension billing: usage during a suspension is written off and not billed (write-off decision). The write-blocked row no longer says "No new storage cost".
- ADR-010, non-payment: it becomes a suspension trigger later, once Finance defines its rules (plan-lapse decision).
- ADR-010, new Usage Limit Block section: pulls are served, pushes are refused, usage is still billed, and no deletion clock starts. The block lifts when the usage limit is raised or the monthly usage resets (usage-limit decision).
- ADR-010, scope: the usage-limit block applies on GitLab.com only. On Self-Managed and Dedicated, a plan lapse is the only restriction (platform scope decision).
- ADR-010, overage terms: a subscription without accepted overage terms gets the same kind of block, which lifts once the terms are accepted (overage terms decision, answer 2).
- ADR-010, reasons: suspension and each block show their own reason in the UI and in client errors (reasons decision).
- ADR-004, Storage Quota: billing enforcement no longer always suspends. A plan lapse suspends the namespace, and reaching the usage limit gives the usage-limit block (usage-limit decision).
- ADR-022, Status: four independent, reversible service conditions instead of three. The new one is the usage-limit block (usage-limit decision, service-side spec issue). Applying or lifting one never changes another.
- ADR-022, reads and billing: a suspended or usage-limit-blocked namespace serves pulls and refuses pushes. Usage is billed under every condition except suspension, which wins when both apply (write-off decision, usage-limit decision). Retention applies under every condition.
- ADR-022, sources of the conditions: Rails sets disabled, suspended and usage-limit blocked. The Artifact Registry sets the security block and enforces every condition on each request. Slug Discovery no longer says that every status change comes from the Artifact Registry. Rails drives the billing conditions from the subscription state and a scheduled resolve call (enforcement design issue, polling accepted).
- ADR-022, billing re-anchoring: Rails replaces the billing anchor through one Rails-only GitLab API endpoint when the payer changes (re-anchoring decision). The nominated group changes in one case, confirmed by Fulfillment (nomination change, nomination moves to the paid group). The endpoint rejects a partial pair or an unknown type, is idempotent, and writes an audit log entry. The namespace read returns the anchor.
- ADR-022, re-anchoring timing: a change applies from the next daily usage snapshot. An hourly egress window that spans the change bills the payer it opened under (mid-month payer change).
ADR-007 is unchanged: it says nothing about the billing anchor columns, so it does not conflict with re-anchoring.
Known follow-up
- ADR-027, line 180: the new access-check endpoint must "hide disabled, suspended, and blocked registries". It does not name the usage-limit block. This MR leaves it unchanged.
Sources for the re-anchoring triggers
- A paid group transferred into an organization whose nominated group is on a Free subscription becomes the nominated group, as the organization billing design describes.
- The other triggers are a correction of a stored value and, later, the Organization becoming the payer.
- The slug stays immutable, and the namespace anchor tuple is not affected.
Author and Reviewer Checklist
- Provided a concise title for this MR
- Added a description explaining why the change is proposed
- Assign reviewers for this MR
- Share this MR with the audience that will be impacted
Commits
- Amend AR ADR-010: plan lapse suspends, usage limit blocks
- Amend AR ADR-022: usage-limit block and billing re-anchoring
- Amend AR ADR-004: plan lapse suspends, usage limit blocks
- Amend AR ADR-022: sources of the service conditions
Edited by Pawel Rozlach