Repository navigation
ci: add /cr Claude PR review pipeline - #5
Merged
Merged
Conversation
There was a problem hiding this comment.
2 issues found across 1 file
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Replicate getboon/boon's claude-pr-review workflow: runs the pr-review-toolkit:review-pr skill via anthropics/claude-code-action, posting inline comments plus a consolidated severity-grouped summary. - Triggers: auto on PR open (non-draft, not claude[bot]) and on a /cr or /claude-review comment from a human. - Advisory (continue-on-error): never gates merge; ClawSweeper/CodeQL remain the gating reviewers. - Adapted to repo conventions: third-party action SHA-pinned to v1, .yml, actionlint/no-tabs clean. Requires an ANTHROPIC_API_KEY repo secret to run. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address cubic review on PR #5: - P1: restrict the issue_comment path to OWNER/MEMBER/COLLABORATOR. This repo is public and issue_comment runs with secrets regardless of commenter, so any drive-by user could otherwise spend the API budget. - P2: replace contains('/claude-review') with exact match plus a 'cmd '-prefix allowance, so comments merely mentioning the command don't trigger a run. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
insomnius
force-pushed
the
worktree-cr-pipeline
branch
from
June 3, 2026 06:28
52af314 to
26ba389
Compare
Address CodeQL actions/untrusted-checkout(-toctou)/high on PR #5: - Refuse fork (cross-repository) PRs on the issue_comment path so the privileged job never checks out untrusted code; /cr on a fork PR has no usable secret anyway, and same-repo branches are push-gated to collaborators, so their head is trusted. - Drop id-token: write; the action authenticates via ANTHROPIC_API_KEY, so OIDC is unused and withholding it shrinks the privileged surface. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Approved — privileged workflow security posture is sound (trusted-role gate, fork refusal before checkout, id-token dropped, continue-on-error, exact-match commands, SHA-pinned action, allowed_bots explicit). All checks green. Pin 787c5a0c verified as a real claude-code-action commit.
3 tasks done
william-antoline-boon
added a commit
that referenced
this pull request
Oct 1, 2026
* feat(sentry-monitor): tag captures with session_id (ENG-20876) Reliability Metric #5 tracks per-customer/day error rate (account_id tag, already live) but has no per-session dimension: session_id was only ever in contexts, which Sentry does not index, so a session's errors could not be searched for or grouped. Promotes the session correlation value each builder already had available into an indexed tag, for model_call_ended, before_tool_call_hook_failed, message_sent, cron_changed, session_end, and after_tool_call (whose ctx carries sessionId even though the event itself doesn't — threaded through register.ts the same way agent_end already does). delivery_recovery_exhausted and subagent_ended are left untouched: neither has an existing session_id-shaped value to promote, and inventing one (which of two session keys subagent_ended's ctx exposes; conflating sessionKey into session_id with no prior precedent for either hook) is a bigger call than this ticket asks for. 103 tests pass (60 in captures.test.ts, 8 new), oxlint clean, oxfmt --check clean. * fix(deps): bump the brace-expansion override 5.0.9 -> 5.0.12 for GHSA-qhr7-859c-m2p7 / GHSA-6j4f-fj2g-mc7p Two HIGH advisories published after the 5.0.9 pin (itself a fix for two older brace-expansion DoS advisories) cover 5.0.9 too: unbounded recursion on nested brace groups (<5.0.11) and in parseCommaParts (<5.0.10). Moves the pnpm-workspace.yaml override to 5.0.12 and regenerates pnpm-lock.yaml + the root npm-shrinkwrap.json. pnpm-audit-prod (security-fast's gate) now reports no high-or-higher advisories in production dependencies. Unrelated to this branch's actual change (session_id tagging) — this was failing on any current PR against boon, caught while getting CI green. * fix(feishu): pin timeout-wrapper return types against axios 1.20's new R generic axios 1.20.0's request/get/post/... methods gained a new R generic (R = AxiosResponseDefault, an unexported sentinel) so callers can override the response type. createTimeoutHttpInstance's wrapper methods assign plain arrow functions against Lark.HttpInstance's own generic method signature (request<T=any, R=T, D=any>(...): Promise<R>) with no explicit type arguments on either side. Under contextual inference the two same-named R type parameters collide, and axios's conditional response type (R extends AxiosResponseDefault ? AxiosResponse<...> : R) never reduces, so TS2322 fires on all 8 wrapper methods (check-prod-types, check-test-types, check-additional-extension-package-boundary). Pinning each wrapper's return type to `Promise<any>` (Lark's own default when its R is left unspecified) breaks the collision without changing behavior — these are pure pass-through wrappers, runtime shape is unaffected either way. Verified: pnpm tsgo:core, tsgo:extensions, tsgo:core:test, tsgo:extensions:test, and test:extensions:package-boundary:compile (117 extensions) all clean. Feishu's own suite (72 files / 962 tests) and sentry-monitor's (103 tests) still green. * fix: avoid bare any lint error; update axios pin assertion to 1.20.0 check-lint (both the plain and bundled-extension shard) flagged the previous fix's 8 inline `Promise<any>` return annotations against no-explicit-any. Consolidated to one local `WrapperResponse` type alias with a single oxlint-disable, so the literal `any` token appears once instead of eight times. Separately, checks-node-bundle-infra-small-4 failed because src/infra/npm-managed-root.test.ts asserts the real pnpm-workspace.yaml override value for axios via toMatchObject — it had "1.18.1" hardcoded from before this branch's security bump; updated to "1.20.0". Verified: pnpm lint --threads=8, run-bundled-extension-oxlint.mjs, tsgo:extensions, test:extensions:package-boundary:compile, the specific npm-managed-root.test.ts (27/27), and feishu's + sentry-monitor's full suites all green. * test: register the new feishu client.ts suppression on the explicit allowlist test/scripts/lint-suppressions.test.ts inventories every production oxlint-disable via an explicit allowlist (both an overall list and a no-explicit-any-specific one) so a new suppression can't slip in unnoticed. The previous commit's WrapperResponse suppression in extensions/feishu/src/client.ts was real and intentional but wasn't on either list yet. Added in the position `git grep` actually returns it (extensions/ sorts before src/, and bitable.ts before client.ts). Verified: test/scripts/lint-suppressions.test.ts passes (3/3) against the real git-tracked suppression set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
/crClaude PR review pipeline, replicatinggetboon/boon'sclaude-pr-reviewworkflow and wiring it to GitHub Actions in this fork.New file:
.github/workflows/claude-pr-review.yml. It runs thepr-review-toolkit:review-prskill viaanthropics/claude-code-action, posts inline review comments, then a single consolidated severity-grouped summary comment.claude[bot]) and on-demand via a/cr(exact) or/claude-reviewcomment from a human.continue-on-error: true— never gates merge. ClawSweeper / CodeQL / opengrep remain the gating reviewers.claude-sonnet-4-6,--max-turns 50, narrow--allowedTools.Repo-convention adaptations (vs boon's copy)
anthropics/claude-code-action@787c5a0ce96a9a6cfb050ea0c8f4c05f2447c251 # v1..yml, no tabs,actionlint-clean to passworkflow-sanity.yml.concurrencykeyed on PR number withcancel-in-progress.Operator prerequisite
Requires an
ANTHROPIC_API_KEYrepo secret. Without it the step fails butcontinue-on-errorkeeps the check neutral. Same-repo PRs receive the secret; outside-fork PRs do not (GitHub security) — same posture as boon.Verification
actionlint1.7.11 (the exact binaryworkflow-sanity.ymlruns) — clean.v1tag dereferenced to the pinned commit SHA via the GitHub API.Real behavior proof
Behavior addressed: New
/crClaude PR review GitHub Action that reviews PRs and posts inline + summary comments.Real environment tested: Local lint/parse only (no
ANTHROPIC_API_KEYavailable in this environment).Exact steps or command run after this patch:
actionlint .github/workflows/claude-pr-review.yml; tab byte-scan;python3 yaml.safe_load.Evidence after fix: actionlint exited 0 ("ACTIONLINT CLEAN"); no tabs; YAML parsed OK.
Observed result after fix: Workflow is syntactically valid and passes the same gates CI enforces.
What was not tested: A live review run (opening a PR / commenting
/cr) — depends on theANTHROPIC_API_KEYsecret being set; verify on this PR once the secret exists.Summary by cubic
Adds a GitHub Actions workflow that runs a Claude-powered PR review on new PRs and on-demand via a
/cror/claude-reviewcomment, posting inline comments and a single severity-grouped summary. It’s non-blocking, limits comment runs to trusted roles, and now blocks fork-PR comment runs and omits the id-token to shrink the privileged surface.New Features
.github/workflows/claude-pr-review.ymlusinganthropics/claude-code-actionto runpr-review-toolkit:review-pr./cror/claude-reviewfromOWNER/MEMBER/COLLABORATORonly; exact-match commands; skipsclaude[bot].continue-on-error: true), PR-scoped concurrency with cancel-in-progress, SHA-pinned to v1./cron fork PRs to avoid untrusted checkout; dropid-tokenpermission.Migration
ANTHROPIC_API_KEYas a repo secret to enable runs (not available to fork PRs).Written for commit 2d369ec. Summary will update on new commits.