docs(specs): specify listing filters and a capped count in S17

Summary

  • Problem: the bulk delete UI (gitlab#630575) filters a package's versions and an image's manifests by published date and searches versions, and offers Select all N or Select first 1,000 of all [matching] …. AR's lists take no such filters and return no count, so the UI cannot build those controls.
  • Impact: users of the Artifact Central versions and manifests lists, starting with bulk delete at GA (hosted only). Nothing changes for existing API clients.
  • Change: S17 specifies created_after, created_before and a version search on the versions and manifests lists, and a count route beside each list that answers the matching rows up to 1,000 plus a has_more flag. The monolith S14 amendment and the bulk delete UI can design against it.
  • Downsides: the version search is an unindexed contains match: a sparse search can read every live version of one package (25,000 at the default cap). A remote parent has no such cap, so a remote repository answers 400 to search and to a date filter under sort=version. The manifests list takes no search at GA, and the count includes a row a bulk delete accepted until its job reaches it. S17 is over its word limit, so the diff also removes stale text (below), which widens it beyond the new section.

What the spec now says

Decision Source
Filters on the versions list (listVersions) and the manifests list (listContainerManifests) only, so every scan stays inside one parent. trizzi, scope, design
A published-date filter on both lists: created_after and created_before, inclusive RFC 3339 bounds, AND-combined. trizzi, GA filters, GA search
A plain contains search on the version string: case-insensitive, every character literal. No *, tags or sha256: digests (gitlab#637419 tracks those after GA). trizzi, GA search
A count that honours the filters, capped at 1,000 with a has_more flag, on its own route: GET .../versions/count and GET .../manifests/count. bonnie-tsang, jdrpereira, trizzi
No new sort: both lists already sort by created_at, and versions by version. trizzi, GA sorts
The routes, the date filters and the counts serve hosted and remote alike, because ADR-009 keeps artifact routes the same for both. A remote repository answers 400 to search and to a date filter under sort=version, the two reads no index bounds, because nothing caps its cached rows. The UI is hosted-only at GA. ADR-009, trizzi, scope, jdrpereira, remote bound
Bulk delete is unchanged. S17 #### Outcome

Defaults for review (@jdrpereira)

  • Count on its own route, not a list field. The lists keep "no totals", the existing Resolution that "a count belongs off the list". count plus has_more matches the Trash counts in monolith/S11 (!3656 (merged)), so 1,000 + has_more carries the same information as the "1,001" in the design thread.
  • A cursor reused with changed filters continues from its boundary. The cursor carries only sort keys, as on every list today, and last_downloaded_before works the same way. The Link header carries the filters, so a client following it never mixes them.
  • Future times are accepted. last_downloaded_before refuses them because its cutoff feeds deletes. These filters only narrow a view, and refusing them would fail a UI whose clock runs ahead of the server's.
  • search takes 1 character or more, not 3. The Trash minimum exists because its search spans a namespace. Here the scan is one package whatever the term, so 2. and rc stay searchable. This is the one place the two conventions differ.
  • No new index. Date filters ride the existing (namespace_id, parent_id, created_at, id) keyset indexes, hosted and remote. The contains match and a date range under sort=version scan at most 25,000 rows on a hosted repository at the default caps and are refused on a remote one, and a count stops at 1,001 matching rows.

Offsetting cuts for the word limit

S17 is far over the 15,000-word gate, which refuses any growth. The new text is offset, net −58 words against main, by removing only text that is stale or provenance on main:

  • Text describing the container fast-follow as unserved. #1150 (closed) is closed, and the routes, fields, Bruno requests and both tags arms are on main. This covers four Per-row figures rows and the Follow-ups "what remains" sentences.
  • Two Follow-ups bullets that record landed work: the remote eviction reapers in DefaultPurgeLevels, and the details envelope slot.
  • Provenance sentences ("This bullet previously said …", "An earlier revision …", a commit SHA and date, a closed tracker).

Checklist

  • Gaps: the manifests list takes no search at GA (400): the rest of manifest search, and tag, digest and wildcard search, are in gitlab#637419, and name search on the packages and images lists is S26. On a remote repository, search and a date filter under sort=version answer 400 until a scan bound covers a parent with no row cap. Counts on the other lists stay deferred (#196 covers the repositories list). The OpenAPI and Bruno changes land with the implementation.
  • Least sure: the bulk delete clause beside the count. S17 still applies bulk delete entries in the job, so the list and the count return an accepted row until the job reaches it. If bulk delete moves to marking in the request, that change updates the clause.
  • Compatibility: additive only. The new parameters are optional and the count routes are new. A GET .../manifests/count cannot collide with a manifest, because no digest can be the literal count.
  • Agreement: jdrpereira (S17 owner, and the Trash list's search and count conventions, P0.3); trizzi for the GA search scope; fmccawley for the deliberate difference from the Trash search minimum. The count route follows the cap and flag already agreed in gitlab#630575.
  • Simplicity: I rejected binding filters into the cursor (a new cursor shape for a client bug the Link header already prevents), a trigram index (a hosted parent's rows are capped, and a remote repository refuses the search), and hosted-only routes (ADR-009 keeps the routes the same for both kinds).

ADRs checked by reading: ADR-009 (same routes and verbs hosted and remote; a new route needs no ADR change unless it breaks a rule, and the two remote 400s follow the hosted 400 on last_downloaded_before, a filter only one kind accepts), ADR-021 (listing inside a repository needs read_artifact, which the count route takes), ADR-004 (per-parent caps bound the hosted scans; remote parents have none, hence the two remote refusals), and ADR-007 (no schema change).

Related to gitlab-org/gitlab#630575

Edited by Narendran

Merge request reports

Loading
Loading