Add Clear cache to the remote repository actions dropdown

What does this MR do and why?

This MR adds a "Clear cache" item to the Artifact Registry repository detail page.

The item appears in the "More actions" kebab menu in the page header. It sits between "Copy repository URL" and "Delete repository". The item renders only when the repository kind is remote. Hosted repositories do not show it.

Choosing the item issues the existing GraphQL mutation artifactRegistryRepositoryArtifactsDelete with the repository name as input. There is no confirmation modal. This matches the design prototype, which shows a toast and no modal.

On success, the page shows a toast that reads "Cache successfully cleared." The page then refetches two queries: the repository detail query, and the artifact connection query for the repository format. The connection query is the images query for Docker and OCI, and the packages query for Maven and npm. The refetch replaces the cached list rather than patching it, because the mutation payload does not say which rows were removed.

Artifact Registry applies the clear asynchronously. The mutation response confirms acceptance, not completion. Because of this, the refetched table can still show rows for a short time. This is expected and not an error.

If the mutation payload contains errors, the page shows an alert with the error text. If the request fails outright, the page shows a generic alert and reports the error to Sentry.

This feature is behind the artifact_registry_ui feature flag, which is default off. No changelog entry is added for that reason.

References

Related to Cache eviction, its schema connect, and the sid... (#627582 - closed) • Rahul Chanila • 19.4

This MR covers the repository-level "Clear cache" action only. The per-row "Delete cache entry" item is separate work and is not part of this MR.

Design prototype: https://gitlab-org.gitlab.io/ci-cd/package-stage/artifact-registry-design-proposal/repositories/remote/?name=payment-core&format=Maven&visibility=private

Screenshots or screen recordings

Before After
Hosted repositories should not show this option Screenshot_2026-09-03_at_11.54.58_pm

How to set up and validate locally

  1. Enable the feature flag in a Rails console: Feature.enable(:artifact_registry_ui).
  2. Make sure the instance has an Artifact Registry configured, and an organization with the registry active.
  3. Open the organization's Artifact Registry repositories list.
  4. Open a remote repository.
  5. Open the "More actions" menu in the page header.
  6. Choose "Clear cache".
  7. Confirm the toast appears and the table refetches.
  8. Open a hosted repository and confirm it has no "Clear cache" item.

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