Add a Source column to the artifact version table
What does this MR do and why?
This change is behind the feature flag :artifact_registry_ui
The version table listed only Version and Published, so nothing said where a version came from or who published it. This adds a Source column to the Maven/npm version table that renders a linked or unlinked commit sha, or "Manually published," alongside the publishing project and author wherever the API resolves them.
| Line one | Line two | When |
|---|---|---|
| shortened sha, linked | <project> by <author> |
commit, project and publisher all resolved |
| shortened sha, linked | <project> |
no publisher |
| shortened sha, unlinked | by <author> |
the project did not resolve |
| shortened sha, unlinked | absent | commit only |
Manually published |
by <author> |
no commit |
Manually published |
absent | no attribution at all |
Changes
- Declares the contract fields Step 15 left out.
api/openapi/v1.yaml'sVersionschema requirescreated_by,project_id, andgit_commit_shaas keys but types all three nullable, documentingcreated_byandproject_idas "Opaque GitLab user ID / project ID … which the consumer resolves." The monolith is that consumer, sographql/typedefs.graphqlnow declaresArtifactRegistryVersion.createdBy: UserCoreand.project: Projectinstead of raw id strings — the same shapeArtifactRegistryRepository.createdByalready uses in the same file. Step 15 left these fields undeclared under an "only what renders" rule, so this is purely additive. - Container manifests get no Source column, on contract grounds.
ContainerManifestin the same OpenAPI schema carries nocreated_by,project_id, orgit_commit_sha. This touchesversions_table.vueand never the manifests table. - Degradation is the point. Every field is nullable, and a project the viewer cannot read resolves to null. That's why the sha renders unlinked instead of the cell disappearing.
- Reuses existing utilities instead of hand-rolling.
truncateShafrom~/lib/utils/text_utilityshortens the sha (the package registry'spublish_method.vuehardcodessubstring(0, 8)instead — this does not).projectCommitPathfrom~/lib/utils/path_helpers/repositoryaddresses the commit as the generated Rails route helper, correctly resolving an organization-scoped project path where string concatenation would not. A singlecommitPathutil inutils.jsreturns null when either the project or the sha is missing, reducing the template's link-or-text branch to one truthiness check. - Two departures from the design proposal. The proposal draws a CI ref link
("3.3.0-SNAPSHOT" next to a branch icon); Artifact Registry stores no CI ref and no pipeline,
so neither renders. The publisher is plain text rather than an avatar link, matching the
proposal, even though the artifact registry's own
detail/attributed_timestamp.vueuses an avatar for a sidebar affordance — not appropriate for a table row. - Seeds all four attribution shapes. The six-version ladder in
graphql/seed_data.jsnow carries per-row attribution: two full CI publishes, two manual publishes with a publisher, one commit whose project did not resolve, and one version with no attribution at all — every state is reachable in a browser, not only under Jest. - Adds three new i18n strings and one column header.
ArtifactRegistry|Manually published(the package registry's equivalent msgid is namespaced toPackageRegistry, so it can't be reused),ArtifactRegistry|%{project} by %{author},ArtifactRegistry|by %{author}, andArtifactRegistry|Source. Whole phrases go throughGlSprintf, with each slot guarded on the entity it renders so a null project is never dereferenced — the same guard~/packages_and_registries/shared/components/publish_message.vueuses. - Tests.
versions_table_spec.jswalks all four attribution shapes over a newmockAttributedVersionsfixture;utils_spec.jscoverscommitPathincluding every null path;seed_data_spec.jsasserts the ladder contains all four shapes. AVersionsWithSourcesStorybook story renders the matrix in one view. 944 tests pass on Vue 2 and Vue 3.
truncateSha yields 8 characters where the design proposal draws 7. The monolith convention wins.
Version attribution discloses which project published an artifact and its commit shas, which matters for a public repository; the package registry gates equivalent attribution behind a separate permission. Closed beta is private-only, so this is a note for GA rather than a blocker here.
Screenshots or screen recordings
Rows four and six are the degraded states: a commit whose project did not resolve, rendering an unlinked sha, and a version with no attribution at all.
How to set up and validate locally
- Enable the flag:
Feature.enable(:artifact_registry_ui). - Visit
/o/<organization>/-/artifact_registry/acme/repositories. - Open
payment-core(Maven) and click the artifact name; do the same forui-components(npm). - Confirm the Source column renders last, after Published, and that the six rows show: two
linked shas with
payments-svc by Alex Turner, one unlinked sha withby Alex Turneronly, twoManually publishedwithby Maria Santos, and one bareManually published. - Follow a sha link and confirm it lands on the publishing project's commit path.
- Open
payment-service(Docker) and confirm the container path is unchanged.
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.
