Abort watchpr when a poll can no longer see the PR
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

- treat a mid-run 404 on a tracked PR as terminal
- cap consecutive transient poll failures at 20 per PR
- reset the failure count on a successful poll
- export IsNotFound for callers to classify the abort
This commit is contained in:
2026-09-09 22:41:27 +10:00
parent 985b58c406
commit 46dfe48adc
4 changed files with 220 additions and 9 deletions
+3
View File
@@ -135,6 +135,9 @@ func runWatch(c *agent.GiteaClient, refs []agent.PRRef, interval time.Duration,
if agent.IsAuthError(err) {
return fmt.Errorf("gitea authentication failed after re-minting the token, watch aborted: %w", err)
}
if agent.IsNotFound(err) {
return fmt.Errorf("PR no longer visible (repo deleted, renamed, or made private), watch aborted: %w", err)
}
return err
}
report(res.Ref.String(), res.Reason, res.State, jsonMode)