Commit Graph

32777 Commits

Author SHA1 Message Date
Diogenes Fernandes
b187486357 initial draft
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-06-26 20:45:43 -03:00
I S
75bf1c2f65 Updated references and moved governance stuff to a new repo opentofu/org (#2953)
Signed-off-by: Igor Savchenko <igor@scalr.com>
2025-06-25 10:50:10 -07:00
Diógenes Fernandes
b82ed64756 update CODEOWNERS to match the new governance chart (#2959)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-06-25 12:47:24 -03:00
Martin Atkins
0afbaae42d backend/s3: Use APNInfo instead of UserAgent (#2955)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-25 09:15:40 -04:00
Christian Mesh
3c17015702 Include v1.10.0 in govulncheck (#2951)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-06-24 09:10:40 -04:00
Zach Goldberg
1c309045ab TSC Notes June 10 2025 (#2902)
Signed-off-by: Zach Goldberg <zach@zachgoldberg.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-06-24 08:15:22 -04:00
James Humphries
499150cf25 Agenda for TSC meeting Jun 24th (#2943)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-06-24 07:47:48 -04:00
Austin Lynn Huffman
ec65e12584 fix: select CLI configuration files in the correct order on Windows (#2891)
Signed-off-by: Jellayy <austinlynnhuffman@gmail.com>
2025-06-19 12:23:39 -03:00
Martin Atkins
e6f0083ecc builtin/providers/tf: pass real context.Context to backend methods (#2938)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-19 10:46:39 +01:00
Martin Atkins
a1ba3e24aa tofu: EvalContext expression evaluation takes context.Context (#2937)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-19 10:46:31 +01:00
Martin Atkins
708a633cc5 CHANGELOG: correct mistake in the entry for #2643
Apparently I had the wrong noun in my head when I wrote this changelog description, since this change _externally_ uses "exclude" but _internally_ uses a feature called "deferred". 🙄

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-18 18:12:21 -07:00
Martin Atkins
1380154250 lang: Data methods now take context.Context
This caused a bunch of mechanical changes to callers, of course. Expression
evaluation is a very cross-cutting concern, so updating everything all at
once would be a lot and so this stops at a mostly-arbitrary point wiring
a bunch of callers to pass in contexts without changing anything that has
lots of callers.

We'll continue pulling on this thread in later commits.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-18 07:26:17 -07:00
Larry Bordowitz
782b817ff9 refactor: lint without revision flag (#2931)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-17 22:07:14 +04:00
Larry Bordowitz
ed6699f8c9 refactor: add err checks (#2896)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-17 20:18:53 +04:00
Martin Atkins
952c7b255f lang: hcl.EvalContext creation needs context.Context
Because of the support for provider-contributed functions, expression
evaluation can potentially cause provider gRPC requests to happen, and so
we'll need to be able to plumb OpenTelemetry trace information through to
those calls.

This initial commit focuses mainly on just getting the functions in
lang.Scope set up to take context.Context, along with their companions in
configs.StaticEvaluator, while leaving most of the callers just passing
context.TODO() for now so we can gradually deal with the rest of the
plumbing in later commits.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-17 07:56:33 -07:00
Martin Atkins
f34e7638e5 go.mod: go get github.com/cloudflare/circl@v1.6.1
This release contains fixes for a security advisory that does not affect
OpenTofu.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-17 06:41:37 -07:00
Martin Atkins
b17953c55f go.mod: Upgrade to Go 1.24.4
This addresses several security advisories. None of them impact OpenTofu
significantly, and so the primary goal here is just to clear false-positive
security scanner reports for future releases per our typical policy for
non-impactful advisories in our upstream dependencies.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-17 06:41:37 -07:00
Martin Atkins
9d93b939f5 tofu: EvalContext provider methods take context.Context
Continuing the ongoing work of getting context.Context wired in everywhere
we might want to generate OpenTelemetry traces, this completes all of the
provider-related methods of EvalContext.

Unfortunately there is still one remaining path not included here: the
EvalContext.EvaluationScope method needs to somehow arrange for contexts
to reach the provider-defined functions so that we can pass the context
to providers.Interface.CallFunction, which is tricky because that has to
get through the cty function API that wasn't designed for functions that
are backed by network calls. We'll deal with that in a subsequent commit
because it's likely to be a more invasive change than the
relatively-mechanical wiring updates included here.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-17 06:38:53 -07:00
Christian Mesh
59659c8009 Add TOFU_CPU_PROFILE for enabling go pprof (#2904)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-06-16 09:02:54 -04:00
Martin Atkins
e389ae3974 providers: Recommend -exclude when provider can't plan
It seems that a small number of providers are now able to return a special
signal when they find that they are unable to perform an operation due to
unknown values in the provider or resource configuration.

This is a uses that new signal to recommend a workaround in that situation,
giving a more actionable error message than would've been returned by the
provider otherwise.

We've not yet decided how OpenTofu might make use of these new signals in
the long term, and so this is intentionally implemented in a way where
most of the logic is centralized in the provider-related packages rather
than sprawled all over "package tofu".

It's likely that a future incarnation of this will plumb this idea in more
deeply, but this is just a temporary stop-gap to give slightly better
error messages in the meantime and so it's better to keep it relatively
contained for now until we have a longer-term plan for what OpenTofu Core
might do with this information.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-13 09:17:36 -07:00
Martin Atkins
00dc728aea getproviders: context.Context for source constructor functions
This completes some of the missing connections for contexts in the provider
source codepaths by introducing context.Context parameters and wiring them
through so we can eliminate a few more context.TODO() placeholders.

For consistency's sake this adds context.Context to all four of the
getproviders.Source implementations that directly interact with stuff
outside of OpenTofu (network services or filesystem), even though not
all of them currently make use of it, just because interactions with
outside stuff tends to encourage cross-cutting concerns like logging and
tracing and so this ensures we have contexts propagated in there for such
future uses.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-13 08:22:47 -07:00
Martin Atkins
324ef91c4e tofu: Test that context.Context values can reach the provider calls
This introduces a new testing helper to package tracing which we can use
to make sure that context.Context values are able to reach all the way
from a test caller to some specific function elsewhere in the system.

We then use that helper in package tofu to test whether context values are
able to reach calls to providers, which tend to be the deepest place that
package tofu is responsible for routing them to.

As of this test the providers.Interface.Configure method does not seem to
receive values, so that is currently commented out in this test and we'll
deal with that properly in a subsequent commit.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-13 08:21:32 -07:00
Martin Atkins
d2bef1fd47 Adopt OpenTofu's own "svchost" module
Previously we were using a third-party library, but that doesn't have any
support for passing context.Context through its API and so isn't suitable
for our goals of adding OpenTelemetry tracing for all outgoing network
requests.

We now have our own fork that is updated to use context.Context. It also
has a slightly reduced scope no longer including various details that
are tightly-coupled to our cliconfig mechanism and so better placed in the
main OpenTofu codebase so we can evolve it in future without making
lockstep library releases.

The "registry-address" library also uses svchost and uses some of its types
in its public API, so this also incorporates v2 of that library that is
updated to use our own svchost module.

Unfortunately this commit is a mix of mechanical updates to the new
libraries and some new code dealing with the functionality that is removed
in our fork of svchost. The new code is primarily in the "svcauthconfig"
package, which is similar in purpose "ociauthconfig" but for OpenTofu's
own auth mechanism instead of the OCI Distribution protocol's auth
mechanism.

This includes some additional plumbing of context.Context where it was
possible to do so without broad changes to files that would not otherwise
have been included in this commit, but there are a few leftover spots that
are context.TODO() which we'll address separately in later commits.

This removes the temporary workaround from d079da6e9e, since we are now
able to plumb the OpenTelemetry span tree all the way to the service
discovery requests.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-12 09:37:59 -07:00
Christian Mesh
78a325732d Allow configuration aliases in root module to impact validation only (#2905)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-06-11 12:55:48 -04:00
Christian Mesh
52700e677e Cleanup github workflows (#2903)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-06-11 07:15:07 -04:00
Larry Bordowitz
9b6a8fae60 refactor: implement all simple static checks (#2895)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-10 15:48:43 -04:00
adenhuen
6fa79a7de3 docs: update JSON Output Format page (#2885)
Signed-off-by: Ados <aden.huen@gmail.com>
2025-06-10 10:33:27 -04:00
Larry Bordowitz
839392d52c refactor: remove unused func in s3 backend (#2879)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-10 10:28:17 -04:00
adenhuen
a4f384cf32 docs: add dev version step for local docs (#2886)
Signed-off-by: Ados <aden.huen@gmail.com>
2025-06-10 10:27:23 -04:00
James Humphries
bcfd47686f Added TSC agenda for 2025-06-10 (#2890)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-06-10 10:24:37 -04:00
Larry Bordowitz
afa7787859 refactor: fix deprecated Google Cloud KMS lib (#2897)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-10 10:24:16 -04:00
Larry Bordowitz
837f905c7f refactor: remove unnecessary var in k8s backend (#2894)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-10 10:22:40 -04:00
Larry Bordowitz
906121112e refactor: De-dupe file locking code (#2900)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-10 10:20:51 -04:00
Larry Bordowitz
d769106b1e Provider keyed instance refactor (#2875)
Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-06-09 10:52:14 -04:00
baa-ableton
3bdd0073a5 command: tofu show -config (#2820)
Signed-off-by: Babur Ayanlar <babur.ayanlar@ableton.com>
2025-06-02 10:15:46 -07:00
Martin Atkins
34d9878a57 version: this branch now represents v1.11 series development
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-02 09:53:15 -07:00
Martin Atkins
7e635533d1 CHANGELOG: Prepare for v1.11 development (#2883)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-02 12:39:28 -04:00
Andrei Ciobanu
4adc571c8c Fix a typo in the external method code snippet (#2881)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-06-02 15:19:47 +03:00
James Humphries
c1d0865a38 Added TSC Notes for May 27th (#2871)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-05-30 09:22:58 -04:00
Martin Atkins
85a90f3d78 website: OCI provider mirror shouldn't talk about prereleases anymore
This text was from earlier on in the development period when we hadn't yet
settled on a strategy, but now we are intending to work with the ORAS team
so that ORAS can construct index manifests in the form that OpenTofu
expects, so we'll talk about that instead of making a comment about
prereleases that will become confusing once OpenTofu v1.10.0 final is
released.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-28 08:55:29 -07:00
Christian Mesh
c10b4b2d03 Update provider for_each internal documentation (#2870)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-28 11:30:41 -04:00
Christian Mesh
531ade9d35 Skip unnessary workflow checks (#2872)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-28 11:30:06 -04:00
Andrei Ciobanu
32fe919968 [RFC] Ephemeral resources and write-only attributes (#2793)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Andrei Ciobanu <andreic9203@gmail.com>
Co-authored-by: James Humphries <James@james-humphries.co.uk>
Co-authored-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2025-05-28 16:29:25 +03:00
Ruben Aleman
dfcb220edd docs: fix headers default value for backend http (#2864)
Signed-off-by: Ruben Aleman <github@rubenaleman.de>
2025-05-27 11:26:59 +01:00
Andrei Ciobanu
21a9523ecf [Govulncheck] Fix the command that checks for duplicated reports (#2861)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-05-27 10:59:26 +03:00
Martin Atkins
32082321bf providers: Interface now requires context.Context arguments
Continuing our work to gradually plumb context.Context to everywhere that
we want to generate OpenTelemetry traces, this completes the call path
for most (but not all) of the gRPC requests to provider plugins, so that
we can add OpenTelemetry trace instrumentation in a future commit.

Unfortunately there are still a few providers.Interface callers left in
functions that don't have context.Context plumbed to them yet, and so
those are temporarily stubbed as context.TODO() here so we can more easily
find and complete them later.

The two gRPC implementations of providers.Interface were previously making
provider requests using a single context.Context established at the time
the provider process was started, but that isn't an appropriate context
to use for per-request concerns like tracing, so that context is now
unused and could potentially be removed in a future commit, but this change
already got pretty large and so I intend to deal with that separately
later.

This now exposes the gRPC provider calls to potential context cancellation
that they would previously observe only indirectly though the Stop method.
Since Stop is primarily used for graceful shutdown of ApplyResourceChange,
the changes here explicitly disconnect the cancellation signal for
ApplyResourceChange in particular, while letting the others get canceled
in the normal way since they are expected to be free of significant
side-effects. In future work we could consider removing Stop from the
internal API entirely and keeping it only as an implementation detail of
the gRPC implementation of this interface, with ApplyResourceChange
directly reacting to context cancellation and sending the gRPC Stop call
itself, but again that's too much change for this already-large commit.

The internal/legacy package currently contains some legacy code preserved
for the benefit of the backends, and unfortunately contains more than is
strictly necessary to support those callers, and so there was some dead
code there that also needed updating. provider_mock.go is removed entirely
because it's just an older copy of the similar file in package tofu. The
few calls to providers in schemas.go are updated to use
context.Background() rather than context.TODO() because we have no
intention of plumbing context.Context into that legacy code, and will
hopefully just delete it wholesale one day.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-23 08:58:23 -07:00
Christian Mesh
f8d128491c Fix agenda filename (#2848)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-23 10:19:59 -04:00
Christian Mesh
5a8df7c7ac Add TSC Meeting link / info (#2847)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-23 10:00:27 -04:00
Christian Mesh
edfc680d94 Remove m*n locking from resource evaluation and O(m * n * (m+n)) iteration (#2835)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-05-23 09:47:29 -04:00
James Humphries
07b8a3f0cb [TSC Agenda] 2025-05-23 (#2845)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
2025-05-23 09:42:27 -04:00