Skip to content

fix(flags): scope --skip-hooks to the terraform command subtree - #2578

Merged
Andriy Knysh (aknysh) merged 12 commits into
mainfrom
osterman/raleigh-v7
Jun 14, 2026
Merged

Andriy Knysh (aknysh) merged 12 commits into
mainfrom
osterman/raleigh-v7

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

what

  • Scope --skip-hooks to the terraform command subtree. The flag (and ATMOS_SKIP_HOOKS) moved off the global flag set onto atmos terraform and its subcommands, so it no longer appears in the help of unrelated commands (auth, helmfile, atlantis, toolchain, about, secret, …). Lifecycle hooks only ever run on terraform plan/apply/deploy.
  • Stop tracking native-ci CI scratch output. tests/fixtures/scenarios/native-ci/{github-output,github-step-summary}.txt are runtime artifacts; gitignored and untracked (matching the newer native-ci-gha-plan scenario).
  • Standardize the CLI test suite on OpenTofu. The suite forces ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu via a single test-harness default, gates every binary-invoking test on a precondition so a missing binary skips cleanly (instead of baking "executable file not found" into goldens), and sanitizes the harness-injected env var out of debug snapshots. A small parity set (terraform -help/-version passthrough) opts back into terraform.
  • Provision test tooling via the Atmos toolchain (dogfooding). TestMain installs any missing pinned binary (terraform/tofu/packer/helmfile/helm) through the Atmos toolchain itself and prepends it to PATH — "install as necessary", so CI (which supplies them via setup-* actions) downloads nothing while local runs become self-contained. No host binaries (brew, etc.) required.

why

  • --skip-hooks on every command was misleading — hooks only run on terraform. Mirrors the existing --github-token/toolchain scoping precedent.
  • The native-ci scratch files were tracked, so every local run without terraform dirtied them. They're CI artifacts, not fixtures.
  • Test runs depended on whatever terraform/tofu binary was on the host; a missing binary silently corrupted golden snapshots and tracked fixtures. Standardizing on a single, license-clean (MPL) OpenTofu — with explicit preconditions — makes the suite deterministic and host-independent. The product runtime default stays terraform; only tests change.
  • Provisioning tools through the toolchain dogfoods the feature and removes the dependency on host-installed binaries, so the suite runs the same way everywhere.

references

  • Follows the --github-token/toolchain flag-scoping precedent in pkg/flags/global_builder.go.

Lifecycle hooks only ever run on terraform plan/apply/deploy, yet
--skip-hooks was registered as a global persistent flag on RootCmd, so
it leaked into the Global Flags section of nearly every command's help
(auth, helmfile, atlantis, toolchain, about, secret, validate, ...).

Move the flag from the global flag set to the terraform persistent-flag
registry, following the --github-token/toolchain precedent. Behavior is
unchanged for terraform users: the flag (and ATMOS_SKIP_HOOKS) still
resolve through viper exactly as before, since terraformParser is
already registered persistently and bound to viper.

- Remove the global registration in pkg/flags/global_builder.go.
- Drop the now-unused SkipHooks field in pkg/flags/global/flags.go.
- Register --skip-hooks in cmd/terraform/flags.go (registerExecutionFlags).
- Move docs from global-flags.mdx into the terraform command docs and
  fix the cross-links in stacks/hooks.mdx.
- Regenerate affected --help golden snapshots.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@atmos-pro

atmos-pro Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@osterman Erik Osterman (Cloud Posse) (osterman) added the patch A minor, backward compatible change label Jun 6, 2026
@github-actions github-actions Bot added the size/m Medium size PR label Jun 6, 2026
@github-actions

github-actions Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 97156505-e286-4740-8c7c-44b3668bfd84

📥 Commits

Reviewing files that changed from the base of the PR and between cf78e23 and 37a88d3.

📒 Files selected for processing (5)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
  • tests/snapshots/TestCLICommands_config_alias_tr_--help_shows_terraform_help.stdout.golden
  • tests/snapshots/TestCLICommands_terraform_help_shows_stack_flag.stdout.golden
✅ Files skipped from review due to trivial changes (3)
  • tests/snapshots/TestCLICommands_terraform_help_shows_stack_flag.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
  • tests/snapshots/TestCLICommands_config_alias_tr_--help_shows_terraform_help.stdout.golden

📝 Walkthrough

Walkthrough

--skip-hooks is moved from the global Flags struct into the atmos terraform command's flag set, with ATMOS_SKIP_HOOKS env var and NoOptDefVal="*" support. Global flag docs and snapshots are updated accordingly. The test harness gains automated toolchain provisioning (tofu/terraform/packer/helmfile/helm), a RequireTofu precondition, and defaults ATMOS_COMPONENTS_TERRAFORM_COMMAND to tofu across fixtures.

Changes

Terraform CLI flag scope and test toolchain

Layer / File(s) Summary
Flag registration relocation
cmd/terraform/flags.go, pkg/flags/global/flags.go, pkg/flags/global_builder.go
Registers --skip-hooks (with ATMOS_SKIP_HOOKS env var and NoOptDefVal="*") on the terraform command, removes SkipHooks from the global Flags struct, and updates builder comments to reflect the change.
Documentation updates
website/docs/cli/commands/terraform/usage.mdx, website/docs/cli/global-flags.mdx, website/docs/stacks/hooks.mdx
Adds --skip-hooks docs under terraform command usage with examples and env var info, removes it from global flags and env var reference, and updates hooks docs to point to terraform command scope.
CLI help snapshots: global flag removal
tests/snapshots/TestCLICommands_atmos_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_auth_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_atlantis_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_helmfile_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_toolchain_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_validate_*.stdout.golden, and others
Removes --skip-hooks from global flag listings across all non-terraform help snapshots, with surrounding flags adjusted for proper ordering.
CLI help snapshots: terraform command relocation
tests/snapshots/TestCLICommands_atmos_terraform_*.stdout.golden, tests/snapshots/TestCLICommands_config_alias_tr_*.stdout.golden, tests/snapshots/TestCLICommands_terraform_help_*.stdout.golden
Adds/relocates --skip-hooks into terraform command-specific FLAGS sections with updated multi-line wrapping and usage forms.
Test harness and toolchain provisioning
tests/testhelpers/toolchain.go, tests/preconditions.go, tests/cli_test.go
Adds Tool, DefaultTools, and ProvisionToolchain to provision binaries at suite startup; adds RequireTofu precondition; extends checkPreconditions dispatch; defaults ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu; strips injected ENV debug log lines from sanitized output.
Test precondition gates and fixture cleanup
tests/test-cases/atmos-functions.yaml, tests/test-cases/env.yaml, tests/test-cases/exec-command.yaml, tests/test-cases/help-and-usage.yaml, tests/test-cases/metadata.yaml, tests/test-cases/native-ci-gha-plan.yaml, tests/test-cases/native-ci-planfile.yaml, tests/test-cases/secrets-masking.yaml, tests/test-cases/workflows.yaml, tests/fixtures/scenarios/native-ci/.gitignore, tests/fixtures/scenarios/native-ci/github-output.txt, tests/fixtures/scenarios/native-ci/github-step-summary.txt
Adds preconditions: ["tofu"] to terraform-related test cases, pins two passthrough tests to real terraform binary, clears native-ci fixture output files, and gitignores those scratch files.
Snapshots: tofu as default command
tests/snapshots/TestCLICommands_atmos_describe_*.stdout.golden, tests/snapshots/TestCLICommands_describe_component_*.stdout.golden, tests/snapshots/TestCLICommands_atmos_stacks_*.stdout.golden, tests/snapshots/TestCLICommands_indentation.stdout.golden, tests/snapshots/TestCLICommands_secrets-masking_*.stdout.golden
Updates components.terraform.command from "terraform" or "" to "tofu" across describe-component, describe-config, stacks, and secrets-masking snapshots.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • cloudposse/atmos#2574: Extends the hook skipping behavior by updating resolveSkipHooks to honor the relocated --skip-hooks flag value for before-* and after-* lifecycle events.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: scoping the --skip-hooks flag to the terraform command subtree instead of being global.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/raleigh-v7

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
@codecov

codecov Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.21%. Comparing base (e4f6a0e) to head (37a88d3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2578      +/-   ##
==========================================
+ Coverage   79.17%   79.21%   +0.03%     
==========================================
  Files        1298     1298              
  Lines      123772   123780       +8     
==========================================
+ Hits        98000    98048      +48     
+ Misses      20290    20253      -37     
+ Partials     5482     5479       -3     
Flag Coverage Δ
unittests 79.21% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/terraform/flags.go 100.00% <100.00%> (ø)
pkg/flags/global/flags.go 100.00% <ø> (ø)
pkg/flags/global_builder.go 100.00% <ø> (ø)
tests/preconditions.go 63.04% <100.00%> (+0.40%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The native-ci scenario writes github-output.txt and github-step-summary.txt
at runtime via $GITHUB_OUTPUT / $GITHUB_STEP_SUMMARY, but its .gitignore
(unlike the newer native-ci-gha-plan scenario) did not ignore them, so the
files were tracked and every local run dirtied them — including baking in
"terraform: executable file not found" when terraform was absent.

Ignore both files (matching native-ci-gha-plan/.gitignore) and untrack them.
They are runtime artifacts, not fixtures.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
The CLI integration/snapshot tests shelled out to whatever terraform/tofu
binary happened to be on the host (fixtures default to command: terraform).
When the binary was absent, terraform-invoking tests baked
"executable file not found" into golden snapshots and CI scratch files.

Standardize the suite on OpenTofu and make the binary requirement explicit:

- Force OpenTofu for all tests via a single harness default in
  runCLICommandTest: set ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu unless the
  test already sets it. The product default stays "terraform"; this only
  affects tests. Tests that specifically exercise the terraform binary (the
  `atmos terraform -help/-version passthrough` parity tests) opt out by
  setting the var to "terraform" in their own env block.
- Sanitize the harness-injected env var out of debug-level snapshots
  ("Found ENV variable ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu") so it never
  lands in goldens and the selection mechanism stays invisible to output.
- Gate every binary-invoking test on a precondition (`tofu`, or `terraform`
  for the opt-out parity tests) so a missing binary SKIPS cleanly instead of
  contaminating goldens/scratch files. Add RequireTofu and register the
  `tofu` / `terraform_or_tofu` preconditions.
- Regenerate the affected describe/config/stacks goldens (command: tofu).

CI installs both terraform and tofu and bypasses preconditions, so coverage
is unchanged there.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/test-cases/exec-command.yaml (1)

41-59: ⚠️ Potential issue | 🟡 Minor

Add tofu precondition to test 3 (exec-command exit-code 1)

  • tests/cli_test.go forces ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu for this suite, so this failing-apply case will try to run tofu even though the args say terraform; without preconditions: ["tofu"], it won’t skip when tofu isn’t installed (while tests (0) and (2) already do).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test-cases/exec-command.yaml` around lines 41 - 59, The test "atmos
exit code should be same as command exit code (1)" is missing the tofu
precondition so the suite-wide forced ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu
causes this failing-apply case to attempt running `tofu` instead of skipping;
add preconditions: ["tofu"] to that test block (the test named exactly "atmos
exit code should be same as command exit code (1)" in
tests/test-cases/exec-command.yaml) so it will be skipped when `tofu` is not
installed and behave like the other suites that already include this
precondition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/test-cases/exec-command.yaml`:
- Around line 41-59: The test "atmos exit code should be same as command exit
code (1)" is missing the tofu precondition so the suite-wide forced
ATMOS_COMPONENTS_TERRAFORM_COMMAND=tofu causes this failing-apply case to
attempt running `tofu` instead of skipping; add preconditions: ["tofu"] to that
test block (the test named exactly "atmos exit code should be same as command
exit code (1)" in tests/test-cases/exec-command.yaml) so it will be skipped when
`tofu` is not installed and behave like the other suites that already include
this precondition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c33a444d-e66b-4b5e-843d-c5b70d1efef5

📥 Commits

Reviewing files that changed from the base of the PR and between d7b97f4 and a36e00d.

📒 Files selected for processing (30)
  • tests/cli_test.go
  • tests/preconditions.go
  • tests/snapshots/TestCLICommands_atmos_--chdir_config_isolation.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_dev_(stack-names_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_production_(stack-names_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_dev_(native-terraform_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_production_(native-terraform_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_stacks_with_relative_paths.stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_component_name_(backward_compatibility).stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_current_directory_(.).stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_relative_path.stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_stack_flag.stdout.golden
  • tests/snapshots/TestCLICommands_indentation.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_stacks.stdout.golden
  • tests/test-cases/atmos-functions.yaml
  • tests/test-cases/env.yaml
  • tests/test-cases/exec-command.yaml
  • tests/test-cases/help-and-usage.yaml
  • tests/test-cases/metadata.yaml
  • tests/test-cases/native-ci-gha-plan.yaml
  • tests/test-cases/native-ci-planfile.yaml
  • tests/test-cases/secrets-masking.yaml
  • tests/test-cases/workflows.yaml
✅ Files skipped from review due to trivial changes (12)
  • tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
  • tests/snapshots/TestCLICommands_indentation.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_production_(native-terraform_example).stdout.golden
  • tests/test-cases/env.yaml
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_component_name_(backward_compatibility).stdout.golden
  • tests/test-cases/native-ci-gha-plan.yaml
  • tests/snapshots/TestCLICommands_atmos_stacks_with_relative_paths.stdout.golden
  • tests/snapshots/TestCLICommands_describe_component_with_stack_flag.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_production_(stack-names_example).stdout.golden

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
…lchain

The CLI test suite shelled out to host-installed binaries (brew,
setup-* GitHub Actions). Dogfood the toolchain instead: TestMain now
provisions any missing tool via the Atmos toolchain itself.

- Add testhelpers.ProvisionToolchain: for each pinned tool
  (terraform/tofu/packer/helmfile/helm) not already on PATH, install it
  via dependencies.NewEnvironmentFromDeps into a stable, shared cache dir
  and prepend the toolchain bin dirs to PATH. "Install as necessary":
  in CI the setup-* actions already supply the binaries, so nothing
  downloads there; locally (no host binaries) the toolchain installs them.
- Call it from TestMain before running tests. Best-effort: on failure
  (offline / rate limits) it logs a warning and returns, leaving the
  per-test preconditions to skip the affected tests.
- ATMOS_TEST_SKIP_TOOL_PROVISION=true opts out.

Pinned versions match .github/workflows/test.yml.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
The `atmos terraform plan with github actions env` test asserted
has_changes=false / "No Changes for", but it runs `atmos terraform plan
mycomponent -s prod`, and `mycomponent` always creates one null_resource ->
has_changes=true / "Resource Changes Found". It only passed because the now-
untracked github-output.txt / github-step-summary.txt scratch files were
previously committed with stale content containing those substrings, and
file_contains is a substring check. Commit d7b97f4 correctly untracked those
runtime artifacts, exposing the false positive in a clean CI checkout (where
the files don't exist and the run writes only the real single-run output).

Fix the assertions to the truthful output (verified against a real tofu plan
and the CI failure log): has_changes=true and "Resource Changes Found for".

Co-Authored-By: Claude Opus 4.8 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
The Codecov upload step fails on the linux Acceptance Tests job (repo-wide,
all branches): the default cli.codecov.io installer fetches Codecov's GPG
public key from Keybase to verify the downloaded binary, but that key is
currently 404'ing ("SELF-SIGNED PUBLIC KEY NOT FOUND"), so verification fails
with "gpg: Can't check signature: No public key" and the upload exits 1 under
fail_ci_if_error: true.

Set use_pypi: true so the Codecov CLI is installed from PyPI, which skips the
Keybase key fetch and signature check. See codecov/codecov-action#1955. Safe
to remove once Codecov restores the key.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Line 77: The workflow uses floating GitHub Action tags (e.g.,
actions/setup-go@v6, actions/upload-artifact@v4, actions/download-artifact@v8,
hashicorp/setup-terraform@v4, opentofu/setup-opentofu@v2,
codecov/codecov-action@v7, azure/setup-helm@v4, reviewdog/action-tflint@v1,
InoUno/[email protected]) which can drift; replace each floating ref with the
corresponding pinned full commit SHA for every `uses:` entry (all occurrences of
those refs in the file) so the workflow refers to an immutable commit, updating
each `uses:` line to use the exact commit SHA for that action and keeping the
rest of the step intact.
- Around line 77-80: The workflow uses actions/setup-go@v6 with its default
caching enabled for PR runs; update the setup step that references
actions/setup-go@v6 (the step with id "go") to explicitly disable cache by
adding `cache: false` (or wrap cache usage behind a trusted-event condition so
PRs don't use the cache), and apply the same change to the other setup-go
occurrences referenced in the file (the block around lines 203-209) so PR
workflows will not use the setup-go cache.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 00b51c54-784f-448b-9a02-66cc24a1702f

📥 Commits

Reviewing files that changed from the base of the PR and between 7652b10 and 22f1181.

📒 Files selected for processing (13)
  • .github/workflows/test.yml
  • tests/cli_test.go
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_dev_(stack-names_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_production_(stack-names_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_dev_(native-terraform_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_production_(native-terraform_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_stacks.stdout.golden
  • tests/test-cases/native-ci-planfile.yaml
  • website/docs/stacks/hooks.mdx
✅ Files skipped from review due to trivial changes (6)
  • tests/snapshots/TestCLICommands_secrets-masking_describe_config.stdout.golden
  • tests/snapshots/TestCLICommands_secrets-masking_describe_stacks.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_dev_(native-terraform_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_dev_(stack-names_example).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_production_(native-terraform_example).stdout.golden
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/test-cases/native-ci-planfile.yaml
  • tests/snapshots/TestCLICommands_atmos_describe_component_mock_-s_production_(stack-names_example).stdout.golden
  • website/docs/stacks/hooks.mdx
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/cli_test.go
🛑 Comments failed to post (2)
.github/workflows/test.yml (2)

77-77: ⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify unpinned action refs in workflow files
rg -nP '^\s*uses:\s*[^@]+@v[0-9]+' .github/workflows

Repository: cloudposse/atmos

Length of output: 3983


Pin GitHub Action refs to commit SHAs (no floating @v* tags) in .github/workflows/test.yml.

Several uses: entries still use floating tags, e.g.:

  • actions/setup-go@v6 (lines 77, 205)
  • actions/upload-artifact@v4 (line 98)
  • actions/download-artifact@v8 (lines 133, 356, 420, 500)
  • hashicorp/setup-terraform@v4 (lines 156, 370, 519, 599)
  • opentofu/setup-opentofu@v2 (lines 163, 376, 526, 605)
  • codecov/codecov-action@v7 (line 257)
  • azure/setup-helm@v4 (line 435)
  • reviewdog/action-tflint@v1 (line 611)
  • InoUno/[email protected] (line 647)

Pin each to a full commit SHA to prevent CI supply-chain drift.

🧰 Tools
🪛 zizmor (1.25.2)

[error] 77-77: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 77-77: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default

(cache-poisoning)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml at line 77, The workflow uses floating GitHub
Action tags (e.g., actions/setup-go@v6, actions/upload-artifact@v4,
actions/download-artifact@v8, hashicorp/setup-terraform@v4,
opentofu/setup-opentofu@v2, codecov/codecov-action@v7, azure/setup-helm@v4,
reviewdog/action-tflint@v1, InoUno/[email protected]) which can drift;
replace each floating ref with the corresponding pinned full commit SHA for
every `uses:` entry (all occurrences of those refs in the file) so the workflow
refers to an immutable commit, updating each `uses:` line to use the exact
commit SHA for that action and keeping the rest of the step intact.

Source: Linters/SAST tools


77-80: ⚠️ Potential issue | 🟠 Major

Disable actions/setup-go cache for PR runs.

actions/setup-go@v6 has caching enabled by default; in .github/workflows/test.yml the pull_request workflow uses it without a cache: setting. Set cache: false (or enable cache only for trusted events).

Suggested patch
       - name: Set up Go
         uses: actions/setup-go@v6
         with:
           go-version-file: "go.mod"
+          cache: false
         id: go

Also applies to: 203-209

🧰 Tools
🪛 zizmor (1.25.2)

[error] 77-77: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 77-77: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default

(cache-poisoning)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml around lines 77 - 80, The workflow uses
actions/setup-go@v6 with its default caching enabled for PR runs; update the
setup step that references actions/setup-go@v6 (the step with id "go") to
explicitly disable cache by adding `cache: false` (or wrap cache usage behind a
trusted-event condition so PRs don't use the cache), and apply the same change
to the other setup-go occurrences referenced in the file (the block around lines
203-209) so PR workflows will not use the setup-go cache.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 14, 2026
@mergify

mergify Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label Jun 14, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 14, 2026
@mergify

mergify Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label Jun 14, 2026
# Conflicts:
#	tests/fixtures/scenarios/native-ci/github-output.txt
#	tests/fixtures/scenarios/native-ci/github-step-summary.txt
@aknysh
Andriy Knysh (aknysh) merged commit 6a90ec1 into main Jun 14, 2026
59 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the osterman/raleigh-v7 branch June 14, 2026 23:39
@atmos-pro

atmos-pro Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@mergify mergify Bot removed the needs-cloudposse Needs Cloud Posse assistance label Jun 14, 2026
@github-actions

Copy link
Copy Markdown

These changes were released in v1.222.0-rc.0.

This branch was successfully deployed

1 active deployment
preview — 37a88d36 Deployed Jun 14, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants