Address review follow-ups on the manifest referrers tab
What does this MR do and why?
This MR addresses the remaining review threads from the merged Artifact Registry manifest referrers tab MR (!256442 (merged)), as a follow-up.
- Hides the Referrers tab when the manifest's
referrersCountis exactly 0. This matches the design prototype, which shows the tab only when a manifest has at least one referrer. A null count still shows the tab, because the GraphQL field description says null means the deployment predates the field, while zero is an exact reading, including on a remote repository, which always reports zero. A request for?tab=referrerson such a manifest now falls back to Overview, and the referrers section neither mounts nor queries. - Adds coverage in
referrers_section_spec.jsfor the re-read path, where the digest prop changes while the section stays mounted. Before this change, three separate mutations still passed the suite: removing the result hook that clearshasErrorafter a later successful read, makingisFirstReadreturn onlyisLoading, and removing the:is-loadingbinding on the table. Each of these now fails at least one test. - Fixes two spec titles that had dropped a possessive.
- Removes two incorrect or redundant comments: one in
referrers_table.vuethat wrongly saidTimeAgoTooltiprenders a null time as "just now" (it renders the literal text "null"), and one inconstants.js, aboveREFERRERS_TABLE_FIELDS, that repeated an explanation already next to the table's fixed layout inreferrers_table.vue. - Drops the digest link's custom class list (monospace, semibold,
default text colour) in
referrers_table.vue. It now renders as a plainrouter-link. - Deletes
queries_spec.js(see the subsection below).
One review thread, a removal checklist in mock_resolvers.js,
needed no change. The file, the @client directive, and the
repeated first argument it flagged were all removed by two MRs
merged after it: "Drop the client typedef for the manifest
referrers connection" and "Read the Artifact Registry manifest
detail from the schema".
This change is EE-only and sits behind the artifact_registry_ui
feature flag, which is default-off, so there is no changelog
trailer.
Why queries_spec.js is removed rather than edited
Reasoning
- The spec was added alongside the artifact table's keyset
pagination to catch one specific bug: Apollo strips
@clientfields from a document before sending it, but it only removes the variable definitions used by that removed field's own arguments. A variable used only by a nested client field could survive into the request, and the endpoint would reject the operation as declared but unused. That bug only showed up against a real endpoint, so a unit test was the only practical guard for it. - Every query under
ee/app/assets/javascripts/packages_and_registries/artifact_registry/graphqlnow reads directly from the schema. No@clientdirective remains in any of them, and the spec helper that stripped client field sets had already been removed once the last document moved over. - What was left in the spec only restated the literal list of selected fields and declared variables for each document, copied from the documents themselves. Any change to a query has to be repeated by hand in the spec, and the spec can never disagree with the document in a way the document itself does not already show. It mirrors the document; it does not check it.
- The checks that remain are independent of the documents. ESLint
runs
@graphql-eslintover every{,ee/,jh/}app/**/*.graphqlfile with the dumped schema loaded, includingno-unused-variables,require-selections,no-unused-fragments, andno-duplicate-fields(seeeslint.config.mjs, the "GraphQL files" block). The component specs (manifest_detail_spec.js,referrers_section_spec.js,files_section_spec.js, and the list specs) run each document through a mock Apollo client and assert on what the UI renders from the response, so a field the UI needs but the document no longer selects fails there instead. - One thread on the merged MR was about a title in this spec file. Deleting the file closes that thread too.
References
- Original MR: !256442 (merged)
- Design prototype, which shows the Referrers tab only when a manifest has referrers: https://gitlab-org.gitlab.io/ci-cd/package-stage/artifact-registry-design-proposal/repositories/hosted/manifest/
Screenshots or screen recordings
| digest link styling | manifest with zero referrers |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
In the Rails console:
Feature.enable(:artifact_registry_ui) -
Open a manifest detail page for a manifest with referrers, for example on a default GDK:
/o/default/-/artifact_registry/acme/repositories/oci-artifacts/36c00923-36c0-0924-36c0-092536c00926/manifests/sha256:1460bea91460beaa1460beab1460beac1460bead1460beae1460beaf1460beb0?tab=referrers. Confirm the Referrers tab shows with its count, and that the digest column renders as plain links. -
Open a manifest whose
referrersCountis 0 (any manifest in a remote repository, or one nothing refers to). Confirm only the Overview tab renders, and that appending?tab=referrersto the URL still lands on Overview with nogetArtifactRegistryManifestReferrersrequest in the performance bar. -
Run the affected specs:
yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/manifest_detail_spec.js ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/referrers_section_spec.js ee/spec/frontend/packages_and_registries/artifact_registry/repositories/versions/detail/referrers_table_spec.jsLocally these pass with 144 examples.
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.

