Repository navigation
Commit review transitions and GitHub outbox intent atomically - #3
Conversation
ClearanceNo review requirements were triggered. Warnings
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb7204328e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "upsert-comment": | ||
| return { | ||
| type: githubOutboxJobTypes.upsertComment, | ||
| payload: { ...pull, body: effect.body }, |
There was a problem hiding this comment.
Prevent stale transition jobs from overwriting newer review state
When an earlier transition's comment or status job fails and is delayed for retry, a later transition for the same PR can complete first; the older job then retries and overwrites the sticky comment and same-SHA statuses with stale state. For example, a pending-status job can fail, an approval transition can publish success, and the pending job can subsequently revert the visible check indefinitely. These jobs need per-PR/SHA sequencing, version checks, or supersession before execution rather than being independent unversioned outbox entries.
Useful? React with 👍 / 👎.
An outbox insertion failure could leave a reviewer assignment, notification, or escalation recorded in Clearance state without scheduling its GitHub work. The workflow then swallowed the failure and the webhook delivery could be marked processed, preventing a useful retry.
PR changes, submitted reviews, and escalation runs now submit state and typed outgoing intent through one
commitTransitioninterface. The GitHub adapter translates that intent into existing outbox jobs, and the Drizzle store commits canonical state, its projections, and the complete job batch in one transaction. Failed acceptance propagates to the handler, which records a failed delivery; retry can then schedule the work that rolled back. GitHub execution remains asynchronous in the existing outbox runner. The standalone state-save/enqueue path and catch-and-continue callbacks have been removed.Validation:
npm run typecheck,npm run lint,npm test(165 tests),npm run format, andnpm run buildpass.PGlite is a pinned development dependency. Its fixture applies the Clearance schema migration using PostgreSQL's native UUID function instead of Supabase's pgcrypto wrapper. No schema migration is required. These checks exercise transactional persistence locally; they do not verify hosted Supabase, connection pooling, concurrent workers, or exactly-once GitHub execution.