Skip to content

direct: Warn when state was written by a newer CLI version - #6173

Open
denik wants to merge 2 commits into
denik/dev_versionfrom
denik/cli_version_warning
Open

direct: Warn when state was written by a newer CLI version#6173
denik wants to merge 2 commits into
denik/dev_versionfrom
denik/cli_version_warning

Conversation

@denik

@denik denik commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #6189.

Why

resources.json already records the CLI version that last wrote it, but nothing looks at it.
Deploying with an older CLI than the one that wrote the state is allowed, but it is usually
unintended, so warn about it. The state_version field remains the hard gate — dstate.Open rejects a
schema it cannot read.

Tests

Acceptance test with a committed resources.json fixture recording cli_version 99.0.0, since the
running version is only known at test time. The negative case derives cli_version from $CLI version
and asserts silence. Unit test on the comparison covers dev builds, prereleases and malformed
versions.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

6 files changed
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @andrewnester, @pietern, @lennartkats-db, @anton-107

/bundle/ - needs approval

Files: bundle/direct/dstate/state.go
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @andrewnester, @pietern, @lennartkats-db, @anton-107

/cmd/bundle/ - needs approval

Files: cmd/bundle/utils/process.go, cmd/bundle/utils/process_test.go
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @andrewnester, @pietern, @lennartkats-db, @anton-107

General files (require maintainer)

Files: .nextchanges/bundles/state-newer-cli-version-warning.md
Based on git history:

  • @janniklasrose -- recent work in .nextchanges/bundles/, bundle/direct/dstate/

Any maintainer (@andrewnester, @anton-107, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: d95d7b2

Run: 31101951889

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 291 1106 5:55
💚​ aws windows 4 4 293 1104 5:44
💚​ azure linux 4 4 290 1106 6:00
💚​ azure windows 4 4 292 1104 5:51
💚​ gcp linux 1 5 291 1106 6:14
💚​ gcp windows 1 5 293 1104 6:13
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 4 slowest tests (at least 2 minutes):
duration env testname
3:42 gcp windows TestAccept
2:57 azure windows TestAccept
2:53 aws windows TestAccept
2:16 gcp windows TestFilerWorkspaceFilesExtensionsRead

denik added 2 commits August 6, 2026 14:22
resources.json records the CLI version that last wrote it. Warn on
plan/deploy when that version is newer than the running build.
The fixtures recorded cli_version 0.0.0 as a placeholder; with dev builds
reporting a real version this no longer looks newer than the running CLI,
so they need no change. Update the version comparison tests to use real
dev versions instead of the old 0.0.0-dev scheme.
@denik
denik force-pushed the denik/cli_version_warning branch from fbf38ab to d95d7b2 Compare August 6, 2026 12:33
@denik
denik changed the base branch from main to denik/dev_version August 6, 2026 12:33
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