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:
parent
2b1573c2ba
commit
d52e97f376
5 changed files with 202 additions and 147 deletions
|
|
@ -1232,6 +1232,7 @@ classifications:
|
|||
assert!(detail.contains(says), "{query}: {detail}");
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn rules_without_forge_access_on_this_host_are_503() {
|
||||
let (state, _) = crate::tests::state_with_roster();
|
||||
|
|
|
|||
Loading…
Reference in a new issue