review classifier: queued review requests survive a restart and are never refused
This commit is contained in:
parent
22256893fc
commit
d6aa83146a
7 changed files with 1021 additions and 454 deletions
|
|
@ -235,7 +235,12 @@ async fn main() -> Result<()> {
|
|||
reviews: Arc::default(),
|
||||
alerts: alerts::from_env(),
|
||||
};
|
||||
serve(listener, state).await
|
||||
}
|
||||
|
||||
/// Start taking the queued review requests, then serve `state` on `listener`.
|
||||
async fn serve(listener: tokio::net::UnixListener, state: AppState) -> Result<()> {
|
||||
review_classifier::review::spawn_queue(&state);
|
||||
axum::serve(listener, build_app(state))
|
||||
.await
|
||||
.context("serving swarm-controller")
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -60,12 +60,14 @@ pub(crate) enum RunOutcome {
|
|||
Approved,
|
||||
/// A review requested changes.
|
||||
ChangesRequested,
|
||||
/// A comment was posted: the rules did not load, the PR was unreadable,
|
||||
/// the run failed, the classifier sent a different number of answers
|
||||
/// than it was sent classifications, or any classification got none.
|
||||
/// A comment was posted: the request could not be queued, the rules did
|
||||
/// not load, the PR was unreadable, the run failed, the classifier sent a
|
||||
/// different number of answers than it was sent classifications, or any
|
||||
/// classification got none.
|
||||
NoVerdict,
|
||||
/// No run started, as every run and wait place was taken; a comment
|
||||
/// saying so was posted.
|
||||
/// saying so was posted. This build records none; it is here so that a
|
||||
/// stored record of it still reads.
|
||||
QueueFull,
|
||||
/// The review could not be posted.
|
||||
PostFailed,
|
||||
|
|
|
|||
Loading…
Reference in a new issue