terraform/internal/command/workdir
Sarah French 7a27366b39
PSS: Add ability to create hashes of the state_store block and of its nested provider block (#37278)
* Add the ability to make a hash of state store config

* Add test demonstrating that the provider block doesn't impact the hash of a state_store block

* Make sure test asserts what would happen if the schema DID include the provider block

* Update the Hash method to return diagnostics, ignore nested provider blocks, and validate incoming schema and config

* Update tests to use more representative config, fix code under test as a result

* Update Hash method to return hashes for both the state_store and provider blocks

* Add test cases to cover how required fields are tolerated when making the hash

This is because ENVs may supply those values.

* Fix inaccurate comments

* Add test to show that hashes are consistent and exclude the provider block

* Update backend state file to contain hash of provider block's config

* Fix test to expect a hash for the provider config block.

* Fix bug in DeepCopy method, update test to have better error messages when diffs are detected

* Update test to explicitly check hash values

* Try make test intention clearer

* Improve user feedback when state store schema contains the protected word "provider"

* Update tests

* Update test to test the Hash method in a more true-to-life way

Copy of 04a1201878cd1f6f117c43c43c1ee9d0fc17cec1 by Radek Simko

* Update test to use new approach

* Fix `TestInit_stateStoreBlockIsExperimental` test failure
2025-07-14 13:52:27 +01:00
..
backend_config_state.go PSS: Make the state storage provider's config stateful (backend state, planfiles) (#37286) 2025-07-08 15:32:27 +01:00
backend_config_state_test.go PSS: Make the state storage provider's config stateful (backend state, planfiles) (#37286) 2025-07-08 15:32:27 +01:00
backend_state.go Fix bug in DeepCopy of backend state data that causes loss of StateStore data (#37276) 2025-06-26 21:38:45 +01:00
backend_state_test.go PSS: Add ability to create hashes of the state_store block and of its nested provider block (#37278) 2025-07-14 13:52:27 +01:00
config_state.go PSS: Make the state storage provider's config stateful (backend state, planfiles) (#37286) 2025-07-08 15:32:27 +01:00
dir.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
doc.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
normalize_path.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
plugin_dirs.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
plugin_dirs_test.go Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
statestore_config_state.go PSS: Add ability to create hashes of the state_store block and of its nested provider block (#37278) 2025-07-14 13:52:27 +01:00
statestore_config_state_test.go PSS: Make the state storage provider's config stateful (backend state, planfiles) (#37286) 2025-07-08 15:32:27 +01:00
testing.go PSS: Add ability to create hashes of the state_store block and of its nested provider block (#37278) 2025-07-14 13:52:27 +01:00