fix(fetcher): include generic segment in Forgejo package URL #70
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VS-49-fetcher-generic-segment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The Forgejo agent-binary fetcher built the package URL without the
genericregistry-type segment (crates/vervain-agent-fetch/src/source.rs:154-157):<base>/api/packages/<owner>/<package>/<version>/<file>. Forgejo's generic-package API is<base>/api/packages/<owner>/generic/<package>/<version>/<file>, and the publisher (vervain-agentbuild-package.yml) uploads to the/generic/path. So every fetch requested a path that does not exist and Forgejo returned 404: the agent catalog stayed empty and device-enrollment downloads 404'd at/vervainagents/:id(the apps/agent/<id>proxy surfaced "agent download failed: 404 Not Found").Proven against the live registry with the deployed read:package token: a range GET of
…/api/packages/psa-systems-private/generic/vervain-agent/stable/vervainagent-6returns 206, while the same minus/generic/returns 404. The c-01 boot log showsvervain_agent_fetch::fetcher: agent binary source error … agent_id=6 error=HTTP 404andinstalled=0 failed=1.Fix
Insert the
generic/segment inForgejoSource::new, and update the struct doc comment and theforgejo_source_url_layouttest (which had pinned the wrong path). The Forgejo source is generic-package-only, so the segment is a constant.Verification
cargo clippy --all-targets,cargo build --all-targets, andcargo test --libpass (pre-commit hook). After deploying a build with this fix, a c-01 boot fetch should reportinstalled=1 failed=0for id 6 and/agent/6enrollment download should serve the binary.Closes #VS-49.