Add authenticated PR preview retries #35

Closed
opened 2026-10-16 22:39:50 +00:00 by kritdass · 1 comment
Member

Collar can retry branch builds through Forgejo webhook tests, but those tests always send a push event. Kennel previews require a pull-request event, so collar kennel retry --pr NUMBER cannot safely trigger them.

Add an authenticated PR retry endpoint that:

  • Accepts a repository, PR number, and expected head SHA; resolves the current PR head, including forks, and rejects stale revisions.
  • Checks repository access and Kennel's preview policy, then requeues the failed or cancelled preview through the existing build path (pr-N, refs/pull/N/head).
  • Returns the build ID and state, and handles repeated requests without duplicate builds so clients can recover from timeouts.

This would let Collar retry previews without webhook administration permission or risking a default-branch build. Related: #4.

Collar can retry branch builds through Forgejo webhook tests, but those tests always send a push event. Kennel previews require a pull-request event, so `collar kennel retry --pr NUMBER` cannot safely trigger them. Add an authenticated PR retry endpoint that: - Accepts a repository, PR number, and expected head SHA; resolves the current PR head, including forks, and rejects stale revisions. - Checks repository access and Kennel's preview policy, then requeues the failed or cancelled preview through the existing build path (`pr-N`, `refs/pull/N/head`). - Returns the build ID and state, and handles repeated requests without duplicate builds so clients can recover from timeouts. This would let Collar retry previews without webhook administration permission or risking a default-branch build. Related: #4.
Author
Member

Tracking this in Collar instead: ScottyLabs/collar#2

Tracking this in Collar instead: https://git.cmu.dev/ScottyLabs/collar/issues/2
Sign in to join this conversation.
No description provided.