Commit graph

34990 commits

Author SHA1 Message Date
Daniel Schmidt
a2a8697558
add test case for variable validation
Some checks failed
Quick Checks / Unit Tests (push) Has been cancelled
Quick Checks / Race Tests (push) Has been cancelled
Quick Checks / End-to-end Tests (push) Has been cancelled
Quick Checks / Code Consistency Checks (push) Has been cancelled
2026-02-11 13:03:15 +01:00
Sarah French
b8c2cabee8
init: Fix when error diagnostics are acted on in PSS's experimental version of init. Avoid trying to initialise a state store with insufficient config. (#38125)
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
2026-02-11 00:08:08 +00:00
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
Austin Valle
a48e873790
PSS: Adjust StateRange.End logic in ReadStateBytes and WriteStateBytes (#38127)
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
* fix usage of StateRange.End

* add test for last chunk is single byte
2026-02-05 17:25:25 +00:00
Daniel Banck
d103825d84 Move changelog file to avoid duplicate entry
This PR moves the changelog file for the fix in #38025 into the 1.14
directory. Since it was backported we would otherwise end up with two
changelog entries. One in 1.14.x and one in 1.15.x
2026-02-05 17:21:34 +01:00
hc-github-team-tf-core
4ad174f77f Cleanup after 1.15.0-alpha20260204 release 2026-02-05 11:24:48 +01:00
Abdurahman Abdelgany
8e6d141fdf
Ensure that SourceBundleParser always receives a relative path for the Source Directory 2026-02-04 11:03:58 -05:00
Abdurahman Abdelgany
587fc8e66b
Merge branch 'main' into stacks_validate_relative_path_fix 2026-02-04 10:23:52 -05:00
Radek Simko
87ba30ef88
plan: Improve diagnostics for uninitialized state_store provider (#38075)
* plan: Improve diagnostics for uninitialized state_store provider

* turn suggestion into panic per PR feedback
2026-02-04 11:14:33 +00:00
Sarah French
0ef56b2853
PSS : Test edge cases when the selected workspace doesn't exist during init with a state_store (#38119)
* test: Clarify purpose of existing test related to workspace edge-cases during init.

* test: Add test case showing Terraform prompt users to select a new workspace if the current one doesn't exist during init (and others exist).
2026-02-04 10:59:23 +00:00
hc-github-team-tf-core
f65c52c899 Prepare before 1.15.0-alpha20260204 release 2026-02-04 09:25:25 +01:00
Daniel Schmidt
f44decc5f1 fix PR link 2026-02-04 09:11:33 +01:00
Brandon Croft
cb615c38d8 Create BUG FIXES-20260114-135324.yaml 2026-02-04 09:11:20 +01:00
Brandon Croft
c42d0006fe make syncdeps 2026-02-04 09:11:20 +01:00
Brandon Croft
0f11f38d47 bump terraform-svchost to v0.2.0 2026-02-04 09:11:20 +01:00
Abdurahman Abdelgany
9a9938d950 Use an actual config with a relative path in unit test
Some checks failed
Quick Checks / Unit Tests (push) Has been cancelled
Quick Checks / Race Tests (push) Has been cancelled
Quick Checks / End-to-end Tests (push) Has been cancelled
Quick Checks / Code Consistency Checks (push) Has been cancelled
2026-02-03 15:27:38 -05:00
Daniel Schmidt
ba5c4ac5e3 add comment about locals using shallow validation
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
2026-02-03 17:00:05 +01:00
Daniel Schmidt
84eeb0a113 improve wording of comments 2026-02-03 17:00:05 +01:00
Daniel Schmidt
edfe22d479 match naming scheme 2026-02-03 17:00:05 +01:00
Daniel Schmidt
ae5bfbad10 fix apply time assertions for no-op resources 2026-02-03 17:00:05 +01:00
Daniel Schmidt
ce400c93df GetDeprecationMarks should return other value marks in value 2026-02-03 17:00:05 +01:00
Daniel Schmidt
9d359b02c4 add missing InConfigBody 2026-02-03 17:00:05 +01:00
Daniel Schmidt
69adc6a4c7 remove dead code 2026-02-03 17:00:05 +01:00
Daniel Schmidt
9cf9235582 track down precise deprecation locations in complex output values 2026-02-03 17:00:05 +01:00
Daniel Schmidt
9a1e117ea9 pull range finding for expressions into separate method 2026-02-03 17:00:05 +01:00
Daniel Schmidt
425263040f only unmark deep when necessary 2026-02-03 17:00:05 +01:00
Daniel Schmidt
5ed7d5134e refactor deprecation diag creation 2026-02-03 17:00:05 +01:00
Daniel Schmidt
3fd7a5052f limit the amount of additional remove deprecation mark calls 2026-02-03 17:00:05 +01:00
Daniel Schmidt
11e49b983a only unmark deep once for Validate 2026-02-03 17:00:05 +01:00
Daniel Schmidt
c7bc22ed79 only unmark deep once for ValidateDeep 2026-02-03 17:00:05 +01:00
Daniel Schmidt
76747e174c use format.CtyPath for formatting go-cty paths 2026-02-03 16:47:54 +01:00
Daniel Schmidt
7b28c88e66 improve wording of deprecation marks 2026-02-03 16:47:54 +01:00
Daniel Schmidt
3bafac0d56 we can't savely detect deprecations within provisioners during plan 2026-02-03 16:47:54 +01:00
Daniel Schmidt
7eaf6daf60 add deprecation marks to resources based on schema 2026-02-03 16:47:54 +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
Daniel Schmidt
379fa79c3e ElaborateFromConfigBody handles deeply nested paths more precisely 2026-02-03 16:04:43 +01:00
Daniel Schmidt
5723a7a26b refactor into switch statement 2026-02-03 16:04:43 +01:00
Daniel Schmidt
b09ef138fc use validate for primitive types 2026-02-03 16:04:43 +01:00
Daniel Schmidt
e6d969a2eb we only want to send diagnostics for deeply nested deprecations in certain locations
Mainly terminal locations for the value where they are used, such as the config of a resource, for_each, outputs.
We don't want to evaluate the deprecation deeply when it comes to values where the value is not yet used, e.g. locals
This is because if e.g. a deeply nested value is deprecated it should still be ok for the entire object to be in a local
whereas the same object should give a warning in e.g. an output
2026-02-03 16:04:43 +01:00
Daniel Schmidt
2f392d904e deprecation.Validate should only check top-level marks 2026-02-03 16:04:43 +01:00
Daniel Schmidt
75445e1ef8 use a string as deprecation origin to help with indirect references
We want to be able to give better information if e.g. the entire module is stored in a local and the deprecated value is only later used.

Where the diag is emitted we might only see the local and not the true origin of the deprecation

A string identifying the source of the deprecation should help
2026-02-03 16:04:43 +01:00
Daniel Schmidt
c9cc64a260 move stray check for deprecation to central location 2026-02-03 16:04:43 +01:00
Daniel Schmidt
844bcd8e2c contextualFromConfigBody should also apply for overridden diagnostics 2026-02-03 16:04:43 +01:00
Daniel Schmidt
a96df66a9a display origin of deprecated value in diagnostic 2026-02-03 16:04:43 +01:00
Daniel Schmidt
3a36e7732b refactor: extract write snippet in diagnostic rendering 2026-02-03 16:04:43 +01:00
Daniel Schmidt
ea7f1e3043 add extra origin information for deprecation diagnostics 2026-02-03 16:04:43 +01:00
Daniel Schmidt
c02223e94c use value without deprecations after validating 2026-02-03 15:57:28 +01:00
Daniel Schmidt
5ee1bece21 detect deprecation marks in more places 2026-02-03 15:57:28 +01:00
Daniel Schmidt
0a9bfcc8d0 move test case to more appropriate PR
https://github.com/hashicorp/terraform/pull/38006 is dealing with resource deprecation
2026-02-03 15:57:28 +01:00
Daniel Schmidt
5b40f274b2 use EvalContext.Path to get module path for deprecation surpression
I decided against it before since a lot of tests were panicing, but after consulting with peers I found out the tests were just minimally set up and before it was just fine without the current scope being set. Now we require it to be set as it would in a normal execution therefore I had to add a bit of setup to the tests
2026-02-03 15:57:28 +01:00