Skip to content

Fix --force-pull on bundle summary and bundle open#5028

Merged
simonfaltum merged 8 commits intomainfrom
simonfaltum/bundle-force-pull-fix
May 7, 2026
Merged

Fix --force-pull on bundle summary and bundle open#5028
simonfaltum merged 8 commits intomainfrom
simonfaltum/bundle-force-pull-fix

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

Why

--force-pull on bundle summary and bundle open is silently ignored: both commands declare the flag but never pass it through, so the local state cache is used even when the user explicitly asks for a remote pull. Users see stale URLs or IDs and have no way to bypass the cache short of deleting .databricks/ by hand.

The flag works as expected on pipelines open and bundle debug states.

Changes

Wire forcePull into ProcessOptions.AlwaysPull in cmd/bundle/summary.go and cmd/bundle/open.go so the flag reaches statemgmt.PullResourcesState. This matches the pattern used in the two commands where the flag already works.

No behavior change when the flag is unset.

Test plan

  • New acceptance test acceptance/bundle/state/force_pull_commands/ asserts that a workspace-files state GET is issued only when --force-pull is set, for both bundle summary and bundle open. Runs under both engines via EnvMatrix.
  • Reverted the fix locally and confirmed the test fails with the expected diff (missing state GETs), then restored.
  • `make checks` clean; state/help/open/summary/pipelines-open acceptance suites all pass.

Both commands declared the flag but never passed it into
ProcessOptions.AlwaysPull, so it silently no-oped and users were served
stale local state. Wire forcePull into AlwaysPull in both commands to
match the pattern in pipelines open and bundle debug states.

Co-authored-by: Isaac
@simonfaltum simonfaltum requested a review from denik April 20, 2026 11:35
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 6, 2026 09:27 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 6, 2026 09:27 — with GitHub Actions Inactive
Comment thread NEXT_CHANGELOG.md Outdated
### Bundles
* engine/direct: Drop the deployment state entry on a recreate before the follow-up `Create`, so a `Create` failure no longer leaves a broken state with `invalid state: empty id` on the next `bundle plan` ([#5173](https://github.com/databricks/cli/pull/5173)).

* engine/direct: Added support for Vector Search Endpoints ([#4887](https://github.com/databricks/cli/pull/4887))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This line seems to be obsolete here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done, removed in 8b13513.

That entry was already shipped in v0.299.0; addresses Andrew's review.

Co-authored-by: Isaac
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 7, 2026 11:57 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 7, 2026 11:57 — with GitHub Actions Inactive
@simonfaltum simonfaltum merged commit f0edaa4 into main May 7, 2026
16 of 25 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/bundle-force-pull-fix branch May 7, 2026 14:12
simonfaltum added a commit that referenced this pull request May 8, 2026
## Why

The acceptance test added in #5028 was merged with CI red on every
platform. Two follow-up issues:

1. **macOS**: the script bails at the first `print_requests.py` call
because `bundle summary` without `--force-pull` makes zero HTTP
requests, so `out.requests.txt` is never created after the `rm -f`
earlier in the script. `print_requests.py` then exits with `File
[TEST_TMP_DIR]/out.requests.txt not found`, and the rest of the script
never runs. The test only runs on darwin (`GOOS.windows = false`,
`GOOS.linux = false`), so this manifested as a macOS-only failure.
2. **Linux/Windows**: the post-test `git diff --exit-code` check fails
because `out.test.toml` was checked in using the older `[GOOS]` /
`[EnvMatrix]` table form, but the framework now serializes those keys in
dotted form.

## Changes

**Before:** `bundle summary` (no `--force-pull`) makes 0 requests, file
is missing, `print_requests.py` exits 1, the rest of the test never
runs.

**Now:** `touch out.requests.txt` before each `print_requests.py` call
so the helper sees an empty file and prints nothing, matching the
expected output. Also regenerate `out.test.toml` so it matches the
current serialization format.

## Test plan

- [x] `go test ./acceptance -run
"TestAccept/bundle/state/force_pull_commands" -v` passes locally on
darwin (both `direct` and `terraform` engines)
- [x] `go test ./acceptance -run "^TestAccept$" -only-out-test-toml`
produces no further diff
- [x] `./task checks` clean

This pull request and its description were written by Isaac.
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.

2 participants