direct: Warn when state was written by a newer CLI version - #6173
Conversation
Approval status: pending
|
Integration test reportCommit: 855f637
10 interesting tests: 4 SKIP, 3 RECOVERED, 1 KNOWN, 1 FAIL, 1 flaky
Top 1 slowest tests (at least 2 minutes):
|
fbf38ab to
d95d7b2
Compare
a1bed90 to
360b44a
Compare
89ebed2 to
66dfc90
Compare
360b44a to
0205b80
Compare
0205b80 to
2a6fa17
Compare
4f78708 to
4b2f17d
Compare
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.
d6fea59 to
855f637
Compare
Stacked on #6222, which makes
cli_versionrecord the CLI that last wrote the state — without that thiswarning reads a value that can be many releases stale.
Why
resources.jsonrecords the CLI version that last wrote it, but nothing looks at it. Deploying withan older CLI than the one that wrote the state is allowed, but it is usually unintended, so warn about
it. The
state_versionfield remains the hard gate —dstate.Openrejects a schema it cannot read.Tests
Acceptance test with a committed
resources.jsonfixture recordingcli_version99.0.0, since therunning version is only known at test time. The negative case derives
cli_versionfrom$CLI versionand asserts silence. Unit test on the comparison covers dev builds, prereleases andmalformed versions.