Connect the version detail view to the schema (monolith/S06 plan: 22/22)
What does this MR do and why?
This is Step 22 of 22 of the monolith/S06 "version detail" plan for the GitLab Artifact Registry UI. The Artifact Registry UI is an organization-level Vue application. It sits behind the feature flag artifact_registry_ui. The flag stays disabled, so this MR has no changelog entry.
Before this MR, the version detail page read its version, its files, and its statistics through Apollo @client local resolvers. Those resolvers were backed by a generated mock ladder in graphql/mock_resolvers.js and graphql/mock_artifacts.js. An Apollo @client directive marks a field as resolved locally in the browser, not fetched from the server.
Now the schema owns these reads:
- The single-version lookup,
ArtifactRegistryRepositoryDetails.version(id, artifactId)(added in Step 5). - The
filesconnection (added in Step 6, already merged). - The
statisticsfield (added in Step 7, the parent MR).
Both query documents, get_version.query.graphql and get_version_files.query.graphql, now select these fields from the server. Neither document has a remaining @client directive. The schema field commitSha is aliased as gitCommitSha, the name the view already reads.
The local Apollo layer now keeps only the manifest read, because the schema does not carry that field yet. This MR deletes the version resolvers, the files paging helpers, the version file ladder, the version typedef extensions, the ArtifactRegistryVersionStatistics and ArtifactRegistryNpmVersionMetadata local types, and the local ArtifactRegistryVersionFile possible-types entry. The files cache type policy stays, because it is a real cache rule, not mock data.
This MR also aligns the Overview tab with the current design:
- Removes the npm description paragraph and the
npmMetadataread, because the design shows no description on the Overview tab. - Trims the Overview install panel to the tool selector, the snippet, and the footer help link.
- Switches the tool selector to the small listbox size.
- Adds
gl-py-5padding to the tab content.
The Files tab count now comes from the schema's statistics.filesCount. This field is a nullable BigInt, rendered as a string by the schema. The view coerces it to a number and hides the count when Artifact Registry omits it. As before, the count shows for Maven only.
One cost to know about: rendering the Files tab issues two Artifact Registry version REST reads, one per GraphQL operation. The files connection hangs off ArtifactRegistryVersionDetails, which is reachable only through repository.version(id:, artifactId:), so both operations resolve the version. The feature spec asserts that count on purpose.
References
- Work item: #623231 (closed)
- Plan (Step 22): https://gitlab.com/gitlab-org/ops/artifact-registry/-/blob/main/docs/plans/monolith/2026-08-18-version-detail.md
- Spec: https://gitlab.com/gitlab-org/ops/artifact-registry/-/blob/main/docs/specs/monolith/S06-version-detail.md
Screenshots or screen recordings
Screenshots are not attached yet. The author will add them. The visible changes are:
- The trimmed install panel on the Overview tab.
- The small tool selector.
- The added tab content padding.
- The removed npm description paragraph.
| Before | After |
|---|---|
How to set up and validate locally
- Enable the flag in a Rails console:
Feature.enable(:artifact_registry_ui). - Set up an organization with an active Artifact Registry namespace mapping, and a hosted Maven or npm repository that holds at least one package version. The caproni rig scripts
publish-maven-hosted.shandpublish-npm-hosted.shdo this. - Open the version list for the package and click a version. The URL is
/o/<organization>/-/artifact_registry/<slug>/repositories/<repository>/<packageId>/versions/<versionId>. - Check that the Overview tab renders the version string, the artifact coordinates, the install snippet, and the sidebar with size and attribution from the server. In the browser network panel, the
getArtifactRegistryVersionoperation carriesstatistics { filesCount }and no@clientfields. - Open the Files tab. The table lists the version's files with checksums. A second operation,
getArtifactRegistryVersionFiles, runs withfirst: 20. - Reload the page with
?tab=filesin the URL. Check that both operations run together. - Run the specs: the fixture spec, the feature spec, and
yarn jest ee/spec/frontend/packages_and_registries/artifact_registry.
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.