monolith/S02 Step 2: Repository listing — repositories

🎯 Why

Part of epic AR Ruby client (monolith/S02). Adds the repository-listing method on top of the Step 1 client foundation at ee/lib/artifact_registry/ (namespace ArtifactRegistry::).

Re-scoped back to ee/lib. The interim gem packaging was dropped after legal review concluded the client must ship under the EE license (decision thread on gitlab-org/gitlab!246861); the gem MRs are closed. Extracting the client into an EE-licensed gem later is tracked in #607692.

🧭 What

Add the repositories listing method on ArtifactRegistry::Client and the list page object:

  • repositories forwards format/kind/sort/order/limit/cursor, parses the JSON array into Repository objects, and returns next/prev cursors extracted from the Link header (RFC 8288; only the cursor query-parameter value goes into the opaque tokens).
  • Builds its :slug path through the Step 1 path-segment encoder (with the blank-argument and bare-./.. guards); lets the primitive's 404 -> ApiError stand (unresolved slug).
  • ArtifactRegistry::RepositoryPage PODO: the Repository array plus opaque next_cursor/prev_cursor.

Files

  • ee/lib/artifact_registry/client.rb (modify: add repositories)
  • ee/lib/artifact_registry/repository_page.rb (new)
  • ee/spec/lib/artifact_registry/client_spec.rb (modify), ee/spec/lib/artifact_registry/repository_page_spec.rb (new)

Acceptance

In the EE RSpec suite (ee/spec/lib/artifact_registry/): repositories issues GET /api/v1/:slug/repositories with the forwarded query parameters, returns a page of Repository objects and the Link-header cursors from one HTTP call, passes created_by/updated_by through as raw opaque strings, and raises ApiError on a 404 (unresolved slug). The method routes through the shared credentialed request primitive and the shared path-segment encoder.

Covers S02 acceptance criteria 1, 11, and the list 404 -> ApiError branch of 7 (plus 6 via the shared primitive).

🚩 Feature flag

None (dark by absence of a caller).

Edited by Fiona McCawley