cbrr glues together the GitHub CLI (gh) and your local cb CodeBuild helper so you can find failed CodeBuild jobs on a pull request, inspect the logs, and rerun them without touching the AWS Console.
- Lists pull requests via
gh pr listand lets you filter them incrementally. Iffzfis installed (default behavior) you get an interactive picker; otherwise it falls back to a simple text filter. - Shows AWS CodeBuild check statuses (state, bucket, configured profile) before you decide to inspect a job.
- Parses the CodeBuild URL from
gh pr checks, opens the log viacb less, and optionally triggerscb rerun. - Optional config file to map CodeBuild job names to
AWS_PROFILE, so the right credentials are picked automatically.
- Go 1.21+ to build.
ghauthenticated against the target repository.- Your existing
cbbinary (default lookup iscbon$PATH, or setCBRR_CB_PATH). - AWS credentials for the profiles your
cbcommands need (either via the config mapping or shell environment). - Optional:
fzffor the nicer PR picker (disable with--fzf=false).
cd /Users/ryabuki/src/github.com/Konboi/cbrr
go build -o ../cbrr ./cmd/cbrr # adjust output path as you likeor run directly while developing:
cd /Users/ryabuki/src/github.com/Konboi/cbrr
CBRR_CB_PATH=/path/to/cb go run ./cmd/cbrrcbrr looks for a JSON config file in this order:
--config /path/to/file$CBRR_CONFIG$XDG_CONFIG_HOME/cbrr/config.json$HOME/.config/cbrr/config.json
Use the file to map CodeBuild job names to AWS profiles:
{
"profiles": {
"AWS CodeBuild us-west-2 (test-pr)": "research"
}
}Whenever a failing CodeBuild check matches a key in profiles, cbrr sets AWS_PROFILE for cb less/cb rerun and annotates the status output with [profile …].
A starter file lives at config.sample.json.
# open an interactive PR picker, inspect the first failing CodeBuild job, and optionally rerun
cbrr
# skip the picker and go straight to PR #12345
cbrr --pr 12345
# limit the number of PRs fetched and pick a custom cb binary
cbrr --limit 50 --cb /path/to/cb
# force the manual selector even if fzf is installed
cbrr --fzf=falseTypical flow once you launch the tool:
- Pick a pull request.
- Inspect the AWS CodeBuild status summary.
- Select a failing CodeBuild job (if any).
cbrrrunscb less <BUILD_ID>so you can read the log.- Confirm whether to rerun; if yes, it runs
cb rerun <BUILD_ID>.
- Use
CBRR_CB_PATHif yourcbbinary lives outside$PATH. - Combine with
AWS_PROFILEor the config mapping so the right account is used for each CodeBuild job. - To cancel selection in either picker, press
ESC/Ctrl+C(fzf) or typeq(manual mode).