Scope watchpr's terminal 404 to the PR lookup
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Only a 404 from GetPR means the PR is gone. A 404 from any other call
can be a proxy or ingress blip, so it now warns and counts against the
consecutive-failure cap instead of killing the watch on first sight.
This commit is contained in:
2026-09-09 22:55:56 +10:00
parent 46dfe48adc
commit d04c5aa58d
3 changed files with 187 additions and 7 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ 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) {
if agent.IsPRGone(err) {
return fmt.Errorf("PR no longer visible (repo deleted, renamed, or made private), watch aborted: %w", err)
}
return err