swarm-controller: read a repo's review rules from its default branch
`GET /api/review-classifier/rules?repo=owner/name` reads `.hyperhive/review-classifier.yml` or `.json` from the repo's default branch with the controller's forge token, on every request, and answers the classifications in the try-out POST's shape, plus the file, the branch and the commit it was read at. The swarm UI's try-out page loads them into its editor (#5134). The file is one `classifications` list of the try-out's `Classification`. A missing file, both files, a parse error, any unknown key, an empty list or more than ten entries is a problem+json error, never a pass. The checks the POST makes on its classifications move into one function both paths call. The doc names the file and its schema, replacing the placeholders, and documents the route. Part of #5096.
This commit is contained in:
parent
c5b66dc5a0
commit
16c7c249ef
6 changed files with 624 additions and 55 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -4843,6 +4843,7 @@ dependencies = [
|
|||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_norway",
|
||||
"sha2 0.11.0",
|
||||
"strum",
|
||||
"swarm-authelia-bridge-sock",
|
||||
|
|
|
|||
Loading…
Reference in a new issue