Gate the artifacts table delete and add a copy name action

What does this MR do and why?

This MR is part of monolith/S15. It gates the Artifact Registry artifacts table's row actions menu on the deleteArtifact verdict. The verdict comes from the repository's userPermissions block, which the detail page already resolves for its header, kebab, and sidebar. The artifacts section now receives a permissions prop and passes it to the artifacts table.

The table reads the verdict through the shared permissionAllows helper with the REPOSITORY_PERMISSION_DELETE_ARTIFACT constant. A hosted row's Delete package or Delete image and a remote row's Delete cache entry are the same Artifact Registry write at two repository kinds, so both use this one verdict. Delete is each row's only menu item, so a denied row renders no kebab toggle at all, not an empty menu. Rows and their links stay visible either way. Artifact Registry still authorizes every request; the verdict only decides what renders.

The detail query already uses cache-and-network, and the page passes the block only once loading stops. A mount on a primed cache hands the table no block at first and renders no kebab until the network answers. No fetch policy or query changed.

Each artifacts table row also gains a tertiary clipboard button ahead of the kebab. It copies the name the row renders, either Maven coordinates joined with a colon, or the image or package name. Its title reads "Copy image name" on a container repository (Docker, OCI) and "Copy package name" otherwise. Copying is a read, so it is not gated and stays on a row whose kebab is removed. Two new translatable strings were added to locale/gitlab.pot.

This MR also lands two follow-ups from review of earlier merged MRs. In the repository list's row actions menu, the hasItems computed only returned canEdit, so it is removed and the kebab's v-if reads canEdit directly. In the version detail spec, the zero-count case is restored and a non-numeric case is added, so the Number.isFinite guard on the Maven files badge has a test that fails without it.

The repositories feature spec now pins the gated controls on both pages. The list examples cover the New repository dropdown and the row kebab with every verdict allowed and denied, including the axe check the detail header MR deferred until the list gating merged. The detail examples cover the artifacts table kebab and the copy button.

All three changes ship behind the default-off artifact_registry_ui feature flag, so there is no changelog entry.

References

Screenshots or screen recordings

with permission without permission
Screenshot_2026-09-18_at_4.30.56_pm Screenshot_2026-09-18_at_4.27.47_pm
Screenshot_2026-09-18_at_4.31.14_pm Screenshot_2026-09-18_at_4.28.50_pm
Screenshot_2026-09-18_at_4.31.21_pm Screenshot_2026-09-18_at_4.29.08_pm

How to set up and validate locally

  1. In a Rails console, enable the feature flag:
    Feature.enable(:artifact_registry_ui, organization)
  2. Run the Jest specs this MR changes:
    yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/detail/artifacts_table_spec.js
    yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/detail/artifacts_section_spec.js
    yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/detail/repository_detail_spec.js
    yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/components/row_actions_menu_spec.js
    yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/version_detail_spec.js
  3. Run the feature spec this MR extends. It needs compiled webpack assets, so rebuild them first if they are stale:
    yarn webpack
    bin/rspec ee/spec/features/artifact_registry/repositories_spec.rb
  4. Open a repository's detail page in the organization's Artifact Registry. The gated kebab needs an Artifact Registry deployment that answers permissions.

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.

Edited by Rahul Chanila

Merge request reports

Loading
Loading