Commit Graph

32491 Commits

Author SHA1 Message Date
Andrei Ciobanu
de95b65faa
RFC: s3 locking based on conditional writes (#2511)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-19 10:11:09 +02:00
Zach Goldberg
d5a6ff8d9f
January TSC meetings (#2530)
Signed-off-by: Zach Goldberg <zach@gruntwork.io>
2025-02-18 11:14:45 -08:00
Andrei Ciobanu
a3276028ad
Upgrade aws sdk to a version that will give us access to s3 conditional writes arguments (#2528)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-18 15:58:17 +02:00
Janik
cfb85299d5
gitignore: add coverage.out and coverage.html (#2519)
Signed-off-by: Janik H. <janik@aq0.de>
2025-02-13 19:59:28 -05:00
AbstractionFactory
ecac914580
Issue template overhaul (#2506)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-02-13 08:27:12 +01:00
Martin Atkins
5d03530483 command/views/json: Refactor NewDiagnostic into multiple functions
This function was previously quite long and complex, so this commit splits
it into a number of smaller functions.

The previous code structure was made more awkward by having to work around
all being together in one function -- particularly the part iterating over
the values used in an expression -- and so the new layout is quite
different and thus the diff is hard to read. However, there are
intentionally no test changes in this commit to help us be confident that
this has not regressed anything, and the existing unit tests for this
component seem quite comprehensive.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 11:40:41 -08:00
Martin Atkins
b03f9635ce addrs: TestMap test function is exempt from the cyclop lint
This function's cyclomatic complexity is essentially just a count of the
number of conditions in the test, which are written out as a flat sequence
of "if" statements and so cannot really be simplified any more without
making the test harder to read and maintain overall.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 09:09:52 -08:00
Martin Atkins
65f4d7f430 addrs: Rework parseRef to be shorter
Our complexity lint rules previously considered this function to have both
too many statements and too many lines.

Factoring out more of the "single-attr ref" logic into the
parseSingleAttrRef function eliminated one statement per case that was
using it.

Factoring out the handling of module call references -- the most complex
case this function handles -- into a separate parseModuleCallRef reduced
it considerably more.

Removing the empty lines between the "case" statements was necessary after
that just to get below the line count limit, which seems like a rather
dubious situation for a lint rule to complain about but it doesn't seem
to hurt readability, so fair enough.

The rework of parseSingleAttrRef made it slightly less convenient to use
as part of parseModuleCallRef, but not onerously so and thus this
prioritizes making the common case simpler at the expense of a small
amount of extra work in the parseModuleCallRef function.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-12 09:09:52 -08:00
Andrei Ciobanu
dfe2876931
Add a new warning when a provider cannot be downloaded and it was requested by an implicit usage (#2479)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-02-12 18:40:54 +02:00
Oleksandr Levchenkov
5ff40ae505
refactor sensitive marks usage (#2503)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-11 19:02:21 +02:00
Christian Mesh
d20d18e260
Clarify which functions exist on configured providers only (#2492)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-02-10 08:07:31 -07:00
Ilia Gogotchuri
ec4e0cf0e2
Migration of null resource to terraform data (#2481)
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2025-02-06 17:45:00 +04:00
Oleksandr Levchenkov
7ad0af1f4c
update MAINTAINERS to include new members (#2491)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-06 13:08:31 +01:00
Thomas de Lachaux
897f9ebf06
fix(docs): correct custom example typo (#2485)
Signed-off-by: Thomas de Lachaux <21559770+ThomasLachaux@users.noreply.github.com>
2025-02-06 09:32:20 +01:00
Oleksandr Levchenkov
b8c24e935d
update all github actions with no breaking changes (#2478)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-05 15:01:58 +02:00
Oleksandr Levchenkov
ad68328582
update all build-opentofu-oss gha (#2474)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-05 13:23:18 +02:00
Ilia Gogotchuri
5968e195b0
Moved for different types (#2370)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2025-02-05 15:14:19 +04:00
Oleksandr Levchenkov
9b9ae4a25e
update actions-packaging-linux gha (#2472)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-04 17:54:48 +02:00
Oleksandr Levchenkov
210c0f68b0
update upload and download artifacts gha (#2471)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-04 17:14:59 +02:00
Andrei Ciobanu
22a42d87ab
Dereference attributes during filtering to avoid schema cache altering (#2468)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-02-04 17:05:08 +02:00
AbstractionFactory
60fdd359d5
Fixes #2337: External encryption method (#2367)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-31 12:13:18 -05:00
Oleksandr Levchenkov
2a4d81042b
make pg backend acquire schema-based global locks (#2411)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-01-31 14:21:36 +02:00
Andrei Ciobanu
2f27d7eb90
Add a new go-getter detector wrapper that can remove the query params before giving the src to the actual detector (#2451)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-01-30 17:20:25 +02:00
Haider Bari
6614782e6d
Improved error messages for lock-related problems in the s3 backend (#2410)
Signed-off-by: Bari, Haider <haider.bari@fmr.com>
Co-authored-by: Bari, Haider <haider.bari@fmr.com>
2025-01-29 11:20:28 -05:00
AbstractionFactory
4083fe2cc4
Adding missing PR link to changelog (#2452)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-29 14:23:16 +01:00
Andrei Ciobanu
f00c10ac28
Add changelog entry for 2394 (#2447)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-01-29 11:05:26 +02:00
Andrei Ciobanu
ab9a7f4d72
Fix error message when default value of variable is of wrong type (#2444)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
2025-01-29 10:50:45 +02:00
AbstractionFactory
77c19fab1e
Bumping Go version to address CVE-2024-45336 and CVE-2024-45341 (#2438)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-28 21:40:13 +01:00
Andrei Ciobanu
089687061b
Fix: When a RequiredProvider is having syntax errors, return an empty one to allow further validations to generate their diags (#2408)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
Co-authored-by: yottta <andpectech@gmail.com>
2025-01-28 15:47:17 +02:00
AbstractionFactory
cc4ed538bd
Adding warning to the release documentation (#2434)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-28 13:11:09 +01:00
Andrei Ciobanu
8fe739dc83
MakeStaticTimestampFunc now returns unknown value if the given time.Time is zero (#2413)
Signed-off-by: yottta <andpectech@gmail.com>
Co-authored-by: yottta <andpectech@gmail.com>
2025-01-27 17:07:40 +02:00
Martin Atkins
f5eac16b00 providercache: Factor out installation from the global cache dir
This is another step towards breaking the huge functions in this package
into smaller parts that have a clearer set of inputs and outputs.

For the moment the goal is to modify the existing code as little as
possible to make this easier to review, and so the new function
tryInstallPackageFromCacheDir has an unfortunately-large number of
arguments. Future refactoring can hopefully improve on this further.

One significant change to the structure of this code is that because it's
now in a separate function working on only one provider at a time we can
rely on early return for error handling, letting the caller be responsible
for collecting any errors into the "errs" map, and so we don't need quite
as much nesting as the previous code had.

This should not change the observable behavior in any way, which is
reinforced by there being no changes to any tests in this commit.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-24 15:11:05 -08:00
Martin Atkins
eb3e21853e providercache: Decompose Installer.EnsureProviderVersions
This function has grown very large over time as the provider installation
requirements got more complicated. This is a first level of decomposition
of the three main steps into one separate function each.

The "ensureProviderVersionsInstall" method remains too large itself, but
for now that has just acquired a nolint directive so that we can approach
this gradually in the interests of making it easier to review.

This should not change the observable behavior of the provider installer
in any way, which is reinforced by the fact that there are no test changes
in this commit.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-24 15:11:05 -08:00
Christian Mesh
de5f273390
Use import provider instead of guess (#2336)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-01-24 17:18:08 -05:00
Ludovico Magnocavallo
e7f130a490
Add example on supporting both OpenTofu and Terraform versions to version-constraints.mdx (#2302)
Signed-off-by: Ludovico Magnocavallo <ludo@qix.it>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
2025-01-24 12:48:11 -05:00
AbstractionFactory
1b00b465da
Switch to native Linux/ARM64 runners (#2387)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-24 10:43:47 -05:00
Christian Mesh
87cd9227dc
Fix S3 acceptance test panic, introduced in 1.7 encryption (#2420)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-01-24 09:59:43 -05:00
Haider Bari
be72380cdb
"force-unlock" support for the HTTP backend (#2381)
Signed-off-by: Bari, Haider <haider.bari@fmr.com>
Co-authored-by: Bari, Haider <haider.bari@fmr.com>
2025-01-22 19:05:57 -05:00
dependabot[bot]
ebc900bec9 build(deps): bump github.com/hashicorp/go-slug from 0.15.0 to 0.16.3
Bumps [github.com/hashicorp/go-slug](https://github.com/hashicorp/go-slug) from 0.15.0 to 0.16.3.
- [Release notes](https://github.com/hashicorp/go-slug/releases)
- [Commits](https://github.com/hashicorp/go-slug/compare/v0.15.0...v0.16.3)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-slug
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 13:16:27 -08:00
Nik Stuckenbrock
8f616d41fd
Fix custom docker image instructions by adding gpg-agent package (#2405)
Signed-off-by: Nik Stuckenbrock <35262568+nikstuckenbrock@users.noreply.github.com>
2025-01-21 21:37:50 +01:00
Diógenes Fernandes
ff18b87337
Update .devcontainer.json go's version to 1.22 (#2385)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-01-17 15:45:56 +01:00
Martin Atkins
4936a89321 go.mod: Upgrade go-cty to v1.16.1
This includes a number of small enhancements and bug fixes compared to
version v1.14.4 that we were previously using, as described in this
commit's CHANGELOG update.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-15 07:56:27 -08:00
AbstractionFactory
f254cbc673
Fixes #2356: Minimal base image (#2375)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-15 13:46:34 +01:00
Martin Atkins
2848ed054e
rfc: Update README.md to discuss RFC Tracking Issues (#2377)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-15 07:36:54 -05:00
Martin Atkins
0576d07397 RFC: Naming convention for internal variables representing "contexts"
This is a lightweight RFC proposing that we adopt some cross-cutting naming
conventions for variables of various different types whose names all
include the noun "context", both to gradually improve existing confusion
and inconsistency in the codebase and in particular to un-squat the name
"ctx" that has emerged as the idiomatic name for a context.Context
elsewhere in the Go ecosystem.

This proposal does not call for any immediate code changes. It is only an
attempt to agree on some conventions to follow in future work on other
projects.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-14 14:39:29 -08:00
Martin Atkins
6bd681e98f Process RFC: RFC Tracking Issues
Proposal for creating a separate "tracking issue" for each accepted RFC,
which represents the implementation of the features described in that RFC
separately from the potentially-many feature request issues it aims to
address.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-14 14:33:04 -08:00
Oleksandr Levchenkov
d7af2c4d39
update tofu console docs for non-interactive use-case (#2369)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Oleksandr Levchenkov <ollevche@gmail.com>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-14 19:03:30 +02:00
AbstractionFactory
174f1d5784
Fixed broken links in encryption docs (#2366)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-13 16:00:48 +01:00
AbstractionFactory
b036e534b2
Fixing incorrect keyprovider-external.tofu (#2365)
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-13 15:53:05 +01:00
Christian Mesh
52816a96dc
Run make generate protobufs (#2360)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-01-10 11:34:33 -05:00