-
Notifications
You must be signed in to change notification settings - Fork 0
Request CodeRabbit review on opened PRs #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
willwashburn
wants to merge
30
commits into
main
Choose a base branch
from
agent/explicit-coderabbit-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
4beaccb
request CodeRabbit review on opened PRs
bbee21f
test: permit guarded review draft cleanup
067f7f1
fix: decouple automated review requests
7b43339
fix: close automated review edge cases
4db9988
fix: verify review targets remain open
f0545bf
perf: bound review request reconciliation
2ae5821
fix: query durable review receipts
f2c0517
fix: recognize canonical review identities
040d854
fix: bound recovered operation polling
eeee1ae
fix: recognize root-level review comments
5dae1d4
fix: retry automated review requests
790fb9c
fix: verify review retries stay open
c16c741
fix: arbitrate review request creation
ba584f0
fix: close review request verification gaps
47fea62
fix: bound review request retry lifecycle
3c97b77
fix: drain review requests before shutdown
f8d3d88
fix: bound review request shutdown drain
5d05743
fix: bound review request reconciliation
80e20e4
fix: bind cached write confirmations
b48a592
fix: preserve review backoff in loop mode
ae19188
fix: preserve immediate write status probes
803569f
fix: reverify reconciled review targets
75a214d
test: model authoritative review verification
b47779f
fix: recover review requests after restart
90344cd
fix: bound automated review recovery
a6af6a1
fix: cancel timed out review lookups
3fc578f
fix: preserve PR publisher identity
16442ee
fix: terminate unknown review identity
dbc00f4
fix: stamp adopted review identity
62684be
fix: recover historical PR publisher identity
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import { | ||
| containsCoderabbitReviewRequest, | ||
| FACTORY_CODERABBIT_REVIEW_BODY, | ||
| isAllowedFactoryGithubWritebackDraft, | ||
| isFactoryGithubWritebackPath, | ||
| } from './review-request' | ||
|
|
||
| describe('isFactoryGithubWritebackPath', () => { | ||
| it('allows only the deterministic factory review-request comment path', () => { | ||
| expect(isFactoryGithubWritebackPath( | ||
| '/github/repos/AgentWorkforce/factory/pulls/42/comments/factory-coderabbit-review.json', | ||
| )).toBe(true) | ||
| expect(isFactoryGithubWritebackPath( | ||
| '/github/repos/AgentWorkforce/factory/pulls/42/comments/arbitrary.json', | ||
| )).toBe(false) | ||
| }) | ||
|
|
||
| it('allows only the fixed review-request body at the public comment path', () => { | ||
| const path = '/github/repos/AgentWorkforce/factory/pulls/42/comments/factory-coderabbit-review.json' | ||
| expect(isAllowedFactoryGithubWritebackDraft(path, { | ||
| body: FACTORY_CODERABBIT_REVIEW_BODY, | ||
| })).toBe(true) | ||
| expect(isAllowedFactoryGithubWritebackDraft(path, { | ||
| body: 'arbitrary public comment', | ||
| })).toBe(false) | ||
| expect(isAllowedFactoryGithubWritebackDraft(path, { | ||
| body: FACTORY_CODERABBIT_REVIEW_BODY, | ||
| title: 'unexpected extra field', | ||
| })).toBe(false) | ||
| }) | ||
|
|
||
| it('does not mistake a public marker-only comment for a review command', () => { | ||
| expect(containsCoderabbitReviewRequest( | ||
| '<!-- factory-coderabbit-review-request -->', | ||
| )).toBe(false) | ||
| expect(containsCoderabbitReviewRequest( | ||
| FACTORY_CODERABBIT_REVIEW_BODY, | ||
| )).toBe(true) | ||
| }) | ||
| }) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| export const CODERABBIT_REVIEW_REQUEST = '@coderabbitai review' | ||
| export const FACTORY_CODERABBIT_REVIEW_MARKER = '<!-- factory-coderabbit-review-request -->' | ||
| export const FACTORY_CODERABBIT_REVIEW_BODY = | ||
| `${CODERABBIT_REVIEW_REQUEST}\n${FACTORY_CODERABBIT_REVIEW_MARKER}` | ||
|
|
||
| export const factoryCoderabbitReviewCorrelationId = (repo: string, number: number): string => | ||
| `factory:coderabbit-review:${repo.toLowerCase()}#${number}` | ||
|
|
||
| export const containsCoderabbitReviewRequest = (value: string): boolean => | ||
| value.includes(CODERABBIT_REVIEW_REQUEST) && value.includes(FACTORY_CODERABBIT_REVIEW_MARKER) | ||
|
|
||
| export const isFactoryGithubWritebackPath = (path: string): boolean => | ||
| /^\/github\/repos\/[^/]+\/[^/]+\/(?:pull-requests\/factory-[^/]+\.json|refs\/(?:factory\.json|refs%2Fheads%2Ffactory%2F[^/]+\.json)|pulls\/[1-9]\d*\/(?:close\.json|comments\/factory-coderabbit-review\.json))$/iu.test(path) | ||
|
|
||
| export const isAllowedFactoryGithubWritebackDraft = (path: string, content: unknown): boolean => { | ||
| if (!isFactoryGithubWritebackPath(path)) return false | ||
| if (!/\/pulls\/[1-9]\d*\/comments\/factory-coderabbit-review\.json$/iu.test(path)) return true | ||
| if (content === null || typeof content !== 'object' || Array.isArray(content)) return false | ||
| const record = content as Record<string, unknown> | ||
| return Object.keys(record).length === 1 && record.body === FACTORY_CODERABBIT_REVIEW_BODY | ||
| } | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When additional commits are pushed after the first request, the correlation ID, fixed draft path/body, canonical-comment scan, and process-local request keys still identify only the repository and PR number. The old marker therefore suppresses a new
@coderabbitai reviewrequest for the updated head, leaving the exact current head without the incremental review this mechanism is intended to obtain. Make the request marker and deduplication identity head-SHA-specific.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.