Manifest detail, delete manifest (artifact delete surface plan: steps 20 and 27/28)
What this does
Adds a Delete manifest action to the Artifact Registry manifest detail page. The page header gets a kebab with one item, which opens the shared delete confirmation modal and calls the existing ArtifactRegistryManifestDelete mutation for the page's own digest. When AR accepts the delete, the page shows a toast and navigates back to the version list, because the manifest the page shows is gone. If the delete is refused (for example a 409 because an index still references the manifest), the user stays on the page and the alert names the blocking digests. The kebab only shows when the repository's permissions allow deleteArtifact.
This is Steps 20 and 27 of the artifact delete surface plan. It follows the same pattern as the version detail delete (Step 16, !255799 (merged)) and reuses the mutation document, modal, and copy from the manifest row delete (Step 13, !254630 (merged)). The external gate, connecting the manifest detail page to the real schema (!257027 (merged)), merged on 2026-09-23. Step 27 (the permission gate) was split out when the permissions read was still being built. It is available now, so it ships here, following the version detail gate (Step 25, !257718 (merged)).
Closes #629676 (closed) Closes #629683
Changes
manifest_detail.vue: adds a kebab to the page header's#actionsslot, shown once the manifest renders, with one destructive Delete manifest item. Choosing it opens the sharedDeleteConfirmationModal. The body copy depends on the manifest kind, using the existingmanifestDeleteBody(index, signature, or plain).- Confirming calls the shared
executeDeleteMutationwith the existingdelete_manifest.mutation.graphqland{ name, imageId, digest }, whereimageIdis the route'sartifactId(the same id the manifests table uses). When AR accepts the delete, the page shows a toast and goes to the version list. If AR refuses it or the request fails, the shared helper raises the alert and the user stays on the page. - A guard stops a second confirm from sending a second request, and the menu shows as loading until the request settles. Moving to another manifest's route (a different repository, image, or digest) closes a pending confirmation. The digest alone is not enough, because the same digest can exist in two images.
- The kebab renders only when
permissionAllows(userPermissions, REPOSITORY_PERMISSION_DELETE_ARTIFACT)is true. The verdict comes from the existingget_repository_permissions.query.graphql, read withcache-and-network. Delete manifest is the only item, so a denied, missing, failed, or still-loading verdict renders no toggle at all. manifest_detail_spec.js: 37 new examples covering the kebab, the per-kind modal copy, the mutation input, success, the409refusal, a network failure, the double-confirm guard, route changes (to another digest, image, or repository, and while a delete is in flight), and the permission gate (allowed, denied, null or empty verdict, unresolved repository, failed or in-flight read, and a cached verdict being re-read).manifest_detail_spec.rb(feature): one example where the verdict allows the delete (the menu renders and the permissions read happens once) and one where it denies it (no menu).manifest_detail.stories.js: registers the permissions query with an allowing verdict, and adds aDeleteDeniedstory.
No new strings (all reused verbatim from the manifests table), no new mutation document, query, or helper. No changelog, since artifact_registry_ui is off by default.
Where this differs from the plan text
The plan says to reuse "the eviction helper Step 13 created". There is no eviction helper on master: the eviction rule was dropped in favour of re-reading, and Step 13 refetches the list after an accepted delete. This page does the same as the version detail delete (Step 16): it navigates to the version list, which reads cache-and-network, so the landing list reads fresh. The plan's "the 409 arm surfaces on the page" needs no new code here, because the mutation already turns the 409 into a payload error that names the blocking digests, and the shared helper raises it.
Step 27 says to select userPermissions inline on get_manifest.query.graphql and move the manifest read to cache-and-network. This MR does what the merged version detail gate (!257718 (merged)) did instead. The manifest read stays cache-first, so a revisit renders from the cache at once. The verdict has its own small cache-and-network read, so a permission granted or removed since the last visit still shows up. The cost is a second repository read to Artifact Registry on a first visit, because the backend caches the repository read separately with and without permissions. That trade-off was reviewed and accepted on !257718 (merged).
How to set up and validate locally
Steps 1 and 2 run anywhere. Steps 3 to 9 run on the caproni rig with the Artifact Registry and IAM Data Access fragments. That way every permission verdict comes from a real role grant in IAM Data Access, checked by the GLAZ sidecar as on GitLab.com. Nothing is stubbed. A local GDK can't show the denied case, because its Artifact Registry runs with authorization.unenforced: true and allows everything.
Step 1: Run the manifest detail Jest spec
node_modules/.bin/jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail_spec.jsOutput (✅ )
deleting the manifest
✓ offers a delete action in the kebab, marked destructive (27 ms)
✓ starts with the confirmation closed (27 ms)
when the read is still loading
✓ offers no actions (8 ms)
when the read fails
✓ offers no actions (12 ms)
when the digest names no manifest
✓ offers no actions (9 ms)
when the verdict denies
✓ renders no delete item and no toggle (23 ms)
when the permission block is null
✓ renders no delete item and no toggle (19 ms)
when the permission block has no verdict
✓ renders no delete item and no toggle (25 ms)
when the repository does not resolve
✓ renders no delete item and no toggle (26 ms)
when the permission read fails
✓ renders no delete item and no toggle (25 ms)
when the permission read is in flight
✓ renders no delete item and no toggle (22 ms)
when the cache already holds a denying verdict
✓ renders the manifest from the cache without reading it again (38 ms)
✓ re-reads the verdict from the network (35 ms)
✓ renders no delete item while the re-read is in flight (41 ms)
when the network answer allows
✓ renders the delete item (43 ms)
when the cache already holds an allowing verdict
✓ renders no delete item from the cached verdict alone (39 ms)
when the network answer denies
✓ renders no delete item (44 ms)
when the delete action is chosen
✓ opens the confirmation on this manifest and sends nothing yet (73 ms)
when the manifest is an image
✓ words the confirmation for that kind (70 ms)
when the manifest is a signature
✓ words the confirmation for that kind (66 ms)
when the route moves to another manifest
✓ closes the confirmation (75 ms)
when the route moves to the same digest in another image
✓ closes the confirmation (75 ms)
when the route moves to the same digest in another repository
✓ closes the confirmation (76 ms)
when the confirmation is accepted
✓ addresses the manifest by digest within its image and repository (90 ms)
✓ reports the delete as scheduled rather than done (88 ms)
✓ navigates to the version list (83 ms)
✓ raises no alert (81 ms)
when the delete is refused because other manifests index it
✓ surfaces the refusal naming the blocking digests, and claims nothing (85 ms)
✓ keeps the user on the page (88 ms)
✓ releases the menu rather than leaving it pending (83 ms)
when the delete request fails
✓ raises the generic alert and claims nothing (85 ms)
✓ keeps the user on the page (81 ms)
when it is confirmed twice while the first is in flight
✓ sends one mutation (63 ms)
✓ marks the menu as pending (68 ms)
when the request settles
✓ releases the menu (90 ms)
when the route moves while the delete is in flight
✓ deletes the manifest that was confirmed (83 ms)
✓ navigates to the original version list (84 ms)
Test Suites: 1 passed, 1 total
Tests: 121 passed, 121 total
Snapshots: 0 total
Time: 6.603 sStep 2: Lint the changed files
node_modules/.bin/eslint ee/app/assets/javascripts/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail.vue ee/app/assets/javascripts/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail.stories.js ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail_spec.js
node_modules/.bin/prettier --check ee/app/assets/javascripts/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail.vue ee/app/assets/javascripts/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail.stories.js ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail_spec.js
bundle exec rubocop ee/spec/features/artifact_registry/manifest_detail_spec.rbOutput (✅ )
$ eslint ... (exit 0, no findings)
[V] Using Vue.js 2 (compiler 2)
IncrementalWebpackCompiler: Status – disabled
$ prettier --check ... (exit 0)
Checking formatting...
All matched files use Prettier code style!
$ rubocop ... (exit 0)
1 file inspected, no offenses detectedStep 3: Bring up caproni with real authorization and this branch in edit mode
In caproni.local.yaml, extend both fragments (IAM last) and turn on monolith edit mode. Then put repos/gitlab on this branch and start the rig:
extends:
- fragments/caproni.artifact-registry.yaml
- fragments/caproni.iam-data-access.yaml
repositories:
gitlab:
edit_mode: true
reloaders:
gitlab:
edit_mode: truegit -C repos/gitlab checkout --detach 629676-manifest-detail-delete-manifest
caproni up
caproni runOutput (✅ )
$ caproni kubectl -n artifact-registry get pods -o 'custom-columns=IMG:.spec.containers[*].image,INIT:.spec.initContainers[*].image'
registry.gitlab.com/gitlab-org/ops/artifact-registry:v2.129.0 registry.gitlab.com/gitlab-org/auth/glaz:v10.1.0
$ caproni kubectl -n artifact-registry get configmap/appconfig-artifact-registry -o yaml | grep -c unenforced
0
$ git -C repos/gitlab log --oneline -1
9bbf124a96c2b Gate delete manifest on the manifest detail page
$ caproni run
... hook finished script=.gitlab/caproni/db_migrate.sh repo=gitlab success=true
... all edit mode processes started, press Ctrl-C to stop reloaders=1Step 4: Create two users and grant their roles
Edit mode uses its own gitlabhq_development database, so run Rails commands with .gitlab/caproni/exec.sh rails runner from repos/gitlab. Enable org_stage_experimental, org_stage_ga and artifact_registry_ui. Create ar-e2e-admin and ar-e2e-viewer as non-admin organization members. Then, as root, grant each one a role on the default namespace with the artifactRegistryRoleGrant mutation:
mutation($id: UserID!, $r: String!, $role: ArtifactRegistryRole!) {
artifactRegistryRoleGrant(input: { assigneeId: $id, resourceId: $r, role: $role }) { errors }
}| User | Role on namespace default |
Holds delete_artifact |
|---|---|---|
ar-e2e-admin |
Artifact Admin | Yes |
ar-e2e-viewer |
Artifact Viewer | No |
These two users and their grants already existed on this rig from !258323 (merged), so this run reused them. Step 6 confirms the roles still hold.
Output (✅ )
org=default flags={"org_stage_experimental":true,"org_stage_ga":true,"artifact_registry_ui":true}
ar-e2e-admin: member=true admin=false
ar-e2e-viewer: member=true admin=falseStep 5: Create a Docker repository holding an OCI index and its children
As ar-e2e-admin (only Artifact Admin holds create_repository), mint a token and create a hosted Docker repository. This run minted the token with ArtifactRegistry::TokenExchange.new.token_for(user, organization) in a runner. The token_exchange API below gives the same token from a personal access token. Then push two child manifests (linux/amd64 untagged, linux/arm64 tagged standalone-tag) and an OCI image index over them, tagged v1. The push goes over the OCI distribution API (POST .../blobs/uploads/, PUT ...?digest=, PUT .../manifests/<ref>).
JWT="$(curl -sk -X POST https://gitlab.caproni.test/api/v4/token_exchange \
-H "PRIVATE-TOKEN: $ADMIN_PAT" --data-urlencode audience=gitlab-artifact-registry | jq -r .token)"
curl -sk -X POST https://artifact-registry.caproni.test/api/v1/default/repositories \
-H "Authorization: Bearer $JWT" -H 'Content-Type: application/json' \
-d '{"name":"manifest-gate-demo","format":"docker","kind":"hosted"}'
# blobs, two child manifests, then the index, under
# https://artifact-registry.caproni.test/v2/default/container/manifest-gate-demo/gate/Output (✅ )
create HTTP 201 {"id":"01a118ab-283b-7480-a60b-dff80540b509","name":"manifest-gate-demo","format":"docker","kind":"hosted",...}
GET .../manifest-gate-demo/docker/images
[{"id":"01a118ab-4a31-731e-b66b-b7d3da2c913c","name":"gate"}]
GET .../images/01a118ab-4a31-731e-b66b-b7d3da2c913c/manifests
sha256:44cf1b1e8fb1 application/vnd.oci.image.index.v1+json tags 1
sha256:628c36b9e9c2 application/vnd.oci.image.manifest.v1+json tags 1
sha256:7b2515d99f60 application/vnd.oci.image.manifest.v1+json tags 0Step 6: Confirm each user's verdict, and what the page's permissions read returns
This reads the verdict straight from the client, then runs the same get_repository_permissions.query.graphql document the page uses, as each user.
org = Organizations::Organization.first
query = File.read('ee/app/assets/javascripts/packages_and_registries/artifact_registry/graphql/queries/get_repository_permissions.query.graphql')
%w[ar-e2e-admin ar-e2e-viewer].each do |username|
user = User.find_by!(username: username)
client = ArtifactRegistry::Client.new(current_user: user, organization: org)
repo = client.repository(slug: 'default', name: 'manifest-gate-demo', include_permissions: true)
verdicts = %w[read_artifact delete_artifact].to_h { |action| [action, repo.permissions.allowed?(action)] }
result = GitlabSchema.execute(query, variables: { organizationId: org.to_global_id.to_s, name: 'manifest-gate-demo' },
context: { current_user: user }).to_h
puts "== #{username}"
puts "AR verdicts: #{verdicts.to_json}"
puts "GraphQL userPermissions: #{result.dig('data', 'organization', 'artifactRegistryRepository', 'userPermissions').to_json}"
endOutput (✅ )
== ar-e2e-admin
AR verdicts: {"read_artifact":true,"delete_artifact":true}
GraphQL userPermissions: {"deleteArtifact":true}
== ar-e2e-viewer
AR verdicts: {"read_artifact":true,"delete_artifact":false}
GraphQL userPermissions: {"deleteArtifact":false}Step 7: As an Artifact Viewer, the manifest page offers no actions
- Sign in as
ar-e2e-viewer. - Open the version list for
manifest-gate-demo/gate, and select thelinux/amd64child (7b2515d99f60).
Expected: the manifest detail page renders in full (heading, description, Overview tab, sidebar), with no kebab beside the heading.
Output (✅ , from recording 1 below)
Detail URL: .../manifest-gate-demo/01a118ab-4a31-731e-b66b-b7d3da2c913c/manifests/sha256:7b2515d99f608682345e5cdf603ad8b7b812404f23b59e3becd4fc14febcad8a
Heading: 7b2515d99f60
Permissions: getArtifactRegistryRepositoryPermissions 200, userPermissions: {"deleteArtifact": false}
Kebab: not renderedStep 8: As an Artifact Admin, a refused delete keeps you on the page
- Sign in as
ar-e2e-adminand open the samelinux/amd64child. - Open the kebab next to the heading (More actions for 7b2515d99f60) and select Delete manifest.
- In the confirmation, select Delete manifest.
Expected: an alert says the manifest was not deleted because other manifests index it, and names the index digest. No success toast appears, the page stays on the manifest, and the menu is usable again.
Output (✅ , from recording 2 below)
Permissions: getArtifactRegistryRepositoryPermissions 200, userPermissions: {"deleteArtifact": true}
Kebab: "More actions for 7b2515d99f60", one item "Delete manifest"
Modal: "Delete manifest?" / "This action permanently deletes manifest 7b2515d99f60 and any tags pointing to it. This action cannot be undone."
Mutation: deleteArtifactRegistryManifest 200, errors: ["Manifest sha256:7b2515d99f608682345e5cdf603ad8b7b812404f23b59e3becd4fc14febcad8a was not deleted because it is indexed by other manifests: sha256:44cf1b1e8fb18b1bc4eadbc2ac3e606e60f553f3915971014f59d4d0a78745e8."]
Alert: the same message
Toast: none
URL after: unchanged
Kebab: not loadingStep 9: As an Artifact Admin, an accepted delete returns you to the version list
- Still as
ar-e2e-admin, open the index (44cf1b1e8fb1) from the version list. - Open the kebab and select Delete manifest. The confirmation says that child manifests are not deleted and remain as untagged, standalone manifests.
- Select Delete manifest.
Expected: the toast Manifest successfully scheduled for deletion. appears, and the page goes to the image's version list, which shows only the two children.
Output (✅ , from recording 3 below)
Modal body: "This action permanently deletes manifest 44cf1b1e8fb1 and any tags pointing to it. Its child manifests are not deleted and will remain in Artifact Registry as untagged, standalone manifests. This action cannot be undone."
Mutation: deleteArtifactRegistryManifest 200, errors: []
Toast: "Manifest successfully scheduled for deletion."
URL after: .../manifest-gate-demo/01a118ab-4a31-731e-b66b-b7d3da2c913c (the version list)
Rows: 628c36b9e9c2, 7b2515d99f60
GET .../images/01a118ab-4a31-731e-b66b-b7d3da2c913c/manifests (after)
sha256:628c36b9e9c2 application/vnd.oci.image.manifest.v1+json tags 1
sha256:7b2515d99f60 application/vnd.oci.image.manifest.v1+json tags 0Evidence
Environment: caproni with the Artifact Registry and IAM Data Access fragments (AR v2.129.0, GLAZ v10.1.0, authorization enforced), with the monolith in edit mode on this branch (9bbf124a96c2b). The users and verdicts are real role grants, as set up in Steps 4 to 6.
Rails console
Step 6 above. No client change, so the console shows the real verdict each user gets and what the page's permissions query returns.
GraphiQL
N/A. No GraphQL change. The mutation is the existing artifactRegistryManifestDelete, and the permissions read is the existing get_repository_permissions.query.graphql.
Screen recordings
Recording 1: an Artifact Viewer sees no actions
Signed in as ar-e2e-viewer (Artifact Viewer, delete_artifact false). The version list opens the linux/amd64 child, and the manifest page renders without a kebab.
Recording 2: an Artifact Admin, a refused delete (409) keeps you on the page
Signed in as ar-e2e-admin (Artifact Admin, delete_artifact true). The kebab offers Delete manifest. AR refuses the delete because the index references the child. The alert names the index digest, no toast appears, and the page stays on the manifest.
Recording 3: an Artifact Admin, an accepted delete returns you to the version list
Signed in as ar-e2e-admin. Deleting the index shows the index confirmation copy, then the toast, and the page goes to the version list, which shows only the two children.