-
Notifications
You must be signed in to change notification settings - Fork 685
fix(ci): revalidate readiness when CodeRabbit finds new issues #1175
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
556dc88
fix(ci): revalidate readiness on CodeRabbit findings
Wibias 160ef53
test(ci): cover CodeRabbit readiness revalidation
Wibias 296ab8a
test(ci): bind readiness guard assertion
Wibias 388eb62
test(ci): keep readiness regression out of existing shards
Wibias be5857f
test(ci): remove superseded readiness test path
Wibias b98e6e5
fix(ci): retain CodeRabbit outside-diff findings
Wibias d1cb1a0
test(ci): pin durable outside-diff findings
Wibias 410e855
test(ci): pin deterministic CodeRabbit review ordering
Wibias 43479a0
fix(ci): make CodeRabbit review ordering deterministic
Wibias 5dae9e2
test(ci): pin default-branch trust for comment gate
Wibias aaca47f
fix(ci): source comment gate scripts from default branch
Wibias 3322303
test(ci): update trusted checkout boundary assertion
Wibias 9d43c05
test(ci): run CodeRabbit ordering regression in required suite
Wibias b093eac
test(ci): align hardening allowlist with trusted comment checkout
Wibias 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
|
|
||
| type Workflow = { | ||
| on?: { | ||
| issue_comment?: { types?: string[] }; | ||
| }; | ||
| jobs?: Record< | ||
| string, | ||
| { | ||
| if?: string; | ||
| steps?: Array<{ | ||
| name?: string; | ||
| with?: Record<string, string>; | ||
| }>; | ||
| } | ||
| >; | ||
| }; | ||
|
|
||
| describe("CodeRabbit readiness revalidation", () => { | ||
| test("CodeRabbit PR status comments can rerun the findings gate", async () => { | ||
| const text = await Bun.file( | ||
| new URL("../.github/workflows/enforce-pr-target.yml", import.meta.url), | ||
| ).text(); | ||
| const workflow = Bun.YAML.parse(text) as Workflow; | ||
|
|
||
| expect(workflow.on?.issue_comment?.types).toEqual(["created", "edited"]); | ||
|
|
||
| const job = workflow.jobs?.["enforce-target"]; | ||
| expect(job).toBeDefined(); | ||
| expect(job?.if).toContain("github.event.issue.pull_request != null"); | ||
| expect(job?.if).toContain("github.event.comment.user.login == 'coderabbitai[bot]'"); | ||
|
|
||
| const gateStep = job?.steps?.find( | ||
| step => step.name === "Enforce PR target, ancestry, and description", | ||
| ); | ||
| const script = gateStep?.with?.script ?? ""; | ||
|
|
||
| expect(script).toContain('const CODE_RABBIT_LOGIN = "coderabbitai[bot]"'); | ||
| expect(script).toContain("const isCodeRabbit = commenter === CODE_RABBIT_LOGIN"); | ||
| expect(script).toContain("!isCodeRabbit"); | ||
| expect(script).toContain("isCanonicalMaintainer"); | ||
| expect(script).toMatch( | ||
| /!isPrComment\s*\|\|\s*\(\s*!isCodeRabbit\s*&&\s*\(\s*!\[[\s\S]{0,300}?\.includes\(association\)\s*\|\|\s*!isCanonicalMaintainer\s*\)\s*\)/, | ||
| ); | ||
| expect(script).toContain("unresolvedFindingsClaim"); | ||
| }); | ||
| }); |
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.
Uh oh!
There was an error while loading. Please reload this page.