Commit graph

649 commits

Author SHA1 Message Date
Radek Simko
27770ee805
PSS: Migration from a backend to a state store (#38048)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* backend/inmem: Make it easier to use the backend in tests

* cloud: Make the cloud backend testable

* command/views: Introduce migration UI messages

* command/init: Add 3 tests for migrations from a backend to PSS

 - TestInit_backend_to_stateStore_singleWorkspace
 - TestInit_backend_to_stateStore_multipleWorkspaces
 - TestInit_cloud_to_stateStore

* command/init: Implement migration from a backend to PSS

* address PR feedback

* remove local state after migration
2026-02-10 11:39:33 +00:00
Brandon Croft
c42d0006fe make syncdeps 2026-02-04 09:11:20 +01:00
Sarah French
02a4ddce1b
fix: Fail an apply command if the plan file was generated for a workspace that isn't the selected workspace (#37955)
* fix: Fail apply command if the plan file was generated for a workspace that isn't the selected workspace.

* Add change file

* test: Update test helper to include Workspace name in plan representation

* fix: Make error message more generic, so is applicable to backend and cloud blocks.

* fix: Make error message specific to backend or cloud block

* test: Add separate tests for backend/cloud usage

* test: Update remaining tests to include a value for Workspace in mocked plans

* Apply suggestions from code review

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>

* fix: Panic when a plan file has missing workspace data

* test: Update test to match changes in error text

---------

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2026-02-03 15:29:58 +00:00
Jared Baker
35e81db902
Merge pull request #38047 from hashicorp/s3/aws-sdk-go-base-upgrade
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
backend/s3: bump `github.com/hashicorp/aws-sdk-go-base/v2`
2026-01-20 11:00:44 -05:00
Radek Simko
1186262c8c
backend/http: Refresh state earlier (align with other backends) (#38033)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* correct changelog entry for #38027

* backend/http: Refresh state before returning StateMgr

This aligns the http backend with the implementation of StateMgr in other remote backends, which in turn enables easier testing of higher level logic that relies on certain backend behaviours.

* backend/http: Refactor TestHTTPBackend to allow custom method implementations

* add regression test for PR 38027
2026-01-14 15:13:58 +00:00
Jared Baker
6475423325
backend/s3: bump github.com/hashicorp/aws-sdk-go-base/v2
Incrementing the `aws-sdk-go-base` dependecy will also pull in the latest version of the AWS SDK for Go V2, which includes support for the newly launched `aws login` authentication method.
2026-01-08 10:59:37 -05:00
Jared Baker
4f53303c12
Merge branch 'main' into fix/s3-backend-fips-env-var-parsing 2026-01-07 15:50:34 -05:00
Radek Simko
213d133d86
command/meta: Enable migration from PSS to a backend (#37949)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* command/meta: Enable migration from PSS to a backend

* Address PR feedback

* Update internal/command/meta_backend.go

Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>

* meta_backend: Rename stateStore_c_S to stateStore_to_backend

---------

Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
2025-12-15 10:29:34 +00:00
Sarah French
f591872699
PSS: Allow pluggable state store configuration to be stored in a plan file (#37956)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* refactor: Rename Meta's backendState field to backendConfigState

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.

* fix: Only set backendConfigState to synthetic object if it's nil due to a lack of data. Don't change it if pluggable state storage is in use.

* feat: Enable recording a state store's details in an Operation, and using that data when creating a plan file.

* fix: Include provider config when writing a plan file using pluggable state storage

* fix: Having `backendConfigState` be nil may be valid, but it definitely isn't valid for `stateStoreConfigState` to be nil

When backendConfigState is nil it means that an implied local backend is in use, i.e. there is no backend block in the config.

* test: Add integration test showing that a plan command creates a plan file with the expected state_store configuration data

* refactor: Apply suggestion from @radeksimko

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>

* fix: Allow panics to occur if an unexpected implementation of `backend.Backend` is encountered when managing a state store

* docs: Add code comment explaining the current situation with passing backend config state to downstream logic.

In future this should be simplified, either via refactoring or changes affecting the implied local backend

---------

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2025-12-11 11:41:36 +00:00
James Pogran
2c075b9f8e
Add component registry source resolution support to Terraform Stacks (#37888)
* Add component registry source resolution support to Terraform Stacks

This change implements the missing component source resolution case in the stack configuration loader, enabling Terraform Stacks to properly handle component registry sources from HCP Terraform and other component registries.

The implementation mirrors the existing module registry resolution workflow, where component sources are first resolved to their versioned form using the source bundle's component metadata, then converted to final source addresses that can be used to locate the actual component code. This completes the integration between the terraform-registry-address component parsing capabilities and the go-slug sourcebundle component resolution APIs.

* chore: bump go-slug to v0.18.1

* fix: add case for component final source type

* chore: rm space

* chore: sync module deps

* chore: update testdata with separate bundle

* fix: manifest file json obj with trailing comma

* Add changelog entry to 1.14

---------

Co-authored-by: Michael Yocca <michael.yocca@hashicorp.com>
2025-12-10 09:16:03 -05:00
Sarah French
9fb91c2229
PSS: Refactor Plan struct to reference Backend and StateStore via pointers, update calling code (#37946)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* refactor: Update Plan struct's Backend field to be a pointer

* fix: Add some refactorings or protections against nil pointers when accessing the Backend field on a Plan struct

* refactor: Update Plan struct's StateStore field to be a pointer, update a nil check in calling code.
2025-11-28 16:12:46 +00:00
Sarah French
64015ca6d2
refactor: let panic arise directly if the provider doesn't implement providers.StateStoreChunkSizeSetter (#37942) 2025-11-28 13:48:32 +00:00
Sarah French
cf047be4e4
PSS: Use interfaces to configure state stores (#37899)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* refactor: Move chunk size limit constants to new `chunks` package

* refactor: Make `NewPluggable` return a `Pluggable` concrete type, instead of an instance of the `backend.Backend` interface.

* refactor: Configure state stores through the backend.Backend interface, instead of directly using methods related to RPCs. This requires changing where we call `SetStateStoreChunkSize`.

* docs: Add godocs comment to `StateStoreChunkSizeSetter` interface

To summarize, we don't really need the `SetStateStoreChunkSize` method, and instead methods like `(*GRPCProvider).ConfigureStateStore` in the `plugin6` package can directly inspect the negotiation process that passes through that code and pull out the chunk size. However that means that that code would also need to implement validation. And that's just `(*GRPCProvider).ConfigureStateStore`; what about all the test mocks that are used in different types of test? They would all need to be implemented similarly to GRPCProvider to be good, useful mocks, and then a lot of things that fulfil the provider.Interface interface are coupled to each other. Instead, it's easier to have validation in the `grpcClient` struct's methods in the `remote` package, as that code is common to all scenarios. That code needs a method to 'reach into'  the provider.Interface value, so we use the `SetStateStoreChunkSize` method.

* chore: Make it clearer that the v6 GRPCProvider implements `SetStateStoreChunkSize`

* fix: Remove unnecessary assignment of chunk size

I'm surprised that removing this doesn't break E2E tests of PSS that use grpcwrap, but I think there's `plugin6` code that runs in that situation, so maybe chunking is handled elsewhere.

* chore: Add panic to try detect unexpected cases when setting chunk size.

* feat: Add `providers.StateStoreChunkSizeSetter` implementation to provider-simple-v6

* docs: Update code comments for NewPluggable describing its intended use
2025-11-26 13:34:22 +00:00
Kevin Vu
b62d97ac88 fix: parse boolean env vars in S3 backend correctly
Fixes #37601
2025-11-25 13:45:13 -08:00
dependabot[bot]
7034a193d9
build(deps): bump golang.org/x/crypto from 0.44.0 to 0.45.0 (#37925)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* build(deps): bump golang.org/x/crypto from 0.44.0 to 0.45.0

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.44.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* run syncdeps

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Banck <daniel@dbanck.de>
2025-11-21 10:54:50 +00:00
Sarah French
1dd8e60f15
chore: Bump golang.org/x/crypto dependency, ignore SA4003 linting errors globally (#37901)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* chore: Upgrade golang.org/x/crypto - `go get golang.org/x/crypto@v0.44.0`

* chore: Upgrade golang.org/x/crypto in submodules - `make syncdeps`

* chore: Run `make generate`

* chore: Ignore SA4003 linter error globally, as `golang.org/x/tools/cmd/stringer` generates code that breaks this rule when it's used with custom types that have unsigned integers or bytes as the underlying type.
2025-11-17 15:01:28 +00:00
Sarah French
f2818db795
PSS : Add fs and inmem state storage implementations to the builtin simplev6 provider, update grpcwrap package, use PSS implementation in E2E test (#37790)
Some checks are pending
build / Build for windows_amd64 (push) Blocked by required conditions
build / Build for freebsd_arm (push) Blocked by required conditions
build / Build for linux_arm (push) Blocked by required conditions
build / Build for darwin_arm64 (push) Blocked by required conditions
build / Build for linux_arm64 (push) Blocked by required conditions
build / Build for windows_arm64 (push) Blocked by required conditions
build / Build Docker image for linux_386 (push) Blocked by required conditions
build / Build Docker image for linux_amd64 (push) Blocked by required conditions
build / Build Docker image for linux_arm (push) Blocked by required conditions
build / Build Docker image for linux_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_386 (push) Blocked by required conditions
build / Build e2etest for windows_386 (push) Blocked by required conditions
build / Build e2etest for darwin_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_amd64 (push) Blocked by required conditions
build / Build e2etest for windows_amd64 (push) Blocked by required conditions
build / Build e2etest for linux_arm (push) Blocked by required conditions
build / Build e2etest for darwin_arm64 (push) Blocked by required conditions
build / Build e2etest for linux_arm64 (push) Blocked by required conditions
build / Run e2e test for linux_386 (push) Blocked by required conditions
build / Run e2e test for windows_386 (push) Blocked by required conditions
build / Run e2e test for darwin_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_amd64 (push) Blocked by required conditions
build / Run e2e test for windows_amd64 (push) Blocked by required conditions
build / Run e2e test for linux_arm (push) Blocked by required conditions
build / Run e2e test for linux_arm64 (push) Blocked by required conditions
build / Run terraform-exec test for linux amd64 (push) Blocked by required conditions
Quick Checks / Unit Tests (push) Waiting to run
Quick Checks / Race Tests (push) Waiting to run
Quick Checks / End-to-end Tests (push) Waiting to run
Quick Checks / Code Consistency Checks (push) Waiting to run
* feat: Implement `inmem` state store in provider-simple-v6
* feat: Add filesystem state store `fs` in provider-simple-v6, no locking implemented
* refactor: Move PSS chunking-related constants into the `pluggable` package, so they can be reused.
* feat: Implement PSS-related methods in grpcwrap package
* test: Add E2E test checking an init and apply (no plan) workflow is usable with both PSS implementations
* fix: Ensure state stores are configured with a suggested chunk size from Core

---------

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2025-11-11 15:30:50 +00:00
Sarah French
f4d0ec5136
PSS: Fix hashing without provider version (#37852)
* Fix panic hashing backend config when a builtin or reattached provider is used for PSS

* Add test showing a nil *version.Version is tolerated by the Hash method, refactor existing test

* Protect against provider version data missing when using an un-reattached, un-builtin provider. Add test coverage.

* Make reporting errors from reattach.IsProviderReattached more consistent

* Run `make syncdeps`

* Update tests to show when nil provider data is tolerated
2025-11-05 11:20:36 +00:00
Radek Simko
cbda324977
backend/oss: Bump github.com/aliyun/aliyun-oss-go-sdk to v2.1.1 (#37442)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
2025-10-15 08:49:00 -04:00
Sarah French
6b73f710f8
PSS: Implement initialisation of new working directory (or use of -reconfigure flag) while using state_store (#37732)
* Minor fixes in diagnostics

This can only be done once modules have been parsed and the required providers data is available. There are multiple places where config is parsed, into either Config or Module structs, so this needs to be implemented in multiple places.

* Rename test to make it specific to use of backend block in config

* Update initBackend to accept whole initArgs collection

* Only process --backend-config data, when setting up a `backend`, if that data isn't empty

* Simplify how mock provider factories are made in tests

* Update mock provider's default logic to track and manage existing workspaces

* Add `ProviderSchema` method to `Pluggable` structs. This allows calling code to access the provider schema when using provider configuration data.

* Add function for converting a providerreqs.Version to a hashicorp/go-version Version.

This is needed for using locks when creating the backend state file.

* Implement initial version of init new working directories using `stateStore_C_s`. Default to creating the default workspace if no workspaces exist.

* Update test fixtures to match the hashicorp/test mock provider used in PSS tests

* Allow tests to obtain locks that include `testingOverrides` providers.

The `testingOverrides` field will only be set in tests, so this should not impact end users.

* Add tests showing TF can initialize a working directory for the first time (and do the same when forced by -reconfigure flag). Remove replaced tests.

* Add -create-default-workspace flag, to be used to disable creating the default workspace by default when -input=false (i.e for use in CI). Refactor creation of default workspace logic. Add tests.

* Allow reattached providers to be used during init for PSS

* Rename variable to `backendHash` so relation to `backend` is clearer

* Allow `(m *Meta) Backend` to return warning diagnostics

* Protect against nil testingOverrides in providerFactoriesFromLocks

* Add test case seeing what happens if default workspace selected, doesn't exist, but other workspaces do exist.

The consequences here are due to using `selectWorkspace` in `stateStore_C_s`, matching what's done in `backend_C_r_s`.

* Address code consistency check failure on PR

* Refactor use of mock in test that's experiencing EOF error...

* Remove test that requires test to supply input for user prompt

This test passes when run in isolation but fails when run alongside other tests, even when skipping all other tests using `testStdinPipe`. I don't think the value of this test is great enough to start changing how we test stdin input.

* Allow -create-default-workspace to be used regardless of whether input is enabled or disabled

* Add TF_SKIP_CREATE_DEFAULT_WORKSPACE environment variable

* Responses to feedback, including making testStdinPipe helper log details of errors copying data to stdin.

Note: We cannot call t.Fatal from a non-test goroutine.

* Use Errorf instead

* Allow backend state files to not include version data when a builtin or reattached provider is in use.

* Add clarifying comment about re-attached providers when finding the matching entry in required_providers

* Report that the default workspace was created to the view

* Refactor: use error comparison via `errors.Is` to identify when no workspaces exist.

* Move handling of TF_ENABLE_PLUGGABLE_STATE_STORAGE into init's ParseInit func.

* Validate that PSS-related flags can only be used when experiments are enabled, enforce coupling of PSS-related flags when in use.

* Slight rewording of output message about default workspace

* Update test to assert new output about default workspace
2025-10-15 10:44:21 +01:00
Dirk Avery
edb3f6487d Bump go-getter v1.8.2 2025-10-09 18:15:58 -04:00
Liam Cervante
6b17cfe2e5
actions: connect invoke flag with TFC (#37544)
* actions: connect invoke flag with TFC

* use latest go-tfe
2025-10-08 19:29:32 +02:00
Dirk Avery
c5cdbf00c6 sync deps 2025-10-02 17:13:42 -04:00
Dirk Avery
5e3a9fbdf3 Bump aws-sdk-go-base 2025-10-02 15:16:29 -04:00
Samsondeen
ab41592fb7
query: propagate graph node removal to descendants (#37664) 2025-09-25 13:50:34 +02:00
Sarah French
6847e763de
Update calls to StateMgr method to use diagnostics more conventionally (#37597)
* Update call to StateMgr method to use diagnostics more explicitly

* Update calling code in remote backend tests

* Update calling code in non-test code to handle diags conventionally.

* Fix test failure messages from using wrong variable

* Additional refactoring
2025-09-15 15:22:58 +01:00
Daniel Banck
1ac8497994
Add support for Terraform Search in the cloud backend (TF-25935) (#37479) 2025-09-15 13:21:05 +02:00
Liam Cervante
551ba2e525
Implement controlling destroy functionality within Terraform Test (#37359)
* Add ability to parse backend blocks present in a test file's run blocks, validate configuration (#36541)

* Add ability to parse backend blocks from a run block

* Add validation to avoid multiple backend blocks across run blocks that use the same internal state file. Update tests.

* Add validation to avoid multiple backend blocks within a single run block. Update tests.

* Remove use of quotes in diagnostic messages

* Add validation to avoid backend blocks being used in plan run blocks. Update tests.

* Correct local backend blocks in new test fixtures

* Add test to show that different test files can use same backend block for same state key.

* Add validation to enforce state-storage backend types are used

* Remove TODO comment

We only need to consider one file at a time when checking if a state_key already has a backend associated with it; parallelism in `terraform test` is scoped down to individual files.

* Add validation to assert that the backend block must be in the first apply command for an internal state

* Consolidate backend block validation inside a single if statement

* Add initial version of validation that ensures a backend isn't re-used within a file

* Explicitly set the state_key at the point of parsing the config

TODO: What should be done with method (moduletest.Run).GetStateKey?

* Update test fixture now that reusing backend configs has been made invalid

* Add automated test showing validation of reused configuration blocks

* Skip test due to flakiness, minor change to test config naming

* Update test so it tolerates non-deterministic order run blocks are evaluated in

* Remove unnecessary value assignment to r.StateKey

* Replace use of GetStateKey() with accessing the state key that's now set during test config parsing

* Fix bug so that run blocks using child modules get the correct state key set at parsing time

* Update acceptance test to also cover scenario where root and child module state keys are in use

* Update test name

* Add newline to regex

* Ensure consistent place where repeat backend error is raised from

* Write leftover test state(s) to file (#36614)

* Add additional validation that the backend used in a run is a supported type (#36648)

* Prevent test run when leftover state data is present (#36685)

* `test`: Set the initial state for a state files from a backend, allow the run that defines a backend to write state to the backend (#36646)

* Allow use of backend block to set initial state for a state key

* Note about alternative place to keep 'backend factories'

* Allow the run block defining the backend to write state to it

* Fix rebase

* Change to accessing backend init functions via ContextOpts

* Add tests demonstrating how runs containing backend blocks use and update persisted state

* Fix test fixture

* Address test failure due to trouble opening the state file

This problem doesn't happen on MacOS, so I assume is due to the Linux environment of GitHub runners.

* Fix issue with paths properly

I hope

* Fix defect in test assertion

* Pivot back to approach introduced in 4afc3d7

* Let failing tests write to persistent state, add test case covering that.

I split the acceptance tests into happy/unhappy paths for this, which required some of the helper functions' declarations to be raised up to package-level.

* Change how we update internal state files, so that information about the associated backend is never lost

* Fix UpdateStateFile

* Ensure that the states map set by TestStateTransformer associates a backend with the correct run.

* Misc spelling fixes in comments and a log

* Replace state get/set functions with existing helpers (#36747)

* Replace state get/set functions with existing helpers

* Compare to string representation of state

* Compare to string representation of state

* Terraform Test: Allow skipping cleanup of entire test file or individual run blocks (#36729)

* Add validation to enforce skip_cleanup=false cannot be used with backend blocks (#36857)

* Integrate use of backend blocks in tests with skip_cleanup feature (#36848)

* Fix nil pointer error, update test to not be table-driven

* Make using a backend block implicitly set skip_cleanup to true

* Stop state artefacts being created when a backend is in use and no cleanup errors have occurred

* Return diagnostics so calling code knows if cleanup experienced issues or not

* Update tests to show that when cleanup fails a state artefact is created

* Add comment about why diag not returned

* Bug fix - actually pull in the state from the state manager!

* Split and simplify (?) tests to show the backend block can create and/or reuse prior state

* Update test to use new fixtures, assert about state artefact. Fix nil pointer

* Update test fixture in use, add guardrail for flakiness of forced error during cleanup

* Refactor so resource ID set in only one place

* Add documentation for using a `backend` block during `test` (#36832)

* Add backend as a documented block in a run block

* Add documentation about backend blocks in run blocks.

* Make the relationship between backends and state keys more clear, other improvements

* More test documentation (#36838)

* Terraform Test: cleanup command (#36847)

* Allow cleanup of states that depend on prior runs outputs (#36902)

* terraform test: refactor graph edge calculation

* create fake run block nodes during cleanup operation

* tidy up TODOs

* fix tests

* remove old changes

* Update internal/moduletest/graph/node_state_cleanup.go

Co-authored-by: Samsondeen <40821565+dsa0x@users.noreply.github.com>

* Improve diagnostics around skip_cleanup conflicts (#37385)

* Improve diagnostics around skip_cleanup conflicts

* remove unused dynamic node

* terraform test: refactor manifest file for simplicity (#37412)

* test: refactor apply and plan functions so no run block is needed

* terraform test: write and load state manifest files

* Terraform Test: Allow skipping cleanup of entire test file or individual run blocks (#36729)

* terraform test: add support for skip_cleanup attr

* terraform test: add cleanup command

* terraform test: add backend blocks

* pause

* fix tests

* remove commented code

* terraform test: make controlling destroy functionality experimental (#37419)

* address comments

* Update internal/moduletest/graph/node_state_cleanup.go

Co-authored-by: Samsondeen <40821565+dsa0x@users.noreply.github.com>

---------

Co-authored-by: Samsondeen <40821565+dsa0x@users.noreply.github.com>

* add experimental changelog entries

---------

Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
Co-authored-by: Samsondeen <40821565+dsa0x@users.noreply.github.com>
Co-authored-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
2025-09-10 17:22:20 +02:00
Liam Cervante
00d680d819
apply: include sensitive metadata when comparing changed input values (#37582)
* apply: include sensitive metadata when comparing changed input values

* correct changelog entry
2025-09-10 11:11:31 +02:00
Kristin Laemmert
bbb8af989c
deps: bump xz to address bug in previous version (#37573)
* deps: bump xz, bug in previous version
2025-09-08 14:48:26 -04:00
Dirk Avery
74b0925633
Merge pull request #37567 from hashicorp/dep-bump-go-getter
bump: go-getter to 1.8.0
2025-09-08 12:25:37 -04:00
Sarah French
67eb3c9210
s3: Fix tests after changing the interface to return diagnostics (#37571)
* Fix tests after changing the interface to return diagnostics

* Fix curly brace position
2025-09-08 16:48:28 +01:00
Dirk Avery
92bf04ae16 bump: go-getter to 1.8.0 2025-09-05 17:39:55 -04:00
Sarah French
508234892c
Update remote.Client interface's methods to return diagnostics instead of primitive errors (#37502)
* Update remote package's Client interface to use diagnostics instead of errors

* Update all implementations of Client interface to match changes, update calling code (incl. tests) to use diags.
2025-09-05 11:04:47 +01:00
Sarah French
8503c45013
Update backend.Backend's StateMgr method to return diagnostics instead of primitive errors (#37496)
* Fix S3 backend test affected by making the Workspaces method return errors via diagnostics

* Address diagnostics comparison issues in test by ensuring expected diagnostics are defined in the context of the config they're triggered by

* Fix failing test case `TestBackendConfig_EC2MetadataEndpoint/envvar_invalid_mode` by making `diagnosticBase` struct comparable

* Add compile-time checks that diagnostic types fulfil interfaces

* Stop diagnosticBase implementing ComparableDiagnostic, re-add S3-specific comparer code to s3 package

* Update tests to use the S3-specific comparer again

* Fix test case missed in refactoring

* Update the backend.Backend interface to use diagnostics as return value from StateMgr method

* Fix calls to `Fatalf`
2025-09-04 11:14:35 +01:00
Amartya Majumdar
54af16eab9
[IPL-7725] Updating Calls to the Remote HCP Terraform API to Retrieve All Workspace Variables (#37241)
* [IPL-7725] Resolving merge conflicts

* [IPL-7725] Updating go.sum files

---------

Co-authored-by: Amartya Majumdar <a.majumdar1041@gmail.com>
2025-09-03 15:26:07 +02:00
zeshan
1baef44036 syncdeps: update x/net to v0.41.0 2025-09-03 11:58:12 +02:00
zeshan
da1a28783a Fix #36897: Resolve NO_PROXY recognition issue in oss remote backend 2025-09-03 11:58:12 +02:00
Liam Cervante
673717d01a
actions: render invoked actions (#37540)
* actions: add invoke graph nodes

* fix small bugs

* add additional tests

* remove whitespace

* actions: invoke rendered actions

* also fix up apply message

* make description headers consistent

* fix copyright headers

* go generate
2025-09-01 09:01:48 +00:00
Liam Cervante
8488fbb35c
Revert "actions: render invoked actions (#37522)" (#37538)
This reverts commit 0fae555389.
2025-09-01 08:51:14 +00:00
Liam Cervante
0fae555389
actions: render invoked actions (#37522)
* actions: add invoke graph nodes

* fix small bugs

* add additional tests

* remove whitespace

* actions: invoke rendered actions

* also fix up apply message

* make description headers consistent

* fix copyright headers

* go generate
2025-08-29 12:52:12 +00:00
Sarah French
1c09e58b3d
Fix diagnostic comparison issues in s3 backend tests (#37509)
* Fix S3 backend test affected by making the Workspaces method return errors via diagnostics

* Address diagnostics comparison issues in test by ensuring expected diagnostics are defined in the context of the config they're triggered by

* Fix failing test case `TestBackendConfig_EC2MetadataEndpoint/envvar_invalid_mode` by making `diagnosticBase` struct comparable

* Add compile-time checks that diagnostic types fulfil interfaces

* Stop diagnosticBase implementing ComparableDiagnostic, re-add S3-specific comparer code to s3 package

* Update tests to use the S3-specific comparer again

* Fix test case missed in refactoring
2025-08-28 14:33:50 +01:00
Liam Cervante
e854d8364d
actions: add invoke flag for plan and apply commands (#37512)
* actions: make action address targetable

* add missing functions

* copyright headers

* actions: add invoke flag for plan and apply commands
2025-08-28 12:11:52 +00:00
Sarah French
865a0eb12e
Fix S3 backend test affected by making the Workspaces method return errors via diagnostics (#37508) 2025-08-27 20:19:31 +01:00
Ricard Bejarano
4ac49bad2b
terraform test: fix regression when running with no tests (#37475) (#37477)
* terraform test: fix regression when running with no tests (#37475)

* added changelog entry

* move changelog entry from v1.14 to v1.13

* Return moduletest.Error instead of suite.Status if test operation is cancelled

* Add "terraform test" test with no tests

Yes, that's right. It's OK if you need to read it again.
2025-08-26 08:37:14 +02:00
Deniz Onur Duzgun
05dfb52c2d
bump: go-getter to v1.7.9 (#37452)
* bump: go-getter to v1.7.9

* run sync deps

---------

Co-authored-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
2025-08-19 14:42:36 -04:00
Sarah French
62b3ba590a
Update backend.Backend interface to return diagnostics from Workspaces and DeleteWorkspace methods (#37430)
* Update Backend interface to use diagnostics for `DeleteWorkspace` and `Workspaces` methods

* Update testing helpers in backend package

* Update pluggable package to match interface changes

* Update builtin terraform provider package to match interface changes

* Update code in Meta-related files in command package; update error check logic

* Update workspace commands; update error check logic

* Update Local backend package to match interface changes

* Update Cloud backend to match interface changes

* Update Remote backend to match interface changes

* Update cos remote-state backend to match interface changes

* Update inmem remote-state backend to match interface changes

* Update pg remote-state backend to match interface changes

* Update http remote-state backend to match interface changes

* Update consul remote-state backend to match interface changes

* Update oss remote-state backend to match interface changes

* Update kubernetes remote-state backend to match interface changes

* Update gcs remote-state backend to match interface changes

* Update s3 remote-state backend to match interface changes

* Update oci remote-state backend to match interface changes

* Update azure remote-state backend to match interface changes

* Allow warnings from Workspaces and DeleteWorkspace methods to be logged or returned to calling code

* Fix defect in inmem backend test

* Change how warnings from workspace-related methods are output to view/ui
2025-08-18 19:03:31 +01:00
Samsondeen
9f01530237
go: bump version to 1.25 (#37436) 2025-08-18 12:17:59 +02:00
Sarah French
e5a5e21801
Add backend testing documentation (#37448)
* Add testing guidance for `gcs`

* Add testing guidance for `pg`

* Add testing guidance for `kubernetes`

* Add details about accessing GCP resources

* Update README.md
2025-08-18 11:17:03 +01:00
James Bardin
54f1f14726 make syncdeps 2025-08-12 14:05:10 -04:00