Skip to content

feat: skip rebuild when build already succeeded with -d flag#52

Merged
vtz merged 4 commits into
mainfrom
feat/skip-rebuild-if-up-to-date
May 21, 2026
Merged

feat: skip rebuild when build already succeeded with -d flag#52
vtz merged 4 commits into
mainfrom
feat/skip-rebuild-if-up-to-date

Conversation

@vtz
Copy link
Copy Markdown
Owner

@vtz vtz commented May 21, 2026

Summary

  • When using bob build <name> -d <dir>, the CLI now checks if the build already succeeded before triggering a new PipelineRun
  • If up-to-date, it downloads existing artifacts directly and prints the commit SHA + toolchain image for transparency
  • Adds --force flag to override the check and always trigger a fresh build
  • Avoids redundant multi-minute rebuilds when neither source nor toolchain have changed

Behavior

# Already succeeded → downloads immediately, no rebuild
bob build body-ecu-nucleo -d ./out
# Output:
#   Build "body-ecu-nucleo" already up-to-date, skipping rebuild.
#     Run:    body-ecu-nucleo-run27
#     Commit: 5c447ae3...
#     Image:  image-registry.../body-ecu:latest
#   downloading zephyr.bin ...

# Force rebuild even if succeeded
bob build body-ecu-nucleo -d ./out --force

Test plan

  • go build ./cmd/bob/ compiles
  • go test ./cmd/bob/ all tests pass
  • Manual: bob build <name> -d ./out with succeeded build skips retrigger
  • Manual: bob build <name> -d ./out --force always retriggers
  • Manual: bob build <name> -d ./out with failed/running build triggers normally

Made with Cursor

When using `bob build <name> -d <dir>`, the CLI now checks if the build
is already in Succeeded phase before triggering a new run. If so, it
downloads existing artifacts directly, showing the commit and toolchain
image for transparency. Use --force to override this and always rebuild.

This avoids redundant multi-minute builds when the source (commit) and
toolchain image haven't changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@vtz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3ca2fc85-37a5-45c5-816f-dc3fc2755264

📥 Commits

Reviewing files that changed from the base of the PR and between db5d0d6 and 2ff8f96.

📒 Files selected for processing (3)
  • cmd/bob/build.go
  • cmd/bob/wait.go
  • cmd/bob/wait_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skip-rebuild-if-up-to-date

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46416353eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/bob/build.go Outdated
Comment on lines +105 to +106
if downloadDir != "" && !force {
if skipped, err := downloadIfUpToDate(cmd.Context(), args[0], downloadDir, skipVerify); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retrigger after source restore before skipping rebuild

autoRestoreIfLocal runs immediately before this block and restoreGitSource only patches the BuildJob spec back to git source (it does not trigger a new run). With the new skip path, a previously succeeded local build now causes bob build <name> -d to exit early and download old artifacts, even though the source was just restored to git. This is a regression for the common flow “local build succeeded, then run non-local download” unless users remember --force.

Useful? React with 👍 / 👎.

vtz and others added 2 commits May 21, 2026 11:49
Co-authored-by: Cursor <cursoragent@cursor.com>
When autoRestoreIfLocal switches the BuildJob back to git source, the
previous Succeeded phase is from the local build. Skip the up-to-date
check in that case to ensure a fresh build from the restored git source.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vtz vtz merged commit a9ef073 into main May 21, 2026
3 checks passed
@vtz vtz deleted the feat/skip-rebuild-if-up-to-date branch May 21, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant