Commit Graph

32403 Commits

Author SHA1 Message Date
Martin Atkins
954e3aed01 rfc: Static Evaluation of Provider Iteration state tracking revision
The original proposal called for the state snapshot loader to accept a
resource instance with both an instance-level provider instance address
and a resource-level provider instance address.

The final implementation does follow that specification, but it also emits
a warning in that case to draw attention to the inconsistency.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-11 12:52:50 -08:00
Martin Atkins
b480343798 rfc: Static Evaluation of Provider Iteration state tracking revision
The original proposal called for the state snapshot writer to generate a
resource-level provider property if all of the instances of the resource
had the same provider instance address, regardless of what that address
actually is.

The actual implementation instead chose to generate the resource-level
property only if none of the instances of the resource refer to a provider
instance that has an instance key.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-11 12:52:50 -08:00
Christian Mesh
00bc17917a Require static scope stack to have at least one entry
Kind of odd code smell, but the only alternative I could think of was a
panic.  Would rather ensure this requirement at compile time instead.

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-11 10:14:49 -08:00
Martin Atkins
7fdc4909d6 configs: Some basic tests for StaticScope's GetLocalValue
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-11 10:14:49 -08:00
Martin Atkins
083e5f2e1c configs: Early eval must "finalize" input variable values
In the main language runtime input variables have both a "raw" value as
provided by the caller and a "finalized" value that has been
type-converted, default-attributes-inserted, and validated.

Unfortunately the "early eval" codepath is essentially a reimplementation
of the language runtime in terms of data available in the static
configuration, and it previously wasn't properly emulating the finalization
of input variable values and was thus incorrectly exposing the "raw"
values into a module instead of the "finalized" values.

Since we are already in the v1.9 prerelease period significant refactoring
is too risky, and so this just copies the most important transformations
from the language runtime into the early eval runtime. We hope to find a
more sustainable way to implement this in the future, but that will likely
require refactoring of both the early eval codepath _and_ the traditional
language runtime, and so that work needs to begin early in a minor release
period.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-11 10:14:49 -08:00
Ilia Gogotchuri
267b7f6008
Warn user about provider version 0.0.0 (#2281)
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2024-12-11 21:10:49 +04:00
I S
c433f87c58
Update TSC_SUMMARY.md (#2279)
Signed-off-by: I S <igor@scalr.com>
2024-12-11 08:40:19 -08:00
Christian Mesh
6c74923f22
Local values can now be used in provider key expressions (#2280)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-11 07:46:40 -05:00
Oleksandr Levchenkov
01ef4dd8a4
add missing changelog for #2274 (#2275)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-10 16:45:39 +02:00
Oleksandr Levchenkov
5f8eee4708
add simulated state serialization between tofu test runs (#2274)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-10 16:34:25 +02:00
Christian Mesh
f5930c6ce1
Bump version to 1.9.0-beta2 (#2271)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-09 09:11:10 -05:00
Christian Mesh
ece1bb4f49
Fix data provider iteration destroy (#2270)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-09 07:56:58 -05:00
Ilia Gogotchuri
ffa43acfcd
Azurerm backend timeout (#2263)
adds a timeout_seconds configuration variable with a default value to the AzureRM backend
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2024-12-06 17:32:23 +04:00
Christian Mesh
85dc2615ad
Fix packagecloud push skip for alpha/beta/rc (#2256)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-05 10:39:55 -05:00
AbstractionFactory
eecf4f3c85
Update release instructions (#2259)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-12-05 16:01:35 +01:00
Oleksandr Levchenkov
dd2c75fe7f
prepare for v1.9.0-beta1 (#2258)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-05 16:42:15 +02:00
Martin Atkins
c453eb6a3b
website: Initial documentation updates for dynamic provider instances (#2138)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-05 07:46:02 -05:00
Christian Mesh
f6a1d8e2dd
Support References in Variable Validation (#2216)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-04 14:24:44 -05:00
Christian Mesh
3d51e3c9df
Shallow clone of website/submodules for testing (#2249)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-04 12:24:41 -05:00
Oleksandr Levchenkov
32ca523689
fix: type defaults for variables in tests (#2244)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-04 16:48:08 +02:00
Oleksandr Levchenkov
e5d26f9a71
make tofu test generate dynamic mock values (#2245)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-04 16:22:54 +02:00
Oleksandr Levchenkov
da1ad73f6e
fix tf migration buttons in docs (#2243)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-04 12:46:23 +02:00
AbstractionFactory
7b42ce7238
Missing release notes for #2179 (#2242)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-12-04 11:20:34 +01:00
Christian Mesh
c7aaa5ed50
Force state change if encryption used fallback (#2232)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-03 17:44:30 -05:00
Christian Mesh
8fb8f066c4
Detect when provider and resource/module have identical for_each (#2186)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-03 14:02:27 -05:00
Martin Atkins
91b43aecd1
tofu: Variable validation diagnostics must mark sensitive values (#2233)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-12-03 12:40:44 -05:00
Oleksandr Levchenkov
6c8bfa2794
implement override resources for mock providers (#2168)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-03 11:24:26 -05:00
Jon Johnson
cb866bf503
Only wake up from waitDeps to trace when debugging (#2176)
Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
2024-12-02 09:36:38 -05:00
Christian Mesh
0903aeff58
Split variable evaluation / validation scope (#2199)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-02 09:18:07 -05:00
AbstractionFactory
84395e505d
Adding website updates to the release docs (#2226)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-12-02 09:00:51 -05:00
AbstractionFactory
091f68d173
Updated migration guides (#2224)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
2024-11-28 14:57:55 +01:00
Oleksandr Levchenkov
a117f86b98
Fix: Change warning to error when incorrect type is used for mocking a resource (#2220)
Signed-off-by: pooriaghaedi <pooria.ghaedi@aerlingus.com>
Signed-off-by: Pooria Ghaedi <36617391+pooriaghaedi@users.noreply.github.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Co-authored-by: pooriaghaedi <pooria.ghaedi@aerlingus.com>
Co-authored-by: Pooria Ghaedi <36617391+pooriaghaedi@users.noreply.github.com>
2024-11-28 14:22:42 +02:00
Ronny Orot
cf34b0e6a9
Skip imports on tofu destroy (#2214)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2024-11-25 23:52:03 +02:00
AbstractionFactory
5d48a940da
Creating a release manual (#2212)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-11-25 07:11:25 -05:00
Oleksandr Levchenkov
8d81e14fda
add missing changelog entry for http backend logging (#2206)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-22 13:18:24 +02:00
AbstractionFactory
1cdfd7e867
Adding missing changelog entry and go.mod change for #2050 (#2205)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-11-22 11:32:10 +01:00
Oleksandr Levchenkov
7645992d9b
fix mock type conversion in tofu test (#2144)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-20 17:47:13 +02:00
Oleksandr Levchenkov
2758f2cfbf
fix mock provider validation (#2140)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-20 16:45:17 +02:00
Haider Bari
dbea01eea6
Add DEBUG-level logging to the "http" state storage backend (#2120)
Signed-off-by: Bari, Haider <haider.bari@fmr.com>
Co-authored-by: Bari, Haider <haider.bari@fmr.com>
2024-11-20 16:36:45 +02:00
Martin Atkins
2448204201 tofu: context.Context plumbed into the graph walk driver
Earlier commits arranged for each of our tofu.Context exported methods that
perform graph-based operations to take a context.Context from their
callers, and for the main callers in package command and package backend
to connect those contexts to the top-level context from "package main"
that can potentially have an OpenTelemetry span attached to it.

This propagates those contexts a little deeper into the guts of the
language runtime, getting it as far as the shared logic that drives a
graph walk.

The next step from here would be to change the interfaces
GraphNodeExecutable and GraphNodeDynamicExpandable so that their methods
both take a context.Context, but that would involve a big sprawling
update to every implementation of each of those interfaces and so
we'll save that for a later commit to keep this one relatively clean.

This commit also reaches the first point of ambiguity where our older
conventions call for "ctx" to be the variable name for a tofu.EvalContext
rather than a context.Context. Since "ctx context.Context" is a core idiom
in the Go community, we'll switch to using evalCtx as the variable name
for tofu.EvalContext both here and in our future commits that will
modify the two main graph walk interfaces that make extensive use of the
tofu.EvalContext interface.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
a8b6342556 tofu: Context.Input now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Input now passes this through to the UI input implementation,
which was already written to handle cancellation. However, that
implementation currently handles interruption itself by directly watching
for the interrupt signal and so we remove the cancellation from the
context for now to avoid changing how interrupts are handled. Hopefully
in future we can remove the inline SIGINT handling from the UIInput
implementation and use its context-cancellation-handling instead.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
9cadb097ba tofu: Context.Validate now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Validate doesn't yet do anything with its new context, but we'll
plumb this deeper in future.

Since the local backend's implementation of backend.Local.LocalRun calls
Validate on the given configuration before returning, it this also extends
that interface method to take a context, and so the various commands that
directly create "local runs" (rather than going through the backend
operation API) now all pass in a context derived from the one created
in "package main".

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
6522f73249 tofu: Context.Eval now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Eval doesn't yet do anything with its new context, but we'll
plumb this deeper in future.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
8ae790ca06 tofu: Context.Import now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Import doesn't yet do anything with its new context, but we'll
plumb this deeper in future.

OpenTofu has some historical situational private uses of context.Context
to handle the graceful shutdown behaviors. Those use context.Context as
a private implementation detail rather than public API, and so this commit
leaves them as-is and adds a new "primary context" alongside. Hopefully
in future refactoring we can simplify this to use the primary context also
as the primary cancellation signal, but that's too risky a change to bundle
in with this otherwise-mostly-harmless context plumbing.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
3b79efa834 tofu: Context.Refresh now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Refresh is really just a vestigal wrapper around Context.Plan, so
this just passes the given context through to Context.Plan which itself
currently ignores it.

OpenTofu has some historical situational private uses of context.Context
to handle the graceful shutdown behaviors. Those use context.Context as
a private implementation detail rather than public API, and so this commit
leaves them as-is and adds a new "primary context" alongside. Hopefully
in future refactoring we can simplify this to use the primary context also
as the primary cancellation signal, but that's too risky a change to bundle
in with this otherwise-mostly-harmless context plumbing.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
1134f19467 tofu: Context.Apply now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Apply does not yet do anything with its new context, but this gets
the context plumbed in enough that we should be able to pass values like
telemetry spans all the way from the top-level in future.

OpenTofu has some historical situational private uses of context.Context
to handle the graceful shutdown behaviors. Those use context.Context as
a private implementation detail rather than public API, and so this commit
leaves them as-is and adds a new "primary context" alongside. Hopefully
in future refactoring we can simplify this to use the primary context also
as the primary cancellation signal, but that's too risky a change to bundle
in with this otherwise-mostly-harmless context plumbing.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
3d5039f1f3 tofu: Context.Plan now takes a context.Context
This continues our ongoing effort to get a coherent chain of
context.Context all the way from "package main" to all of our calls to
external components.

Context.Plan does not yet do anything with its new context, but this gets
the context plumbed in enough that we should be able to pass values like
telemetry spans all the way from the top-level in future.

OpenTofu has some historical situational private uses of context.Context
to handle the graceful shutdown behaviors. Those use context.Context as
a private implementation detail rather than public API, and so this commit
leaves them as-is and adds a new "primary context" alongside. Hopefully
in future refactoring we can simplify this to use the primary context also
as the primary cancellation signal, but that's too risky a change to bundle
in with this otherwise-mostly-harmless context plumbing.

All of the _test.go file updates here are purely mechanical additions of
the extra argument. No test is materially modified by this change, which
is intentional to get some assurance that isn't a breaking change.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
Martin Atkins
35bedc479f command: Meta.RunOperation takes a context.Context
This is part of an ongoing effort to plumb a properly-connected series of
contexts through all of the layers where we might want to generate
telemetry (or similar) in future.

This is _just enough_ to connect the top-level context created by package
main with the various child contexts created by the local backend, so
that they could in principle access the root span that package main
generates.

This is not yet sufficient to propagate the context all the way into the
language runtime. More plumbing to follow in later commits!

This intentionally does not introduce any new OpenTelemetry-specific
context: the goal is only to get the context chain in place so that we
can use it for telemetry delivery in future.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-19 10:15:21 -08:00
dependabot[bot]
ce8c443754
Bump cross-spawn from 7.0.3 to 7.0.6 in /website (#2185)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 18:44:34 +01:00
dependabot[bot]
6081a05d60
Bump micromatch from 4.0.5 to 4.0.8 in /website (#2178)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 18:17:10 +01:00