fix(fetcher): include generic segment in Forgejo package URL #70

Merged
nrupard merged 1 commit from fix/VS-49-fetcher-generic-segment into main 2026-06-23 22:29:24 +02:00
Owner

Problem

The Forgejo agent-binary fetcher built the package URL without the generic registry-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-agent build-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-6 returns 206, while the same minus /generic/ returns 404. The c-01 boot log shows vervain_agent_fetch::fetcher: agent binary source error … agent_id=6 error=HTTP 404 and installed=0 failed=1.

Fix

Insert the generic/ segment in ForgejoSource::new, and update the struct doc comment and the forgejo_source_url_layout test (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, and cargo test --lib pass (pre-commit hook). After deploying a build with this fix, a c-01 boot fetch should report installed=1 failed=0 for id 6 and /agent/6 enrollment download should serve the binary.

Closes #VS-49.

## Problem The Forgejo agent-binary fetcher built the package URL without the `generic` registry-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-agent` `build-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-6` returns 206, while the same minus `/generic/` returns 404. The c-01 boot log shows `vervain_agent_fetch::fetcher: agent binary source error … agent_id=6 error=HTTP 404` and `installed=0 failed=1`. ## Fix Insert the `generic/` segment in `ForgejoSource::new`, and update the struct doc comment and the `forgejo_source_url_layout` test (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`, and `cargo test --lib` pass (pre-commit hook). After deploying a build with this fix, a c-01 boot fetch should report `installed=1 failed=0` for id 6 and `/agent/6` enrollment download should serve the binary. Closes #VS-49.
fix(fetcher): include generic segment in Forgejo package URL
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m8s
Create release / Create release from merged PR (pull_request) Has been skipped
b27d70ab7d
The Forgejo agent-binary fetcher built the package URL as `<base>/api/packages/<owner>/<package>/<version>/<file>`, omitting the `generic` registry-type segment that Forgejo's generic-package API requires (`<base>/api/packages/<owner>/generic/<package>/<version>/<file>`). The publisher 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 enrollment downloads 404'd at `/vervainagents/:id` (the apps `/agent/<id>` proxy surfaced "agent download failed: 404 Not Found"). Verified against the live registry with a read:package token: the `/generic/` URL returns 206, the path without it returns 404. Insert the `generic/` segment in `ForgejoSource::new`, and fix the struct doc comment and the url-layout test that pinned the wrong path.

#VS-49
nrupard deleted branch fix/VS-49-fetcher-generic-segment 2026-06-23 22:29:24 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!70
No description provided.