Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

SarahFrench
Copy link
Member

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 - see TestInit_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 in TestInit_stateStore_providerUpgrade.

Changes covered:

  • state_store config changed - internal/command/testdata/state-store-changed/store-config
  • provider config changed - internal/command/testdata/state-store-changed/provider-config
  • state_store type changed - internal/command/testdata/state-store-changed/state-store-type
  • provider used for PSS changed - internal/command/testdata/state-store-changed/provider-used
  • provider upgraded - internal/command/testdata/state-store-changed/provider-upgraded

Target Release

N/A

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

…iltin and re-attached providers.

This makes comparison easier when determining if config has changed since last init.
…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.
@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Oct 15, 2025
@SarahFrench SarahFrench marked this pull request as ready for review October 15, 2025 17:08
@SarahFrench SarahFrench requested a review from a team as a code owner October 15, 2025 17:08
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) {
Copy link
Member Author

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

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.