Abort watchpr when a poll can no longer see the PR
- 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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user