hive-c0re: a refused rev is an error log + Grafana alert, not a PR comment
A deploy request whose rev hive-c0re refuses (fetch failed, or the rev does not descend from applied/main) no longer tries to comment on the PR that merged it. Off the forge host that attempt always failed with "forge core token absent". The refusal now logs at ERROR, message unchanged, and the new `hh-config-rev-refused` Grafana rule fires on it. Deleted with the posting: actions::post_rev_deploy_failure_to_pr, the whole forge/pr_comment.rs (config_repo, merged_pr_for_commit, post_pr_comment), and ReaderToken::value, whose only caller was merged_pr_for_commit. Refs #4851
This commit is contained in:
parent
3d81266483
commit
8c222f8910
9 changed files with 27 additions and 106 deletions
|
|
@ -84,28 +84,6 @@ async fn advance_applied_main<T>(
|
|||
Ok(RevAdvance::Advanced)
|
||||
}
|
||||
|
||||
/// Post why the merged commit `rev` of `agent`'s config repo was not deployed
|
||||
/// onto the PR whose merge produced it. Best-effort: a failure here is logged
|
||||
/// only.
|
||||
pub(crate) async fn post_rev_deploy_failure_to_pr(agent: &str, rev: &str, err: &anyhow::Error) {
|
||||
let repo = crate::forge::config_repo(agent);
|
||||
let pr = match crate::forge::merged_pr_for_commit(&repo, rev).await {
|
||||
Ok(pr) => pr,
|
||||
Err(e) => {
|
||||
tracing::warn!(%agent, %rev, error = %e, "find the PR that merged a failed deploy's rev failed");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let body = format!(
|
||||
"## ⚠️ config deploy failed\n\n\
|
||||
The merged commit `{rev}` was not deployed:\n\n\
|
||||
```\n{err:#}\n```"
|
||||
);
|
||||
if let Err(e) = crate::forge::post_pr_comment(&repo, pr, &body).await {
|
||||
tracing::warn!(%agent, %pr, error = ?e, "post rev deploy-failure comment to PR failed");
|
||||
}
|
||||
}
|
||||
|
||||
/// Fast-forward `applied/main` to `target` and sync the working tree.
|
||||
///
|
||||
/// Compare-and-swap, not a bare set: `main` must still be `expected_main`, the
|
||||
|
|
|
|||
Loading…
Reference in a new issue