Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: read review rules through the git tree and blob API

The rules file is now read with the existing forgejo-api client: the
commit's root tree, then the `.hyperhive` tree, then the
`review-classifier.{yml,json}` blob, base64-decoded. Every request takes
single-segment path parameters, so nothing depends on how a nested path
is escaped, and the controller keeps one HTTP transport to the forge.
The second reqwest client, `Client::with_token` and `raw_file_url` are
gone.

A tree the forge truncated is an error, not a missing file. A 404 on a
tree or blob doesn't come back as a forge 404, so only the repo lookup's
404 reads as "no such repo".

The `is_repo_not_found` doc comment is back on its function.

Part of #5096.
This commit is contained in:
atlas 2026-10-12 08:47:07 +02:00 • committed by mara
commit d52e97f376
5 changed files with 202 additions and 147 deletions

View file

@ -22,9 +22,9 @@ axum.workspace = true
# boundary (see #3306's design discussion: forcing that split now, over a
# few idempotent CRUD-ish calls, is premature plumbing).
forgejo-api.workspace = true
# Only for base64-encoding file content for `forge.rs`'s
# `repo_change_files` calls — forgejo's content API takes base64, never
# raw bytes.
# `forge.rs` encodes file content for its `repo_change_files` calls and
# decodes blobs it reads: forgejo's content and blob APIs carry base64,
# never raw bytes.
base64.workspace = true
# `agent_identity.rs` mints the per-agent queue secret, the one value in this
# tree this daemon invents rather than receives. Straight from the kernel's