Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Jun 17, 2025

Context

The process of how data gets into a planfile created by a plan command is a little convoluted, so here is a diagram attempting to explain how it works. Note that the diagram explains how it works after the changes of this PR, so describes parallel backend- and state store-related fields in places, but broadly the sequence of events is unchanged.

How a planfile gets backend:state_store configuration saved into it

This PR

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.
  • Allows users to save state store config to a planfile during plan and use that in an apply command:
    • Allow data to enter the plan file during plan: d90b7a0
      • The Meta now has a field stateStoreConfigState
      • When Operations are assembled they can set a new PlanOutStateStore field with a description of the state store's config.
      • That new PlanOutStateStore field can be used when writing the plan file
    • Implements initialising a state store from a planfile: 944d3a0

These new features are tested via new integration tests in:

  • internal/backend/local/backend_plan_test.go
  • internal/command/apply_test.go
  • internal/command/plan_test.go

And a new E2E test covering the full init-plan-apply workflow in internal/command/e2etest/primary_test.go

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

This comment was marked as outdated.

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

This comment was marked as outdated.

@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

This comment was marked as outdated.

@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

This comment was marked as outdated.

@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

This comment was marked as outdated.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 3 times, most recently from 88c80eb to ef2b038 Compare November 26, 2025 18:17
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 2 times, most recently 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
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 2 times, most recently from 362ffa5 to 94d4233 Compare November 28, 2025 12:17
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch 2 times, most recently from 9a018e9 to d16ebe6 Compare November 28, 2025 12:47
Base automatically changed from pss/plan-struct-backend-via-pointer to main November 28, 2025 16:12
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.
…ng it to prepare a Local backend that uses the state store
…ly isn't valid for `stateStoreConfigState` to be nil

I'm about 90% sure that backendConfigState being nil is ok <_<
… file with the expected state_store configuration data
…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.
…or state store config when getting a backend from a planfile
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from d16ebe6 to f795158 Compare November 28, 2025 16:16
@SarahFrench SarahFrench marked this pull request as ready for review November 28, 2025 17:38
@SarahFrench SarahFrench requested a review from a team as a code owner November 28, 2025 17:38
@SarahFrench
Copy link
Member Author

SarahFrench commented Nov 28, 2025

Opening for review, as I don't think there are any easy ways to break this PR off into smaller PRs any more. I hope that the diagram in the PR description helps to make review more approachable, but I'm happy to do a synchronous discussion via Teams too.

After some time away from this, I think an obvious split is plan/apply, duh! I'll open a PR that has just the writing data into a plan, and then the stacked PR will be reading from the plan, and E2E tests.

@SarahFrench SarahFrench marked this pull request as draft December 2, 2025 12:51
@SarahFrench
Copy link
Member Author

PR split into:
#37956
#37957

@SarahFrench SarahFrench closed this Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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