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 referrersCount is 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=referrers on such a manifest now falls back to Overview, and the referrers section neither mounts nor queries.
  • Adds coverage in referrers_section_spec.js for 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 clears hasError after a later successful read, making isFirstRead return only isLoading, and removing the :is-loading binding 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.vue that wrongly said TimeAgoTooltip renders a null time as "just now" (it renders the literal text "null"), and one in constants.js, above REFERRERS_TABLE_FIELDS, that repeated an explanation already next to the table's fixed layout in referrers_table.vue.
  • Drops the digest link's custom class list (monospace, semibold, default text colour) in referrers_table.vue. It now renders as a plain router-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 @client fields 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/graphql now reads directly from the schema. No @client directive 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-eslint over every {,ee/,jh/}app/**/*.graphql file with the dumped schema loaded, including no-unused-variables, require-selections, no-unused-fragments, and no-duplicate-fields (see eslint.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

Screenshots or screen recordings

digest link styling manifest with zero referrers
Screenshot_2026-09-24_at_12.57.48_am Screenshot_2026-09-24_at_12.57.32_am

How to set up and validate locally

  1. In the Rails console: Feature.enable(:artifact_registry_ui)

  2. 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.

  3. Open a manifest whose referrersCount is 0 (any manifest in a remote repository, or one nothing refers to). Confirm only the Overview tab renders, and that appending ?tab=referrers to the URL still lands on Overview with no getArtifactRegistryManifestReferrers request in the performance bar.

  4. 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.js

    Locally 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.

Edited by Rahul Chanila

Merge request reports

Loading
Loading