Name the cause when a watch stops on an auth failure #18

Merged
benvin merged 2 commits from benvin/watchpr-auth-failure into main 2026-09-19 17:04:18 +10:00

2 Commits

Author SHA1 Message Date
unkin-agent ff8ac5ea2d Merge main into watchpr auth failure branch
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Keep both sides' additions to client_test.go and adopt main's
EditPROptions -> EditOptions rename.
2026-09-19 16:40:44 +10:00
unkin-agent 90ce747a61 Name the cause when a watch stops on an auth failure
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
A 401/403 was handled as one thing, so watchpr re-minted on every
rejection and reported "token expired" for a permission boundary or an
anonymous run that had no token to expire, sending the reader after the
wrong problem.

Classify a 401/403 as a rejected credential, a permission denial, or a
request that carried no token, and re-mint only the first.
Reject a re-minted empty token instead of replaying anonymously.
Report the classified cause from --once as well as from the watch loop.
Document watchpr's exit behaviour per cause.
2026-09-19 16:13:38 +10:00