Commit Graph

32362 Commits

Author SHA1 Message Date
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
dependabot[bot]
a9355a2607
Bump github.com/golang-jwt/jwt/v4 from 4.4.2 to 4.5.1 (#2179)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 18:16:50 +01:00
Sergey Pisarenko
bb6b6c1fc4
Bump golang version to 1.22.8 (address CVE-2024-34156) (#2050)
Signed-off-by: Sergey Pisarenko <spisarenko@palantir.com>
Co-authored-by: Sergey Pisarenko <spisarenko@palantir.com>
2024-11-19 17:47:57 +01:00
Haider Bari
eb15415a2d
"http" backend to return existing lock metadata on lock conflict, rather than new lock metadata (#2090)
Signed-off-by: Bari, Haider <haider.bari@fmr.com>
Co-authored-by: Bari, Haider <haider.bari@fmr.com>
2024-11-19 14:57:19 +02:00
Oleksandr Levchenkov
e4f685d12b
pin node version for docusaurus build (#2177)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-19 09:45:02 +01:00
Oleksandr Levchenkov
52cc91c87a
upgrade golangci-lint to v1.62 (#2174)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-18 19:56:29 +02:00
Jon Johnson
821e67feed
Use Equal instead of address strings (#2172)
Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
2024-11-18 09:53:19 +01:00
adenhuen
0e189b33f8
test: ensure test vars are not used in tf plan (#2128)
Signed-off-by: Aden Huen <aden.huen@gmail.com>
Signed-off-by: adenhuen <aden.huen@gmail.com>
Signed-off-by: Ados <aden.huen@gmail.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
2024-11-12 17:23:54 +02:00
Christian Mesh
ea3b06b44d
Bump version to 1.9.0-alpha2 (#2153)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-11-07 12:50:50 -05:00
Christian Mesh
c57e634bc4
Fix destroy/orphan path with provider instances (#2150)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-11-07 12:41:13 -05:00
Christian Mesh
30b5088da4
Improve log messages for providers with keys (#2152)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-11-07 11:56:21 -05:00
Martin Atkins
d396502d28 initwd: Commentary on version constraint parsing compromises
Due to some historical technical debt in this area we are intentionally
accepting a rather hacky but narrowly-scoped solution to a bug that
prevented selection of prerelease versions of modules when a version
constraint was written with a "v" symbol before the version selection,
such as in "=v1.0.0-beta1".

This commit just records some commentary about the decision for the benefit
of a future maintainer that is likely to wonder why this code is written
the way it is, and (assuming GitHub outlives these comments) link back to
the discussion that motivated it.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-06 11:10:52 -08:00
AYM1607
3545d0fbf3 Update logging wording.
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
AYM1607
8de4488443 Strip "v" prefix from constraints when parsing by apparentlymart/go-versions fails.
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
AYM1607
c3cb9c0485 Revert back to the previous implementation.
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
AYM1607
03c6700fd2 Add prerelease test with multiple constraints.
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
AYM1607
08ad2f5983 Use the hashicorp/go-version for handling pre-release version constraints during module installation. Adds more tests.
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
AYM1607
6a5c1a2f42 adds tests for module prerelease version constraints with a v prefix
Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
2024-11-06 11:10:52 -08:00
Oleksandr Levchenkov
5264ccee99
fix documentation typo in mock provider link (#2146)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-06 17:30:40 +02:00
Martin Atkins
b01a99e9ab
CHANGELOG: Prepare for the v1.9.0 prerelease period (#2143)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-11-06 13:40:23 +01:00
Christian Mesh
fd775f0fe3
Implement Provider for_each (#2105)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Co-authored-by: ollevche <ollevche@gmail.com>
Co-authored-by: Ronny Orot <ronny.orot@gmail.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-05 18:08:23 -05:00
Arel Rabinowitz
3d4bf29c56
Add exclude flag support (#1900)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2024-11-05 10:16:00 -05:00
Christian Mesh
e802b23200
Partial revert of #1911, support provider for_each in aliases (#2121)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-11-05 06:19:52 -05:00
Christian Mesh
1155a3f711
Partially unknown provider functions arguments fixed (#2127)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-11-04 14:23:53 -05:00
Martin Atkins
6707ef6ca3
Fix regression of backend reinit detection when backend schema has required arguments (#2119)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-04 14:23:32 -05:00
Ioannis Polyzos
79a2bb3c47
CopyDir cmd code refactoring suggestions (#2070)
Signed-off-by: Ioannis Polyzos <git@ipolyzos.com>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-11-04 21:21:06 +02:00
Martin Atkins
e6ca786e09 rfc: Static Evaluation of Provider Iteration further updates
This continues the work of the last few commits, updating this RFC to
reflect the evolved design that's makes room for adding fully-dynamic
provider instance expansion in a later release.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-10-31 10:50:34 -07:00
Christian Mesh
b8d4b24964 RFC: Claify scenarios that don't work
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-31 10:50:34 -07:00
Christian Mesh
a11251cb67 RFC: Clarify provider validate special case
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-31 10:50:34 -07:00
Christian Mesh
68a3d7fcd3 RFC provider iteration: Update technical details
Now that we have a prototype well understood, we can
better describe the technical challenges and implementation
flow

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-31 10:50:34 -07:00
Martin Atkins
757daacab9 RFC: Updated "Static Evaluation of Provider Iteration"
This is the beginnings of a proposed amendment to the previously-approved
RFC for static-eval-based provider expansion to incorporate the new
constraints discovered for RFC "Dynamic Provider Instances and Instance
Assignment".

This first draft of the changes focuses only on the "User Documentation"
portion to ensure that we have consensus on the intended user-facing
changes before worrying too much about the implementation details. A
subsequent commit will revise the implementation details once the new
version of the language design is settled.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2024-10-31 10:50:34 -07:00
AbstractionFactory
9d842aa920
Fixes #1605: Customizable metadata key on encryption key providers (#2080)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2024-10-30 19:52:23 +01:00
Oleksandr Levchenkov
0550798ea8
add some missing changelog entries (#2116)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-10-29 12:39:12 +02:00
boaz0
810df00376
Fix exit command in console interactive mode (#2086)
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2024-10-29 12:13:44 +02:00
jinjiadu
384dc4cb93
chore: fix some function names (#2108)
Signed-off-by: jinjiadu <jinjiadu@aliyun.com>
2024-10-29 12:07:10 +02:00
Wojciech Barczyński
de9fb7ccca
[TSC] summary for the 2024-10-22 TSC meeting (#2094)
Signed-off-by: wojciech12 <wojciechb@spacelift.io>
2024-10-23 17:37:51 +02:00
Christian Mesh
e3a6bcab96
Fix provider functions in child modules (#2082)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-23 10:42:38 -04:00
James Humphries
c9541d81b6
Fallback to reading the x-terraform-get header if the module registry returns an empty json body (#2079)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2024-10-23 15:33:56 +01:00
James Humphries
ce6f727755
Ensure config generation does not crash when importing sensitive values (#2077)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2024-10-23 15:32:48 +01:00
Wojciech Barczyński
41693b781f
[TSC] summary for the 2024-10-15 TSC meeting (#2092)
Signed-off-by: wojciech12 <wojciechb@spacelift.io>
2024-10-22 19:53:08 +02:00
MS99-9
9c379c0dc0
[REFACTORING] Add description to the schemas used by tofu test #894 (#2029)
Signed-off-by: Ioannis Polyzos <git@ipolyzos.com>
Signed-off-by: Mohamed Medhat Mohamed Ibrahim Shalaby <mohamed.shalaby@tum.de>
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Signed-off-by: Yousif Akbar <11247449+yhakbar@users.noreply.github.com>
Co-authored-by: Ioannis Polyzos <git@ipolyzos.com>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
Co-authored-by: Mohamed Medhat Mohamed Ibrahim Shalaby <mohamed.shalaby@tum.de>
Co-authored-by: Yousif Akbar <11247449+yhakbar@users.noreply.github.com>
2024-10-21 11:00:33 +02:00
Christian Mesh
7cacb9f066
Fix function refs in variable validation (#2052)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-17 12:37:54 -04:00