Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Sep 24, 2025

This PR pulls out reusable logic that allows calling code to obtain the necessary provider factory for launching a provider for state storage into method getStateStoreProviderFactory.

To facilitate this, we also need to allow Terraform to be able to obtain provider factories from in memory locks.
Currently the only method for obtaining factories (providerFactories) reads in locks from the dependency lock file. This isn't sufficient in the context of PSS; new code needs to obtain a factory during a time when locks are in a pending state , i.e up-to-date locks are in memory and any existing dependency lock file is outdated and hasn't yet been updated. To unblock this we've added the new ProviderFactoriesFromLocks method that accepts in memory locks as an argument. This is parallel to the previous method, which has been renamed providerFactories => ProviderFactories.

Other changes in this PR:

  • Allowing locks to be passed through initBackend to the point where getStateStoreProviderFactory is used.
  • Changes to the 'simple' providers to help identify what provider is in use for a child process. A schema-related test needed to be updated after this.

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 Sep 24, 2025
Comment on lines +78 to +81
expectedProviderDescription := "This is terraform-provider-simple v6"
if s.Provider.Body.Description != expectedProviderDescription {
t.Fatalf("expected description to be %q, but got %q", expectedProviderDescription, s.Provider.Body.Description)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the reason for adding descriptions to the simple providers' schemas

@SarahFrench SarahFrench marked this pull request as ready for review September 24, 2025 12:14
@SarahFrench SarahFrench requested a review from a team as a code owner September 24, 2025 12:14
radeksimko
radeksimko previously approved these changes Sep 24, 2025
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM, you may ignore that minor nitpick about comment if you like 😄

Co-authored-by: Radek Simko <[email protected]>
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM, the test failure appears to be network related

@SarahFrench SarahFrench enabled auto-merge (squash) September 24, 2025 15:15
@SarahFrench
Copy link
Member Author

I'll re-run the tests :shipit:

@SarahFrench SarahFrench merged commit b952256 into main Sep 24, 2025
10 of 11 checks passed
@SarahFrench SarahFrench deleted the pss/allow-factories-from-inmem-locks branch September 24, 2025 15:21
@github-actions
Copy link
Contributor

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 Oct 25, 2025
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.

3 participants