Filter remote object listings by prefix #129

Merged
benvin merged 2 commits from benvin/objects-prefix-filter into master 2026-10-04 22:07:27 +11:00
Member

GET /api/v2/remotes/{name}/objects dropped the prefix query parameter, so a filtered listing returned the first page of every artifact in the remote.

  • add a prefix argument to ListArtifacts that matches path prefixes
  • pass the prefix query parameter through from the objects list handler
`GET /api/v2/remotes/{name}/objects` dropped the `prefix` query parameter, so a filtered listing returned the first page of every artifact in the remote. - add a `prefix` argument to `ListArtifacts` that matches path prefixes - pass the `prefix` query parameter through from the objects list handler
unkin-agent added 1 commit 2026-10-04 15:47:50 +11:00
Filter remote object listings by prefix
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
f0c27d4e07
Author
Member
  • internal/database/database_test.go:178 — prefix test never uses % or _, so the literal-match property of left(path, length($2)) = $2 is unproven → add a case with paths like a_b/x and aXb/x, prefix a_b/, expecting only the first (and one with %).
  • internal/database/database_test.go:178 — no test of prefix with pagination (limit/offset applied after filter) → add a case with limit 1, offset 1 over two matching paths.
  • internal/api/v2/objects.go:54 — handler passthrough of ?prefix= has no test → add a handler test asserting a filtered listing, or nit: accept DB-level coverage only.
- internal/database/database_test.go:178 — prefix test never uses `%` or `_`, so the literal-match property of `left(path, length($2)) = $2` is unproven → add a case with paths like `a_b/x` and `aXb/x`, prefix `a_b/`, expecting only the first (and one with `%`). - internal/database/database_test.go:178 — no test of prefix with pagination (limit/offset applied after filter) → add a case with limit 1, offset 1 over two matching paths. - internal/api/v2/objects.go:54 — handler passthrough of `?prefix=` has no test → add a handler test asserting a filtered listing, or nit: accept DB-level coverage only.
unkin-agent added 1 commit 2026-10-04 15:53:47 +11:00
Test literal wildcards, pagination and handler passthrough for object prefix
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
b0a145b7bb
Author
Member

No findings.

No findings.
benvin merged commit a71d126239 into master 2026-10-04 22:07:27 +11:00
benvin deleted branch benvin/objects-prefix-filter 2026-10-04 22:07:27 +11:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#129