Daniel Schmidt
a2a8697558
add test case for variable validation
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 )
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 )
...
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 )
...
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
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
Brandon Croft
c42d0006fe
make syncdeps
2026-02-04 09:11:20 +01:00
Abdurahman Abdelgany
9a9938d950
Use an actual config with a relative path in unit test
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
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
Daniel Schmidt
958a1ae1e7
variable and output deprecation
...
Variables can be deprecated through the `deprecated` attribute. If set the variable
will emit a diagnostic if a values is passed to it. This entails both root level and
module variables.
Outputs can be deprecated through the `deprecated` attribute as well. If set wherever
the value is used a diagnostic will be emitted. Root level outputs can not be deprecated.
The only acceptable usage of a deprecated output is another deprecated output (forwarding
the deprecation to the module user).
If modules not under your control have deprecation warnings you can add a `suppress_deprecations_warnigns`
attribute to the module call in question to silence any deeply nested warnings.
2026-02-03 15:57:28 +01:00
Daniel Schmidt
13247d19e2
add deprecation singleton
...
This struct tracks and validates deprecations in the context of a
graph walk. We need a struct to keep track of the module calls that
opt-out of deprecation warnings.
2026-02-03 15:39:25 +01:00
Kristin Laemmert
7e37e518c4
actions test refactor
2026-02-03 08:22:19 -05:00
Radek Simko
41102accc6
command: Fix copy-paste error in error message ( #38116 )
2026-02-03 13:06:13 +00:00
Radek Simko
1fde2537c2
command/init: Avoid ignoring errors when setting PSS configs ( #38115 )
2026-02-03 13:05:52 +00:00
Sarah French
2465e326a2
refactor: Use existing methods to detect if a provider is built in ( #38118 )
2026-02-03 12:52:26 +00:00
Daniel Schmidt
93a38f893b
remove deprecation origin for now
...
we will add sth like this again when we will be able display a nicer diagnostic with the origin
2026-02-03 13:32:06 +01:00