Skip to content

v1.222.0-rc.2

Pre-release
Pre-release

Choose a tag to compare

@cloudposse-releaser cloudposse-releaser released this 17 Jun 02:14
· 1 commit to main since this release
3a070ff

🚀 Enhancements

refactor(utils): drop dead helpers and hand-rolled SliceContainsString Erik Osterman (Cloud Posse) (@osterman) (#2608) ## what
  • Replace the hand-rolled SliceContainsString / SliceContainsStringHasPrefix / SliceContainsStringStartsWith helpers with stdlib slices.Contains / slices.ContainsFunc across ~39 call sites, and remove the helpers from pkg/utils.
  • Delete nine dead exported functions that had zero callers anywhere: ExtractAtmosConfig, GetGitHubRepoReleases, GetGitHubReleaseByTag, GetGitHubLatestRelease, PrintAsHcl, NewHighlightWriter (plus the now-orphaned HighlightWriter type/method), GetAtmosConfigJSON, PrintAsJSONToFileDescriptor, and PrintAsYAMLWithConfig — including the now-empty config_utils.go and cascaded-unused imports/aliases.
  • Convert two depends_on dynamic errors in stack_utils.go to wrapped static errors (ErrDependencyResolution); their messages now carry a dependency resolution failed: prefix.

why

  • First step in dismantling pkg/utils, one of the repo's historical "dumping grounds" — CLAUDE.md already forbids adding to it, so this begins draining it.
  • slices.Contains is the identical O(n) scan as the deleted helper (the hot path in yaml_utils.go already uses an O(1) map), so there is no behavior or performance change from the swap; it also drops a per-call perf.Track defer.
  • The static-error conversion satisfies the err113 lint gate after a flagged if/else chain was restructured into early returns, and aligns with the mandatory static-error policy.

references

  • Internal cleanup; no issue. Follow-up PRs will relocate the remaining pkg/utils files into purpose-built packages (pkg/yaml, pkg/filesystem, pkg/data, etc.).

Summary by CodeRabbit

Release Notes

  • Refactor

    • Updated internal string-slice membership checks to use Go’s standard library for consistency across Terraform and YAML/tag processing.
    • Removed deprecated command wrapper entry points and other unused internal helpers to simplify the command surface area.
  • Bug Fixes

    • Improved CI step-summary rendering to respect GitHub Actions output size limits, preventing overly large “Changed/Failed Components” sections.
  • Tests

    • Added coverage for deploy/apply/plan auto-approve handling and vendor tag/component validation.
fix(terraform): restore init + workspace in terraform shell, add --skip-init Erik Osterman (Cloud Posse) (@osterman) (#2616) ## what
  • Restore terraform init and Terraform workspace select/new to atmos terraform shell so the interactive shell again starts in an initialized component and the correct workspace (not default).
  • Extract a provisioner-free executeTerraformInitCommand from executeTerraformInitPhase so the shell can run init without re-firing the before.terraform.init provisioners it already runs (no double execution). Main ExecuteTerraform pipeline behavior is unchanged.
  • The shell now resolves the terraform/tofu binary (and toolchain), generates backend/provider-override files, and assembles the full component environment before launching — matching the shared pipeline.
  • Add a --skip-init opt-out to atmos terraform shell (reuses the existing terraform flag; no new flag definition). Workspace selection stays governed by workspaces_enabled.
  • Add regression tests for the init → workspace → shell ordering, the --skip-init decoupling, and the shell's shouldRunTerraformInit/shouldSkipWorkspaceSetup contract; document --skip-init in the command docs.

why

  • This was an accidental regression introduced in v1.202.0 by #1813, which migrated terraform shell to a standalone ExecuteTerraformShell and silently dropped the init + workspace steps that the shared ExecuteTerraform pipeline used to run.
  • The result contradicted the published docs (which promise the command generates a backend file and creates the component's workspace) and forced users to pin old versions.
  • --with-secrets behavior is preserved: secrets are still kept out of the on-disk varfile and withheld from the shell unless explicitly requested.

references

  • Regression introduced in #1813 (first released in v1.202.0).

Summary by CodeRabbit

  • New Features
    • Added --skip-init flag to terraform shell, allowing you to start the interactive shell without running terraform init. You can also set it via ATMOS_SKIP_INIT. Workspace selection behavior remains governed by existing workspaces_enabled rules.
  • Documentation
    • Updated terraform shell command docs to describe the new --skip-init option, including how it interacts with workspace selection and how to use ATMOS_SKIP_INIT.
fix(templates): honor ignore_missing_template_values for stack name_template (#2345) Andriy Knysh (@aknysh) (#2619) ## what
  • Route the global templates.settings.ignore_missing_template_values flag into every stack name_template rendering site. Previously all 11 name-template ProcessTmpl(...) call sites passed a hardcoded false, so the flag was silently ignored for name-template rendering.
  • Sites updated: atlantis stack name, EKS cluster name, spacelift admin/stack name (describe affected), describe locals name, spacelift utils, terraform workspace, terraform generate backends/varfiles, the shared name-template util, and validate stacks.
  • Add TestBuildTerraformWorkspace_IgnoreMissingTemplateValues asserting both directions (flag off → error; flag on → <no value>).
  • Incidental cleanup: gofumpt reformatting two adjacent pre-existing fmt.Errorf calls in stack_utils.go - err113 debt under golangci-lint --new-from-rev=origin/main. Converted them to the mandated static-wrapped-error pattern (new sentinels ErrInvalidDependsOn / ErrInvalidSettingsDependsOn in errors/errors.go) with tests covering both resolution branches and the errors.Is behavior.

why

  • When a user sets templates.settings.ignore_missing_template_values: true, they still hit hard errors like map has no entry for key "..." whenever the error originated from rendering the stack name_template — because the name-template ProcessTmpl sites bypassed the flag.
  • The fix is behavior-preserving: the flag defaults to false, so existing configurations render exactly as before; behavior only changes for users who explicitly opt in.
  • The err113 conversion follows the repository's mandated static-error pattern and keeps the pre-commit/CI lint green; messages are unchanged.

references

  • Closes #2345
  • Fix doc: docs/fixes/2026-06-15-name-template-ignore-missing-template-values.md

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Updated template rendering to consistently honor ignore_missing_template_values across stack- and dependency-related name derivations (including Terraform workspace and generated stack naming).
    • Added clearer error handling for invalid depends_on inputs via dedicated sentinel errors.
  • Tests

    • Added regression tests covering enabled/disabled ignore_missing_template_values behavior and dependency resolution success/failure.
  • Documentation

    • Added a documentation page explaining the corrected ignore_missing_template_values behavior for stack name template rendering.