Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Jun 17, 2025

Follow up to #37246, which began implementing use of pluggable state stores with planfiles.

This PR:

  • Fixes the work from the previous PR: Update data stored in plan files to enable using PSS with saved plans #37246 didn't include storage of the provider's config in the plan file.
  • Adds methods for determining if a plan's description of a backend or state store is empty or not
    • See a3d302b and a7c90a3
    • Refactors some logic to use these methods instead of inspecting values within a Backend or StateStore description.
  • Implements saving state store config to a planfile:
    • Allow Operations to describe the state store in use, and use that data when writing the plan file: 74e0add
  • Implements initialising a state store from a planfile:

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.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Jun 17, 2025
@SarahFrench SarahFrench changed the title Pss/update how operations use backend config state Update how operations use backend config state in context of PSS Jun 17, 2025
@github-actions
Copy link
Contributor

The equivalence tests failed. Please investigate here.

@SarahFrench SarahFrench changed the base branch from main to pss/store-pss-in-planfile June 17, 2025 18:49
@github-actions
Copy link
Contributor

The equivalence tests failed. Please investigate here.

@SarahFrench SarahFrench force-pushed the pss/store-pss-in-planfile branch from 7b80adb to a2acc33 Compare June 18, 2025 09:00
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 1da8373 to cd0c5b2 Compare June 18, 2025 09:03
@github-actions
Copy link
Contributor

The equivalence tests failed. Please investigate here.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from a42acd7 to 2415a6f Compare June 18, 2025 10:50
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 2415a6f to a5a439f Compare June 18, 2025 11:09
Base automatically changed from pss/store-pss-in-planfile to main June 30, 2025 10:39
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from a5a439f to 1f72760 Compare November 13, 2025 14:41
@github-actions
Copy link
Contributor

The equivalence tests failed. Please investigate here.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 2 times, most recently from cb564b4 to 388ced0 Compare November 25, 2025 13:01
@github-actions
Copy link
Contributor

The equivalence tests failed. Please investigate here.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from e3453d7 to d7cb4cb Compare November 26, 2025 17:58
This helps with navigating ambiguity around the word backend. The new name should indicate that the value represents a `backend` block, not a more general interpretation of what a backend is.
…to a lack of data. Don't change it if pluggable state storage is in use.
…sentation of a backend or state_store is empty/unset. Add tests.

The alternative approach would be to change the existing `Backend` field in the `Plan` struct to be a pointer. I'm open to either option, but the approach of using an `Empty` method matches existing work in the `workdir` package when inspecting the backend state file, and that seems a similar use-case to inspecting the plan file.
… isn't present; this is valid if the schema contains no attributes or blocks.
…ng it to prepare a Local backend that uses the state store
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 2 times, most recently from 88c80eb to ef2b038 Compare November 26, 2025 18:17
Comment on lines -195 to +197
Type: "local",
Config: backendConfigRaw,
Type: "local",
Config: backendConfigRaw,
Workspace: "default",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change a lot of existing tests started failing because the Backend 's Empty method returned true, due to the Workspace value being unset.

Error: plan does not have a backend or state_store configuration

…ly isn't valid for `stateStoreConfigState` to be nil

I'm about 90% sure that backendConfigState being nil is ok <_<
…rmine if data is present for a state store or backend in a planfile
… file with the expected state_store configuration data
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 88d8f75 to 8a12015 Compare November 27, 2025 18:56
…quired providers, if PSS is in use.

See the code comment added in this commit. This addition does not impact an apply command as the missing provider will be detected before this code is executed. However I'm making this change so that the method is still accurate is being able to return a complete list of providers needed by the plan.
…Backend, so the planfile's Backend struct isn't flagged as empty.
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 8a12015 to c8d17ba Compare November 27, 2025 19:08
@SarahFrench SarahFrench changed the title Update how operations use backend config state in context of PSS PSS: Allow pluggable state store configuration to be stored in a plan file and used during an apply operation Nov 27, 2025
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