Commit graph

3 commits

Author SHA1 Message Date
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
Sarah French
d02a1ed1b7
PSS: Make the state storage provider's config stateful (backend state, planfiles) (#37286) 2025-07-08 15:32:27 +01:00
Sarah French
2559f0a3db
Update backend state file so it can describe PSS state (#37179)
* Split code for backend state file vs backend state

* Rename BackendState to BackendConfigState

* Spelling error

* Add `StateStorageConfigState` struct as new implementation of new `ConfigState[T any]` interface.

* Split tests for backend state file vs backend config state structs

* Rename StateStorageConfigState to StateStoreConfigState

* Clarify test name, add comments

* Add tests for StateStoreConfigState methods

* Add test showing state_store in JSON is parsed correctly

* Add detection of malformed backend state files that contain both backend and state_store fields

* Add validation that stops a backend state file being written if it will contain state for both backend and state_store blocks

* Rename `state_storage` to `state_store`

* Rename `state_storage` to `state_store` in filenames

* Move`ConfigState` to its own file

* Fix test name, remove whitespace

* Update `StateStoreConfigState` comment using review suggestion

* Update error message to no longer allude to the environment TF is being run in

* Update the state_store state to use `version.Version` and an adapted version of `tfaddr.Provider` for marshalling version and source data

* Update test helper so it doesn't accidentally supply validation in tests

* Add protection against saving an empty backend state file

* Remove direct testing of (s *Source) MarshalText() and UnmarshalText() methods

* Add Validate method to StateStoreConfigState, use in backend state encoding logic

* Refactor to use new features in registry dependency
2025-06-11 14:10:26 +00:00