Repository navigation
Enable signed Cycle 29 showcase reviews in Linear - #26
Conversation
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: c5bfff5bb5
ℹ️ 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".
| const raw = await request.text(); | ||
| if (raw.length > 7000) return NextResponse.json({ error: 'Review is too long.' }, { status: 413 }); |
There was a problem hiding this comment.
Reject oversized bodies before buffering them
An unauthenticated request is fully materialized by request.text() before the 7,000-character check, so a caller can repeatedly send very large unsigned bodies and force the Worker to allocate and hash them before receiving a 413/401 response. This route should reject an oversized Content-Length before reading and enforce a byte limit while consuming the stream, as the existing feedback webhook does.
Useful? React with 👍 / 👎.
| const commentResult = await linearRequest<{ commentCreate: { success: boolean } }>(token, | ||
| `mutation ShowcaseReviewComment($input: CommentCreateInput!) { commentCreate(input: $input) { success } }`, | ||
| { input: { issueId: issue.id, body } }); | ||
| if (!commentResult.commentCreate.success) throw new Error('Linear did not save the review comment'); | ||
| const updateResult = await linearRequest<{ issueUpdate: { success: boolean; issue: { state: { name: string } } | null } }>(token, |
There was a problem hiding this comment.
Serialize concurrent decisions for each issue
When two signed reviews for the same issue arrive concurrently, both requests can observe In Review before either reaches these mutations, then both create comments and independently update the status; conflicting decisions can therefore both return success, with the last update silently winning. The initial state check does not provide replay or concurrency protection, so decisions need a per-issue idempotency/serialization mechanism before writing to Linear.
Useful? React with 👍 / 👎.
Adds Cycle metadata to the public issue feed and a signed, narrowly scoped review endpoint for George-owned Cycle 29 issues in review. Decisions post an attributed Linear comment and move the issue to Done, In Progress, or Canceled. Rejects unsigned requests, other cycles, assignees, teams, and non-review states. Local full test, typecheck, lint and Worker build passed.