Commit graph

88 commits

Author SHA1 Message Date
Mutahhir Hayat
9b056eb286 Run go fmt 2026-03-06 15:54:23 +01:00
Mutahhir Hayat
ffeff0914d Support for deferred action invocations in plan
We encovered that deferred action invocations don't get provider
addresses, which prevents us from loading the schema. That being said, I
think it shouldn't be an issue, but will come back to revisit this as we
build the support end to end.

Add a test for deferred actions support
2026-03-06 15:54:23 +01:00
Mutahhir Hayat
5b2f19abad Add failing test for deferred actions 2026-03-06 15:54:23 +01:00
Mutahhir Hayat
876b671470 Refactor action trigger event conversion 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
fb0cc11e48 Update to use new protobuf renames 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
49feb6e86f Update naming to ResourceActionTrigger 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
ab6119fd90 Revert fix and instead update test expectation 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
8f137435b7 Run formatter 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
cb3dfa615f Add integration test for stacks action invocation via lifecycle trigger 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
946918220c Read Action invocations from planfile 2026-03-06 14:00:31 +01:00
Mutahhir Hayat
eeb0f7218e Include action invocations when reading from tfplan 2026-03-06 14:00:31 +01:00
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
Daniel Schmidt
d813ad14f7 add deprecation marks 2026-02-03 13:32:06 +01:00
Liam Cervante
b6be635748
stacks migrate: allow resource mapping to include nested resources (#37060)
* stacks migrate: allow resource mapping to include nested resources

* make protobuf
2025-05-16 10:10:47 +02:00
James Bardin
807e084130 final renaming for function results 2025-05-08 11:42:05 -04:00
James Bardin
a6ec17cb77 rename function results table
Remove "provider" from the function results fields since it's not going
to be exclusively used for providers any longer.
2025-05-07 16:03:43 -04:00
James Bardin
d016070564 move function results hashing to lang
We need to abstract the function results verification to use internally
too, so start by moving it out of the providers code.
2025-05-07 13:02:46 -04:00
Liam Cervante
4eaa9d7fa0
stacks: removing embedded stacks should ignore stacks not in state (#36901) 2025-04-24 08:56:11 +02:00
Liam Cervante
063757ff45
stacks: refactor plan, state, and removed tracking with tree structures for efficient lookups (#36850) 2025-04-16 14:05:51 +02:00
Liam Cervante
a06f82746a
stacks: update removed blocks to allow targeting of embedded stacks (#36814)
* stacks: update removed blocks to allow targeting of embedded stacks

* copywrite headers
2025-04-04 15:01:37 +02:00
Liam Cervante
2b5101f734
stacks: include existing components when deferring nested stacks (#36788)
* stacks: include existing components when deferring nested stacks

* improve comments
2025-04-03 10:40:28 +02:00
Daniel Banck
b2b42c0fb4
Store resource identities in state (TF-23255) (#36464)
* Persist resource identity in Terraform state

* make syncdeps

* Move identity schema merging closer to the protocol

* mock GetResourceIdentitySchemas

* Fix identity refresh tests

* Add more tests

* Change grcpwrap upgrade identity

* Review feedback

* Remove unnecessary version conversion

* Check if GetResourceIdentitySchemas RPC call is implemented

* Update function signature docs

* Adapt protocol changes

* Check unimplemented error for identities in GetSchema
2025-03-11 20:58:44 +01:00
Liam Cervante
a384d2daa7
stacks: fix deferred data sources and unknown component applies (#35876) 2024-10-22 11:23:53 +02:00
Liam Cervante
bfa320c7b0
stacks: represent ephemeral inputs and outputs as null (#35824)
* stacks: represent ephemeral inputs and outputs as null

* quick fix: remove unnecessary check
2024-10-08 16:46:31 +02:00
James Bardin
384f2d4fab update collections to use for-range method 2024-10-04 11:22:44 -04:00
Liam Cervante
d93e18d155
stacks: separate refresh and destroy stages during destroy plans (#35744)
* add tests that highlight known issues in the destroy mechanism

* separate refresh during destroy plans

* use the refresh outputs during destroy plans

* copywrite headers
2024-09-19 11:36:41 +02:00
Liam Cervante
b38fd17cf9
stacks: emit removal notices for empty components (#35738)
* stacks: emit removal notices for empty components

* fix tests and checks
2024-09-18 10:41:36 +02:00
Liam Cervante
e78294d42b
stacks: stop encoding values into msgpack twice (#35734) 2024-09-18 10:18:01 +02:00
Liam Cervante
598648b66f
stacks: handle input and output state during delete plans (#35726) 2024-09-16 12:00:48 +02:00
Liam Cervante
d142486a40
stacks: expand plan and apply outputs for inputs (#35724) 2024-09-16 11:45:19 +02:00
Liam Cervante
73e3f8096b
stacks: complete stack output implementation for plan and apply (#35723) 2024-09-16 11:36:36 +02:00
Liam Cervante
6b2cc9c379
stacks: include existing instances for unknown removed and component blocks (#35691) 2024-09-10 08:59:04 +02:00
Liam Cervante
b6ac98122b
stacks: refactor shared functionality in prep for removed blocks (#35670) 2024-09-05 13:15:53 +02:00
Liam Cervante
50233d7a78
stacks: support sensitive input values in planned changes (#35640)
* stacks: support sensitive input values in planned changes

* stacks: Fix panic when applying sensitive inputs

The stacks-specific check that a given plan's input variable values
remain unchanged at apply time would previously panic when given a
marked value. Marks are not important for this check, so we simply
remove them to ensure that it passes. This seems in line with how
AssertObjectCompatible works, which I'm taking as precedent.

The new test added in this commit panics without the corresponding code
change.

---------

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2024-08-27 16:13:59 +02:00
James Bardin
2ffbd0eb4e remove old refactoring comments 2024-08-22 09:39:37 -04:00
James Bardin
bc750192e4 POC for always using decoded changes in core
We should not need to encode and decode change values within core, since
the encoded version is only technically needed for serialization. This
pattern stems from the conversion to current changes system, but back
then we did not have easy access to the correct schemas at the time to
encode and decode the entire set of changes.

Moving the core handling of changes to only use the decoded values will
drastically improve evaluation efficiency, removing a round trip
through encoded values for every resource reference.
2024-08-22 09:39:37 -04:00
Liam Cervante
f1ae07b1af
stacks: add support for provider functions in .tfstack.hcl files (#35610)
* stacks: fix bug preventing cross-provider move refactorings

* also make provider functions work

* stacks: add support for provider functions in .tfstack.hcl files
2024-08-22 09:28:39 +02:00
Liam Cervante
915b174da3
stacks: split the terraform1 RPC package into per-service packages (#35513)
* stacks: split the terraform1 RPC package into per-service packages

* pull latest changes
2024-08-07 17:33:51 +02:00
Liam Cervante
471bddf3ba
json plan: update resource index and import ids to support unknown values (#35518) 2024-08-07 08:28:03 +02:00
Daniel Schmidt
429ccbb88e
Merge pull request #35512 from hashicorp/TF-18555
stacks: add fields required to display plan
2024-07-30 12:22:39 +02:00
Daniel Schmidt
4faf0f25dd
guard against nil resource key 2024-07-30 12:00:24 +02:00
Daniel Schmidt
c693c39677
use resource_name instead of name
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2024-07-30 12:00:23 +02:00
Liam Cervante
0c67edd598
stacks: ensure input values for components don't change between plan and apply (#35489)
* stacks: ensure input values for components don't change between plan and apply

* skip ephemeral values
2024-07-30 08:39:36 +02:00
Daniel Schmidt
df85a22343
stacks: add fields required to display plan 2024-07-30 08:39:08 +02:00
Liam Cervante
87bbc47737
stacks: include plan mode in stacks plan format (#35405)
* stacks: include plan mode in stacks plan format

* fix tests

* fix missed files
2024-07-23 17:45:07 +02:00
Martin Atkins
ec2510fc3d stacks: Track raw stack as separate messages in raw plan
Previously we had the entire raw prior state serialized as part of the
"plan header" message in the raw plan, which meant that the maximum state
size was constrained by the maximum allowed gRPC message size.

Instead now we'll use a separate raw plan element for each raw prior state
element, so that we're limited only in the size of individual items rather
than size of the state as a whole.

This deals with the last remaining (non-deprecated) case where our RPC
protocol tries to pack an entire raw state or plan into a single protobuf
message, and so we're now standardized on using a streaming approach in
all cases.
2024-07-17 11:08:16 -07:00
Alisdair McDiarmid
d828776757 stacks+rpcapi: Load prior state and plan separately
Previously we expected clients to provide an inline raw prior state to
PlanStackChanges and an inline raw plan to ApplyStackChanges, which was
a simpler design but meant that we might end up generating a state or plan
that's too large to be submitted in a single gRPC request, which would then
be difficult to resolve.

Instead we'll offer separate RPC functions for loading raw state and plan
using a gRPC streaming approach, which better mirrors the streaming
approach we use to _emit_ these artifacts. Although we don't actually need
this benefit right now, this makes it possible in principle for a client
that's running PlanStackChanges to feed back the raw planned actions
concurrently into OpenPlan and thus avoid buffering the whole plan on the
client side at all.

This required resolving the pre-existing FIXME about the inconsistency
where stackeval wants a raw plan for apply but expects the caller to
have dealt with loading the prior state for planning. Here it's resolved
in the direction of the caller (rpcapi) always being responsible for
loading both artifacts, because that means we can continue supporting the
old inline approach for a while without that complexity having to infect
the lower layers.

Ideally we should remove the legacy approach before this API becomes
constrained by compatibility promises, but I've preserved the old API
for now to give us some flexibility in when we update the existing
clients of this API to use the new approach.

Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2024-07-17 11:08:16 -07:00
Liam Cervante
46a6d3f637
stacks: include moved and imported metadata in change descriptions (#35439) 2024-07-11 11:46:06 +02:00
Daniel Schmidt
b62a67394b
stacks: save plantimestamp to plan 2024-06-25 10:59:56 +02:00
Liam Cervante
0f0414d484
Fix partial address representation in plan for deferred actions (#34966)
* Fix partial address representation in plan

* reflect new type in stacks
2024-06-20 10:41:23 +02:00