Add local ansible Galaxy repositories #157

Merged
benvin merged 16 commits from benvin/local-ansible into master 2026-10-18 18:01:09 +11:00
Member

Internal Ansible collections can only be installed from galaxy.ansible.com through the remote; there is nowhere to publish them for ansible-galaxy.

  • add the Galaxy v3 publish endpoint (multipart, base64 parts) with an import task that is already completed
  • read collection_info from MANIFEST.json under size and decompression caps, rejecting escaping paths and links
  • serve collection, paginated versions (root-relative links, as Galaxy does), version detail and artifact downloads
  • reject an existing namespace.name:version with 409
  • add docs/ansible/local.md, a UI snippet and an e2e-docker case driving real ansible-galaxy

requires unkin/artifactapi#137

Internal Ansible collections can only be installed from galaxy.ansible.com through the remote; there is nowhere to publish them for ansible-galaxy. - add the Galaxy v3 publish endpoint (multipart, base64 parts) with an import task that is already completed - read collection_info from MANIFEST.json under size and decompression caps, rejecting escaping paths and links - serve collection, paginated versions (root-relative links, as Galaxy does), version detail and artifact downloads - reject an existing namespace.name:version with 409 - add docs/ansible/local.md, a UI snippet and an e2e-docker case driving real ansible-galaxy requires unkin/artifactapi#137
Author
Member
  • internal/provider/ansible/local.go:273 (VersionsPage link, built from base at internal/api/v1/ansible.go:199) — links.next/previous/first/last are absolute https://host/... URLs → emit root-relative paths (/api/v1/local/<repo>/api/v3/collections/<ns>/<name>/versions/?limit=..&offset=..) as the remote rewriter does. ansible-galaxy (api.py get_collection_versions, relative_link=True) does versions_url.replace(path, next_link), so an absolute next yields https://hosthttps://host/... and any collection with more than 100 versions fails to resolve. The tests follow next verbatim and the e2e publishes one version, so neither catches it; add a >100-version case asserting the link starts with /.
  • nit: internal/provider/ansible/local.go:243-246 — created/updated are compared as RFC3339Nano strings, which misorder when fractional seconds differ in length (...05Z sorts after ...05.5Z) → compare parsed times or store UnixNano.
  • nit: internal/provider/ansible/local.go:297 — last offset is len-limit, not page-aligned (250 items, limit 100 → 150, not 200) → (len-1)/limit*limit.
- internal/provider/ansible/local.go:273 (VersionsPage `link`, built from `base` at internal/api/v1/ansible.go:199) — `links.next`/`previous`/`first`/`last` are absolute `https://host/...` URLs → emit root-relative paths (`/api/v1/local/<repo>/api/v3/collections/<ns>/<name>/versions/?limit=..&offset=..`) as the remote rewriter does. ansible-galaxy (api.py get_collection_versions, relative_link=True) does `versions_url.replace(path, next_link)`, so an absolute next yields `https://hosthttps://host/...` and any collection with more than 100 versions fails to resolve. The tests follow `next` verbatim and the e2e publishes one version, so neither catches it; add a >100-version case asserting the link starts with `/`. - nit: internal/provider/ansible/local.go:243-246 — `created`/`updated` are compared as RFC3339Nano strings, which misorder when fractional seconds differ in length (`...05Z` sorts after `...05.5Z`) → compare parsed times or store UnixNano. - nit: internal/provider/ansible/local.go:297 — `last` offset is `len-limit`, not page-aligned (250 items, limit 100 → 150, not 200) → `(len-1)/limit*limit`.
Author
Member

No findings.

No findings.
benvin changed target branch from benvin/remote-ansible to master 2026-10-18 12:09:08 +11:00
benvin added 15 commits 2026-10-18 12:09:08 +11:00
Add ansible Galaxy remote type
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
13d693b58a
- add ansible package type proxying the Galaxy v3 API
- rewrite href/links/download_url back to the remote so tarballs flow through it
- forward the query string for providers that opt in, keeping Galaxy pagination working
- add a UI usage snippet and an ansible e2e caching case
Retrigger CI
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
0f826aa331
Forward allowlisted query params for opt-in remote providers
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
586b07bab6
Document ansible pagination and artifact paths
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
9935691c6b
Classify bare paths, validate forwarded query values, evict query variants
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
769d673a4a
Validate and cap ansible pagination params
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
285e8674ca
Merge master into benvin/remote-query-forwarder
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
71e6458c77
Merge benvin/remote-query-forwarder into benvin/remote-ansible
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
f4d3093952
Add local ansible Galaxy repositories
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ba8d3a3c39
List ansible in the per-type caching docs
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
583a3ad4d1
Merge remote-tracking branch 'origin/benvin/remote-ansible' into benvin/local-ansible
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
e27a318ec7
unkin-agent added 1 commit 2026-10-18 15:35:31 +11:00
Merge remote-tracking branch 'origin/master' into benvin/local-ansible
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
029a6926fd
# Conflicts:
#	README.md
#	ui/src/packagetypes/defs/ansible.ts
benvin merged commit a00e45c3a7 into master 2026-10-18 18:01:09 +11:00
benvin deleted branch benvin/local-ansible 2026-10-18 18:01:10 +11:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#157