Re-run failed CI jobs for a brave/brave-core PR. Detects failure stage and uses WIPE_WORKSPACE for build/infra failures. Triggers on: make ci green, retry ci, rerun ci, fix ci, re-run failed jobs, retrigger ci.
Re-run failed Jenkins CI jobs for a brave/brave-core PR. Automatically detects the failure stage and decides whether to use WIPE_WORKSPACE (for build/infra failures) or a normal re-run (for test/storybook failures).
The following environment variables must be set (e.g., in your .envrc):
export JENKINS_BASE_URL=https://$JENKINS_BASE_URL
export JENKINS_USER=<your-jenkins-username>
export JENKINS_TOKEN=<your-api-token>
Get your API token from $JENKINS_BASE_URL/me/configure.
Extract the PR number from the user's input. The PR number is required. Check
for --dry-run flag.
| User says | PR number |
|---|---|
/make-ci-green 33936 | 33936 |
| "retry ci for 33936" | 33936 |
| "make ci green on PR 33936" | 33936 |
| "re-run failed jobs 33936 --dry-run" | 33936 (dry run) |
Run the script in dry-run mode to analyze without triggering:
python3 .claude/skills/make-ci-green/retrigger-ci.py <pr-number> --dry-run --format json
Show the user what was found:
Example output (build/infra failure):
PR 33936: 1 failing Jenkins check(s)
[DRY-RUN] continuous-integration/linux-x64/pr-head
Stage: build
Action: WIPE_WORKSPACE
Reason: Pre-test stage failure: "build" -> WIPE_WORKSPACE
URL: https://$JENKINS_BASE_URL/job/brave-core-build-pr-linux-x64/job/PR-33936/2/
Example output (test failure with analysis):
PR 33936: 1 failing Jenkins check(s)
[DRY-RUN] continuous-integration/linux-x64/pr-head
Stage: test_brave_unit_tests
Action: normal
Reason: Test/post-build stage failure: "test_brave_unit_tests" -> normal re-run
URL: https://$JENKINS_BASE_URL/job/brave-core-build-pr-linux-x64/job/PR-33936/2/
Test Failures (2):
- BraveWalletServiceTest.GetBalance
Location: brave
PR correlation: likely_from_pr (PR modifies files in same directory as test: browser/brave_wallet/)
- WebUIURLLoaderFactoryTest.RangeRequest
Location: chromium
Upstream flake: known_upstream_flake
PR correlation: likely_unrelated (Chromium test with no related chromium_src overrides in PR)
>> SUGGEST FILING ISSUE: "Test failure: WebUIURLLoaderFactoryTest.RangeRequest"
Stack trace (last 20 lines):
...
Key decisions shown per test failure:
If the user wants to proceed (and not --dry-run), run the script to trigger