Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
04a6838
fix(plugin): validate local archive paths before inventory use
osterman Nov 1, 2026
da656ca
fix(terraform): preserve state and lifecycle safety across source ref…
osterman Oct 28, 2026
1edd9fa
fix(auth): serialize shared AWS file transactions on Windows
osterman Oct 29, 2026
5e817a8
fix(auth): key provisioning fingerprints with a process secret
osterman Oct 29, 2026
6756e41
fix(terraform): address lifecycle safety review findings and close th…
osterman Nov 1, 2026
5d15e03
fix(plugin): bump auth-secrets to 1.1.1 for the bundle guard test input
osterman Nov 8, 2026
3909603
fix(source): recheck target ownership on reuse and reject volume-qual…
osterman Nov 8, 2026
addbcfa
fix(terraform): address remaining lifecycle safety review findings
osterman Nov 9, 2026
5b5a92e
fix(source): wait for concurrent refreshes and reject unsafe source l…
osterman Nov 9, 2026
fa9d82a
fix(terraform): route state list init output to stderr and keep state…
osterman Nov 10, 2026
bfd1ade
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 10, 2026
bd15102
fix(terraform): remove dangling source-owned artifacts
osterman Nov 11, 2026
8dcc62e
test(terraform): expand lifecycle safety coverage
osterman Nov 11, 2026
143ad40
ci(govulncheck): add 30G of swap so the call-graph pass finishes
osterman Nov 12, 2026
5604e4f
Merge remote-tracking branch 'origin/main' into fix/terraform-lifecyc…
osterman Nov 12, 2026
7adc3ba
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 12, 2026
c6906cc
fix(source): protect absent runtime paths and wrap ownership read errors
osterman Nov 13, 2026
aa7bca8
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 13, 2026
bc8ce40
fix(source): preserve safe repeated refreshes and fold runtime path case
osterman Nov 14, 2026
756b66f
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 14, 2026
0fddc4f
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 14, 2026
4ecbc62
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 14, 2026
b481980
fix(ci): filter golangci-lint with git on pull requests and drop Node…
osterman Nov 14, 2026
53866b9
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 15, 2026
35252a3
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 15, 2026
f1644d7
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 16, 2026
e55b25d
Merge branch 'refactor/terraform-provider-core' into fix/terraform-li…
osterman Nov 16, 2026
10b2749
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 16, 2026
f7c04d0
Merge remote-tracking branch 'origin/refactor/terraform-provider-core…
osterman Nov 16, 2026
143eb4c
Merge signed L1 main checkpoint into Terraform lifecycle safety
osterman Nov 17, 2026
99a2a97
fix(terraform): preserve before-hook failures and stabilize OIDC time…
osterman Nov 17, 2026
94a8796
Merge L1 HTTP cooldown regression fix and host contract consolidation
osterman Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ jobs:
# GO-2026-6597 (containerd/v2 < 2.3.6) landed — which exceeds the public
# runner's 16GB RAM and gets the runner OOM-killed (seen as `Killed`,
# exit 143 "shutdown signal", or "The operation was canceled"). Swap
# absorbs the overflow; request 30 GiB for the full scan.
# absorbs the overflow. 20G still let loaded runners thrash past the step
# timeout, so add 30G.
- name: Add swap space
uses: ./.github/actions/swap-space
with:
Expand All @@ -200,7 +201,7 @@ jobs:
# tried earlier and rejected: it barely reduced peak memory
# (govulncheck's SSA construction parallelizes via goroutines, which
# -p doesn't govern) while nearly tripling run time.
GOMEMLIMIT: "32GiB"
GOMEMLIMIT: "42GiB"
# The target also removes exact duplicate stacks from the report: the
# SARIF schema requires them to be unique and the upload rejects the
# report otherwise. See internal/ci/vulncheck.
Expand Down Expand Up @@ -393,7 +394,7 @@ jobs:
# Key settings:
# - install-mode: none - Tells the action to use the binary already in PATH
# (our custom-gcl that we just installed)
# - only-new-issues: true - Only report issues in changed code
# - only-new-issues / --new-from-merge-base - Only report issues in changed code
# - SARIF output - For GitHub Advanced Security / CodeQL integration
# - issues-exit-code: 0 - Always exit 0 so we upload SARIF to CodeQL
#
Expand All @@ -417,10 +418,17 @@ jobs:
# can fail transiently. The subsequent lint command still parses and
# validates the configuration, so skip the duplicate network preflight.
verify: false
only-new-issues: true
# Pull requests filter with git (--new-from-merge-base) instead of the
# action's only-new-issues. only-new-issues downloads the PR diff from the
# GitHub API, which refuses diffs over 20000 lines; the action then silently
# falls back to linting the whole repository and uploads every pre-existing
# finding to code scanning. Git has no such limit. The two options cannot be
# combined, so only-new-issues stays on for the other events (merge queue).
only-new-issues: ${{ github.event_name != 'pull_request' }}
args: >
--output.sarif.path=golangci-lint.sarif
--issues-exit-code=0
${{ github.event_name == 'pull_request' && format('--new-from-merge-base=origin/{0}', github.base_ref) || '' }}

- name: Upload filtered SARIF results
# merge_group's ephemeral gh-readonly-queue/... ref is deleted as soon
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/plugin-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
architecture: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}
Expand Down
6 changes: 6 additions & 0 deletions cmd/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,12 @@ func getConfigAndStacksInfo(commandName string, cmd *cobra.Command, args []strin
if doubleDashIndex > 0 {
finalArgs = lo.Slice(args, 0, doubleDashIndex)
argsAfterDoubleDash = lo.Slice(args, doubleDashIndex+1, len(args))
} else if len(args) > 0 {
// Callers prepend the operation name; Cobra's separator index applies
// only to the remaining RunE arguments, after it consumed the literal --.
positional, separated := pkgFlags.SplitArgsAtDash(cmd, args[1:])
finalArgs = append([]string{args[0]}, positional...)
argsAfterDoubleDash = separated
}

info, err := e.ProcessCommandLineArgs(commandName, cmd, finalArgs, argsAfterDoubleDash)
Expand Down
9 changes: 8 additions & 1 deletion cmd/helmfile/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
errUtils "github.com/cloudposse/atmos/errors"
e "github.com/cloudposse/atmos/internal/exec"
cfg "github.com/cloudposse/atmos/pkg/config"
"github.com/cloudposse/atmos/pkg/flags"
log "github.com/cloudposse/atmos/pkg/logger"
"github.com/cloudposse/atmos/pkg/perf"
"github.com/cloudposse/atmos/pkg/schema"
Expand Down Expand Up @@ -62,6 +63,11 @@ func getConfigAndStacksInfo(commandName string, cmd *cobra.Command, args []strin
if doubleDashIndex > 0 {
finalArgs = lo.Slice(args, 0, doubleDashIndex)
argsAfterDoubleDash = lo.Slice(args, doubleDashIndex+1, len(args))
} else if len(args) > 0 {
// The synthetic operation name is not part of Cobra's RunE argument slice.
positional, separated := flags.SplitArgsAtDash(cmd, args[1:])
finalArgs = append([]string{args[0]}, positional...)
argsAfterDoubleDash = separated
}

info, err := e.ProcessCommandLineArgs(commandName, cmd, finalArgs, argsAfterDoubleDash)
Expand Down Expand Up @@ -104,7 +110,8 @@ func resolveComponentPath(info *schema.ConfigAndStacksInfo, commandName string)
return handlePathResolutionError(err)
}

log.Debug("Resolved component from path",
log.Debug(
"Resolved component from path",
"original_path", info.ComponentFromArg,
"resolved_component", resolvedComponent,
"stack", info.Stack,
Expand Down
66 changes: 66 additions & 0 deletions cmd/packer_passthrough_contract_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package cmd

import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
)

// Exercise Cobra and the actual subprocess boundary, rather than copying separator logic.
func TestNativeCommandSeparatorPreservesArgv(t *testing.T) {
for _, family := range []string{"packer", "helmfile"} {
t.Run(family, func(t *testing.T) {
_ = NewTestKit(t)
root := t.TempDir()
require.NoError(t, os.MkdirAll(filepath.Join(root, "stacks"), 0o755))
componentDir := filepath.Join(root, "components", family, "probe")
require.NoError(t, os.MkdirAll(componentDir, 0o755))
executable, err := os.Executable()
require.NoError(t, err)
config := fmt.Sprintf("base_path: %q\ncomponents:\n %s:\n base_path: components/%s\n command: %q\nstacks:\n base_path: stacks\n included_paths: ['*.yaml']\n name_template: '{{ .vars.stage }}'\n", filepath.ToSlash(root), family, family, filepath.ToSlash(executable))
require.NoError(t, os.WriteFile(filepath.Join(root, "atmos.yaml"), []byte(config), 0o600))
stack := fmt.Sprintf("vars: {stage: dev}\ncomponents:\n %s:\n probe: {}\n", family)
require.NoError(t, os.WriteFile(filepath.Join(root, "stacks", "dev.yaml"), []byte(stack), 0o600))
require.NoError(t, os.WriteFile(filepath.Join(componentDir, "main.pkr.hcl"), []byte("// fake engine fixture\n"), 0o600))
require.NoError(t, os.WriteFile(filepath.Join(componentDir, "helmfile.yaml"), []byte("releases: []\n"), 0o600))
t.Chdir(root)
t.Setenv("ATMOS_CLI_CONFIG_PATH", root)
capture := filepath.Join(root, "argv.json")
t.Setenv("_ATMOS_TEST_DUMP_ARGS", capture)
operation, native := "validate", []string{"-syntax-only", "-var", "label=probe probe", "-var", "name=probe"}
if family == "helmfile" {
operation, native = "template", []string{"--set", "label=probe probe", "--set", "name=probe"}
}
args := append([]string{family, operation, "probe", "-s", "dev", "--"}, native...)
RootCmd.SetArgs(args)
require.NoError(t, Execute())
raw, err := os.ReadFile(capture)
require.NoError(t, err, "the native process must actually execute")
var actual []string
require.NoError(t, json.Unmarshal(raw, &actual))
// Extra Atmos-generated args may precede/follow native args. Find the entire
// contiguous sequence to assert ordering, spacing, and duplicate values.
found := false
for i := 0; i+len(native) <= len(actual); i++ {
match := true
for j := range native {
if actual[i+j] != native[j] {
match = false
break
}
}
if match {
found = true
break
}
}
require.True(t, found, "native argv %q missing from actual %q", native, actual)
require.Contains(t, actual, operation)
require.NotContains(t, actual, "--")
})
}
}
6 changes: 6 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ import (
"github.com/cloudposse/atmos/pkg/proexec"
atmosprofile "github.com/cloudposse/atmos/pkg/profile"
"github.com/cloudposse/atmos/pkg/profiler"
"github.com/cloudposse/atmos/pkg/provisioner/source"
"github.com/cloudposse/atmos/pkg/schema"
"github.com/cloudposse/atmos/pkg/startup"
"github.com/cloudposse/atmos/pkg/telemetry"
"github.com/cloudposse/atmos/pkg/terminal"
terminalenv "github.com/cloudposse/atmos/pkg/terminal/env"
tfoutput "github.com/cloudposse/atmos/pkg/terraform/output"
"github.com/cloudposse/atmos/pkg/toolchain"
"github.com/cloudposse/atmos/pkg/ui"
"github.com/cloudposse/atmos/pkg/ui/heatmap"
Expand Down Expand Up @@ -1753,6 +1755,10 @@ func Execute() error {
atmosGit.ResetRootTagCache()
defer atmosGit.ResetRootTagCache()
defer initcmd.SetAtmosConfig(nil)
tfoutput.ResetWorkdirProvisionCache()
defer tfoutput.ResetWorkdirProvisionCache()
restoreSourceInvocation := source.BeginInvocation()
defer restoreSourceInvocation()
executionID, restoreInvocation := proexec.BeginInvocation()
defer restoreInvocation()
defer perf.Track(&atmosConfig, "cmd.Execute")()
Expand Down
1 change: 1 addition & 0 deletions cmd/terraform/backend/backend_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func TestExecuteDeleteCommandWithValues(t *testing.T) {
}
}

// TestSetConfigInitializer tests the SetConfigInitializer function.
func TestSetConfigInitializer(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
Expand Down
82 changes: 82 additions & 0 deletions cmd/terraform/backend/backend_contract_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package backend

import (
"os"
"path/filepath"
"testing"

"github.com/stretchr/testify/require"

cfg "github.com/cloudposse/atmos/pkg/config"
"github.com/cloudposse/atmos/pkg/function/yamlsource"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
)

func TestBackendEnvironmentResolutionIsScoped(t *testing.T) {
dir := t.TempDir()
require.NoError(t, os.MkdirAll(filepath.Join(dir, "stacks"), 0o755))
require.NoError(t, os.WriteFile(filepath.Join(dir, "atmos.yaml"), []byte(`base_path: .
components:
terraform:
base_path: components/terraform
stacks:
base_path: stacks
included_paths: ['*.yaml']
name_template: '{{ .vars.stage }}'
`), 0o600))
require.NoError(t, os.WriteFile(filepath.Join(dir, "stacks", "dev.yaml"), []byte(`vars: {stage: dev}
components:
terraform:
probe:
env: {FIELD_BUCKET: component-bucket}
vars:
untouched: !terraform.output missing dev value
backend_type: s3
backend:
s3:
bucket: !env FIELD_BUCKET
key: !env FIELD_KEY fallback.tfstate
region: us-east-1
endpoints:
s3: !env FIELD_ENDPOINT
account: !terraform.state missing dev account
workspace_key_prefix: '!env FIELD_BUCKET'
fallback: !env FIELD_TEST_UNSET default-value
`), 0o600))
t.Chdir(dir)
t.Setenv("ATMOS_CLI_CONFIG_PATH", dir)
t.Setenv("FIELD_BUCKET", "process-bucket")
t.Setenv("FIELD_KEY", "reviewed.tfstate")
t.Setenv("FIELD_ENDPOINT", "http://127.0.0.1:4566")
t.Setenv("FIELD_TEST_UNSET", "")
require.NoError(t, os.Unsetenv("FIELD_TEST_UNSET"))
config, err := CreateDescribeComponentFunc(nil)("probe", "dev")
require.NoError(t, err)
backend := config["backend"].(map[string]any)
require.Equal(t, "component-bucket", backend["bucket"])
require.Equal(t, "reviewed.tfstate", backend["key"])
require.Equal(t, "http://127.0.0.1:4566", backend["endpoints"].(map[string]any)["s3"])
account, ok := yamlsource.Decode(backend["account"].(string))
require.True(t, ok, "state lookup must stay deferred")
require.Equal(t, "!terraform.state", account.Tag)
require.Equal(t, "!env FIELD_BUCKET", backend["workspace_key_prefix"], "ordinary strings must retain explicit-tag policy")
require.Equal(t, "default-value", backend["fallback"])
// Explicit auth disable still bypasses any configured identity selection.
loaded, context, err := InitConfigAndAuth("probe", "dev", cfg.IdentityFlagDisabledValue, false, false)
require.NoError(t, err)
require.Nil(t, context)
// Config initialization intentionally does not load stacks; the production
// callback must still perform its own stack discovery before evaluation.
resolved, err := createDescribeComponentFunc(loaded, nil)("probe", "dev")
require.NoError(t, err)
require.Equal(t, "component-bucket", resolved["backend"].(map[string]any)["bucket"])
}

func TestBackendEnvironmentRejectsMalformedTag(t *testing.T) {
config := map[string]any{"backend": map[string]any{"bucket": yamlsource.Source{Tag: "!env"}.Encode()}}
_, err := resolveBackendEnvironment(&schema.AtmosConfiguration{}, config, "probe", "dev")
require.ErrorIs(t, err, u.ErrInvalidAtmosYAMLFunction)
}

var _ = schema.ConfigAndStacksInfo{ComponentEnvSection: nil}
7 changes: 4 additions & 3 deletions cmd/terraform/backend/backend_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ var deleteCmd = &cobra.Command{
Short: "Delete backend infrastructure",
Long: `Permanently delete backend infrastructure.

Requires the --force flag for safety. The backend must be empty
(no state files) before it can be deleted.`,
Requires --force even when the backend is empty. With --force, stored state
and other backend contents are permanently deleted before the backend is removed.
Back up any state you need before forcing deletion.`,
Example: ` atmos terraform backend delete vpc --stack dev --force`,
// Args validator is auto-set by parser via SetPositionalArgs with prompt-aware validation.
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -71,7 +72,7 @@ func init() {
deleteParser = flags.NewStandardParser(
flags.WithStackFlag(),
flags.WithIdentityFlag(),
flags.WithBoolFlag("force", "", false, "Force deletion without confirmation"),
flags.WithBoolFlag("force", "", false, "Delete backend contents, including stored Terraform state, before deleting the backend"),
flags.WithEnvVars("force", "ATMOS_FORCE"),
// Enable prompting for missing stack flag.
flags.WithCompletionPrompt("stack", "Choose a stack", shared.StackFlagCompletion),
Expand Down
Loading
Loading