Add the Artifact Registry Trash route behind a feature flag
What does this MR do and why?
Scaffolds the Artifact Registry Trash page (monolith/S11): its route and its own feature flag. The page itself, its reads and the View Trash entry point come in later MRs, once the spec settles.
- Adds the
artifact_registry_trash_uiwipflag. The page needs both it andartifact_registry_ui. The shared flag is already on where closed beta runs, so the page's own flag keeps it dark until it reads real trash data. - Adds the page at
artifact_registry/<slug>/trash, beside the repositories area rather than inside its SPA, with its own Rails route, mount and app (decided in review). Trash holds repositories and artifacts, the path has a single-/, and it can't clash with a repository namedtrash. - The route runs the repositories area's gate and slug check, and the controller checks the Trash flag before resolving the slug. Every refusal is the same 404, so the route can't enumerate slugs. It has no sub-paths.
- The page renders only its heading for now, with Repositories (linked to the repositories list), then Trash in the breadcrumb.
Why a trash action on the repositories controller
The page is a trash action on Organizations::ArtifactRegistryRepositoriesController, not a new controller. It opens under the same conditions as the repositories area, plus its own flag, and the controller only serves the Vue app.
Reasoning
- Same gate. Trash needs
ArtifactRegistryGatingand the slug check (ensure_resolved_slug!and the methods behind it). The slug check is private to this controller, so a new controller would first need it moved into a shared concern. - Writes don't go through this controller. Emptying the trash will need more than read access, but it will follow the other Artifact Registry writes: a GraphQL mutation that Artifact Registry authorizes, with the UI hiding the action based on
userPermissions. The controller only decides who can open the page. - The sidebar keeps working. The Repositories item matches on this controller, so it stays highlighted on Trash. If Trash gets its own sidebar item, both items can match on
controller#actioninstead (active_routes: { path: ... }), asprojects#activitydoes. - GitLab already does this.
OrganizationsControllerservesactivity,groups_and_projectsandusersas custom actions.
Worth splitting out if viewing Trash ever needs a different permission from viewing Repositories, or the page gains sub-paths or Rails endpoints of its own.
The feature is dark, so there is no changelog trailer.
References
- Spec: gitlab-org/ops/artifact-registry!3656 (merged)
- Feature issue: #637279 (closed)
- Feature flag issue: #637263
Screenshots or screen recordings
Recorded on Caproni as root, organization and slug default, on the MR and on its base (master).
The Trash route. Each video then opens a wrong slug and a sub-path (both 404), and the old repositories/-/trash path, which shows the same in-app not-found state as on master. The flag-on video also follows the Repositories crumb back to the list.
| Master | MR, flag on | MR, flag off |
|---|---|---|
The existing Artifact Registry pages: the list, the new hosted, remote and virtual forms, repository detail and edit, artifact versions, manifest detail, an unknown in-app path, the landing redirect, and settings. On every page the status, title, heading, breadcrumb links, pushed flags, and console and GraphQL errors match master.
| Master | MR |
|---|---|
How to set up and validate locally
- Enable the flags for your organization in the Rails console:
org = Organizations::Organization.default_organization Feature.enable(:artifact_registry_ui, org) Feature.enable(:artifact_registry_trash_ui, org) - As a user who can read the organization's Artifact Registry, visit
/o/<organization-path>/-/artifact_registry/<slug>/trash. - Check that the page shows the Trash heading, with Repositories, then Trash in the breadcrumb, and that Repositories links to
/o/<organization-path>/-/artifact_registry/<slug>/repositories. - Disable
artifact_registry_trash_uiand reload. The page returns 404.
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.


