-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS: Let the init
command recognise when there are no changes in configuration.
#37777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SarahFrench
wants to merge
21
commits into
main
Choose a base branch
from
pss/init-base-case-no-config-changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+747
−96
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ing backend state (i.e. no changes)
…iltin and re-attached providers. This makes comparison easier when determining if config has changed since last init.
…d state_store config changes being tested
…a change, but handling this scenario isn't implemented yet
Previously dummy values were fine, but as tests using hashes to identify changes these values need to be accurate!
…der version as described in the backend state file fixture for the test.
…as a change, but handling this scenario isn't implemented yet
…ation in the same provider is detected as a change, but handling this scenario isn't implemented yet
…as a change, but handling this scenario isn't implemented yet
…ut handling this scenario isn't implemented yet
Just to avoid any confusion if copy-pasting happens in future.
…ull, and replace dummy hash values with correct values.
…ce would already exist in this scenario
…no-op for backend state
…& update test to not expect a value for region attr in provider config
SarahFrench
commented
Oct 15, 2025
Comment on lines
+961
to
+966
if s.StateStore.Provider.Source.Equals(stateStoreConfig.ProviderAddr) && | ||
s.StateStore.Provider.Version.Equal(pVersion) && | ||
(uint64(stateStoreProviderHash) == s.StateStore.Provider.Hash) && | ||
s.StateStore.Type == stateStoreConfig.Type && | ||
(uint64(stateStoreHash) == s.StateStore.Hash) && | ||
(!opts.Init || opts.ConfigOverride == nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty dense, though is carrying-forward how the equivalent block is handled for backends.
I imagine that any refactoring here would inform how the rest of this case block is implemented. Would it be ok to save that for a subsequent PR(s)?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows the experimental PSS version of
init
logic recognise when there have been no changes since the last init, so init will perform a no-op (in regards to state storage, at least).I've added a test showing that init is a no-op in those circumstances :
TestInit_stateStore_configUnchanged
I've also added tests showing that when backend state and config don't match we hit a
not configured yet
error diagnostic - seeTestInit_stateStore_configChanges
. To do this I've created sets of test fixtures where the backend state file and config are not in agreement. A special case of this, upgraded provider versions, is inTestInit_stateStore_providerUpgrade
.Changes covered:
internal/command/testdata/state-store-changed/store-config
internal/command/testdata/state-store-changed/provider-config
internal/command/testdata/state-store-changed/state-store-type
internal/command/testdata/state-store-changed/provider-used
internal/command/testdata/state-store-changed/provider-upgraded
Target Release
N/A
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry