Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Konboi/cbrr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cbrr - CodeBuild ReRun helper

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.

Features

  • Lists pull requests via gh pr list and lets you filter them incrementally. If fzf is 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 via cb less, and optionally triggers cb rerun.
  • Optional config file to map CodeBuild job names to AWS_PROFILE, so the right credentials are picked automatically.

Requirements

  • Go 1.21+ to build.
  • gh authenticated against the target repository.
  • Your existing cb binary (default lookup is cb on $PATH, or set CBRR_CB_PATH).
  • AWS credentials for the profiles your cb commands need (either via the config mapping or shell environment).
  • Optional: fzf for the nicer PR picker (disable with --fzf=false).

Installation

cd /Users/ryabuki/src/github.com/Konboi/cbrr
go build -o ../cbrr ./cmd/cbrr   # adjust output path as you like

or run directly while developing:

cd /Users/ryabuki/src/github.com/Konboi/cbrr
CBRR_CB_PATH=/path/to/cb go run ./cmd/cbrr

Configuration

cbrr looks for a JSON config file in this order:

  1. --config /path/to/file
  2. $CBRR_CONFIG
  3. $XDG_CONFIG_HOME/cbrr/config.json
  4. $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.

Usage

# 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=false

Typical flow once you launch the tool:

  1. Pick a pull request.
  2. Inspect the AWS CodeBuild status summary.
  3. Select a failing CodeBuild job (if any).
  4. cbrr runs cb less <BUILD_ID> so you can read the log.
  5. Confirm whether to rerun; if yes, it runs cb rerun <BUILD_ID>.

Tips

  • Use CBRR_CB_PATH if your cb binary lives outside $PATH.
  • Combine with AWS_PROFILE or 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 type q (manual mode).

About

CodeBuild Re-Run Helper (Created by Codex)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages