Skip to content

Add CLI flags to atmos terraform commands to control processing the templates and YAML functions in Atmos stack manifests#1157

Merged
aknysh merged 22 commits intomainfrom
add-terraform-flags
Mar 20, 2025
Merged

Add CLI flags to atmos terraform commands to control processing the templates and YAML functions in Atmos stack manifests#1157
aknysh merged 22 commits intomainfrom
add-terraform-flags

Conversation

@aknysh
Copy link
Member

@aknysh aknysh commented Mar 18, 2025

what

  • Add CLI flags to atmos terraform commands to control processing (enable/disable) the templates and YAML functions in Atmos stack manifests
  • Add unit tests
  • Update docs

why

Flag Description Alias Required
--process-templates Enable/disable Go template processing in Atmos stack manifests
when executing terraform commands.
atmos terraform plan <component> -s <stack> --process-templates=false.
If the flag is not passed,
template procesing is enabled by default.
no
--process-functions Enable/disable YAML functions processing in Atmos stack manifests
when executing terraform commands.
atmos terraform apply <component> -s <stack> --process-functions=false
If the flag is not passed,
functions procesing is enabled by default.
no
--skip Skip processing a specific Atmos YAML function
in Atmos stacks manifests when executing terraform commands.
To specify more than one function,
use multiple --skip flags, or separate the functions with a comma:
atmos terraform plan <component> -s <stack> --skip=eval --skip=include
atmos terraform apply <component> -s <stack> --skip=terraform.output,include
no

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new command-line options for enhanced control over Terraform executions, allowing users to enable/disable template and YAML function processing and skip specific functions.
    • Added new YAML configuration files for deployment settings and non-production environments.
  • Documentation

    • Updated help and usage guides for Terraform commands with clearer flag descriptions and improved instructions.
    • Restructured documentation format for various Terraform commands to enhance clarity and usability.
  • Chores

    • Upgraded Atmos tool versions in container builds and CI integrations.
    • Updated various dependency versions to enhance overall stability and performance.

@aknysh aknysh added the minor New features that do not break anything label Mar 18, 2025
@aknysh aknysh self-assigned this Mar 18, 2025
@aknysh aknysh requested a review from a team as a code owner March 18, 2025 17:44
@mergify
Copy link

mergify bot commented Mar 18, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Mar 18, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

📝 Walkthrough

Walkthrough

This pull request removes detailed base_path comments from the atmos.yaml file and adds a suite of new command-line flags (--process-templates, --process-functions, and --skip) across multiple Terraform command implementations. The changes update flag processing in CLI command functions (in cmd/ and internal/exec/), adjust dependency versions in go.mod and ATMOS_VERSION in Dockerfile and documentation, and add corresponding constants and struct fields. Documentation for various Terraform commands is updated to reflect the new flags.

Changes

File(s) Change Summary
atmos.yaml Removed detailed base_path configuration comments.
cmd/terraform.go, cmd/terraform_commands.go Added new flags (--process-templates, --process-functions, --skip) and updated flag descriptions for Terraform command processing.
internal/exec/terraform.go, internal/exec/terraform_generate_backend.go, internal/exec/terraform_generate_varfile.go, internal/exec/utils.go Modified functions to directly use new flag values and updated parameter passing to ProcessStacks; expanded common flags list.
pkg/config/const.go, pkg/schema/schema.go Introduced new constants and struct fields (ProcessTemplates, ProcessFunctions, Skip) to support the new options.
examples/quick-start-advanced/Dockerfile, website/docs/integrations/atlantis.mdx Upgraded ATMOS_VERSION from 1.165.3 to 1.167.0.
go.mod Updated several dependency versions and added new indirect dependencies.
website/docs/cli/commands/terraform/*.mdx, website/docs/cli/commands/terraform/usage.mdx Updated documentation to reflect new flags and enhanced flag descriptions for Terraform commands.

Possibly related PRs


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c3409d and 0426693.

📒 Files selected for processing (1)
  • cmd/terraform.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/terraform.go
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Acceptance Tests (macos-latest, macos)
  • GitHub Check: Acceptance Tests (windows-latest, windows)
  • GitHub Check: Acceptance Tests (ubuntu-latest, linux)
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Summary

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
website/docs/cli/commands/terraform/usage.mdx (3)

156-156: Typographical Issue in --process-templates Flag Description

There is a small typo: "template procesing" should be spelled as "template processing" so it aligns with standard spelling.


157-157: Typographical Issue in --process-functions Flag Description

The phrase "functions procesing" is misspelled. Please update it to "functions processing" for clarity and consistency.


158-158: Formatting Issue in --skip Flag Row

The table row for the --skip flag appears to include extra columns, which might break the markdown table rendering. Additionally, note the minor inconsistency: previous rows refer to "Atmos stack manifests" while this row uses "Atmos stacks manifests". It would be best to standardize this phrasing.

Below is a suggested diff to fix these issues:

-| `--skip`              | Skip processing a specific Atmos YAML function<br/>in Atmos stacks manifests when executing terraform commands.<br/>To specify more than one function,<br/>use multiple `--skip` flags, or separate the functions with a comma:<br/>`atmos terraform plan <component> -s <stack> --skip=eval --skip=include`<br/>`atmos terraform apply <component> -s <stack> --skip=terraform.output,include` |       | no       |                                                 |       | no       |
+| `--skip`              | Skip processing a specific Atmos YAML function<br/>in Atmos stack manifests when executing terraform commands.<br/>To specify more than one function, use multiple `--skip` flags or a comma-separated list (e.g., `--skip=eval,include`). |       | no       |
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03ac289 and 81035aa.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (18)
  • atmos.yaml (0 hunks)
  • cmd/terraform.go (1 hunks)
  • cmd/terraform_commands.go (1 hunks)
  • examples/quick-start-advanced/Dockerfile (1 hunks)
  • go.mod (11 hunks)
  • internal/exec/terraform.go (1 hunks)
  • internal/exec/terraform_generate_backend.go (2 hunks)
  • internal/exec/terraform_generate_varfile.go (2 hunks)
  • internal/exec/utils.go (1 hunks)
  • pkg/config/const.go (1 hunks)
  • pkg/schema/schema.go (1 hunks)
  • website/docs/cli/commands/terraform/terraform-deploy.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-shell.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-workspace.mdx (1 hunks)
  • website/docs/cli/commands/terraform/usage.mdx (1 hunks)
  • website/docs/integrations/atlantis.mdx (1 hunks)
💤 Files with no reviewable changes (1)
  • atmos.yaml
🧰 Additional context used
🧠 Learnings (1)
examples/quick-start-advanced/Dockerfile (2)
Learnt from: aknysh
PR: cloudposse/atmos#775
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.426Z
Learning: It is acceptable to set `ARG ATMOS_VERSION` to a future version like `1.105.0` in `examples/quick-start-advanced/Dockerfile` if that will be the next release.
Learnt from: osterman
PR: cloudposse/atmos#801
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.425Z
Learning: When updating the `ATMOS_VERSION` in Dockerfiles, the team prefers to pin to the next future version when the PR merges, even if the version is not yet released.
🧬 Code Definitions (5)
internal/exec/utils.go (1)
pkg/config/const.go (3) (3)
  • ProcessTemplatesFlag (73:73)
  • ProcessFunctionsFlag (74:74)
  • SkipFlag (75:75)
internal/exec/terraform_generate_varfile.go (15)
internal/exec/validate_component.go (1) (1)
  • err (119:119)
internal/exec/validate_stacks.go (1) (1)
  • err (221:221)
cmd/cmd_utils.go (1) (1)
  • err (307:307)
internal/exec/atlantis_generate_repo_config.go (1) (1)
  • err (154:154)
internal/exec/vendor_utils.go (1) (1)
  • err (182:182)
internal/exec/aws_eks_update_kubeconfig.go (3) (3)
  • err (127:127)
  • err (155:155)
  • atmosConfig (126:126)
internal/exec/describe_affected_utils.go (1) (1)
  • err (572:572)
internal/exec/terraform_outputs.go (1) (1)
  • err (70:70)
cmd/root.go (2) (2)
  • err (144:144)
  • atmosConfig (27:27)
pkg/config/config.go (2) (2)
  • err (126:126)
  • atmosConfig (125:125)
cmd/docs.go (1) (1)
  • err (119:119)
internal/exec/workflow_utils.go (1) (1)
  • err (73:73)
cmd/completion.go (1) (1)
  • err (20:20)
pkg/spacelift/spacelift_stack_processor.go (1) (1)
  • err (96:96)
internal/exec/utils.go (2) (2)
  • info (649:649)
  • ProcessStacks (283:642)
cmd/terraform.go (1)
internal/exec/terraform.go (1) (1)
  • ExecuteTerraform (39:505)
internal/exec/terraform.go (15)
internal/exec/utils.go (2) (2)
  • info (649:649)
  • ProcessStacks (283:642)
pkg/utils/file_utils.go (1) (1)
  • err (296:296)
internal/exec/stack_utils.go (1) (1)
  • err (23:23)
pkg/config/config.go (2) (2)
  • err (126:126)
  • atmosConfig (125:125)
pkg/spacelift/spacelift_stack_processor.go (1) (1)
  • err (96:96)
internal/exec/validate_component.go (1) (1)
  • err (119:119)
internal/exec/validate_stacks.go (1) (1)
  • err (221:221)
internal/exec/atlantis_generate_repo_config.go (1) (1)
  • err (154:154)
internal/exec/terraform_outputs.go (1) (1)
  • err (70:70)
internal/exec/vendor_utils.go (1) (1)
  • err (182:182)
internal/exec/aws_eks_update_kubeconfig.go (3) (3)
  • err (127:127)
  • err (155:155)
  • atmosConfig (126:126)
internal/exec/describe_affected_utils.go (1) (1)
  • err (572:572)
cmd/root.go (2) (2)
  • err (144:144)
  • atmosConfig (27:27)
cmd/completion.go (1) (1)
  • err (20:20)
cmd/docs.go (1) (1)
  • err (119:119)
internal/exec/terraform_generate_backend.go (16)
internal/exec/validate_component.go (1) (1)
  • err (119:119)
internal/exec/validate_stacks.go (1) (1)
  • err (221:221)
cmd/cmd_utils.go (1) (1)
  • err (307:307)
internal/exec/atlantis_generate_repo_config.go (1) (1)
  • err (154:154)
internal/exec/vendor_utils.go (1) (1)
  • err (182:182)
internal/exec/aws_eks_update_kubeconfig.go (3) (3)
  • err (127:127)
  • err (155:155)
  • atmosConfig (126:126)
internal/exec/describe_affected_utils.go (1) (1)
  • err (572:572)
pkg/config/config.go (2) (2)
  • err (126:126)
  • atmosConfig (125:125)
cmd/docs.go (1) (1)
  • err (119:119)
internal/exec/workflow_utils.go (1) (1)
  • err (73:73)
internal/exec/stack_utils.go (1) (1)
  • err (23:23)
pkg/utils/file_utils.go (1) (1)
  • err (296:296)
internal/exec/terraform_outputs.go (1) (1)
  • err (70:70)
cmd/root.go (2) (2)
  • err (144:144)
  • atmosConfig (27:27)
cmd/completion.go (1) (1)
  • err (20:20)
internal/exec/utils.go (2) (2)
  • info (649:649)
  • ProcessStacks (283:642)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: [mock-windows] tests/fixtures/scenarios/complete
  • GitHub Check: [mock-windows] examples/demo-component-versions
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Acceptance Tests (macos-latest, macos)
  • GitHub Check: Acceptance Tests (windows-latest, windows)
  • GitHub Check: Acceptance Tests (ubuntu-latest, linux)
  • GitHub Check: Summary
🔇 Additional comments (18)
go.mod (1)

6-6: Clean dependency version updates.

The dependency version updates are well-structured and help keep the project secure with latest features.

Also applies to: 23-23, 32-32, 41-41, 44-44, 59-59, 74-82, 159-159, 185-186, 269-269, 275-276, 309-309, 312-312, 315-315, 318-321

website/docs/integrations/atlantis.mdx (1)

676-676: Version bump to match future release.

Updating the Atmos version to 1.167.0 aligns with the version changes in other files.

examples/quick-start-advanced/Dockerfile (1)

9-9: Version bump consistent with project practices.

The ATMOS_VERSION update to 1.167.0 aligns with team preferences to pin to the next future version when the PR merges.

internal/exec/utils.go (1)

53-55: Adding new flags to support template and function processing control.

The addition of these three flags directly supports the PR objectives of allowing users to control the processing of templates and YAML functions in Atmos stack manifests.

pkg/schema/schema.go (1)

420-422: New fields added to ConfigAndStacksInfo are well structured.

These three new fields align properly with the PR objectives to control template and function processing. The boolean types for toggle flags and string slice for the skip list are appropriate data types.

pkg/config/const.go (1)

73-75: Command flag constants follow naming conventions.

The new flag constants are well-defined and follow the existing pattern of naming and formatting. They're positioned logically in the constants block.

cmd/terraform.go (1)

65-86: Flag handling implementation is robust.

Good implementation of flag retrieval and error handling. The code:

  1. Retrieves flag values with appropriate type conversion
  2. Properly handles errors for each flag
  3. Correctly assigns values to the corresponding info struct fields
  4. Maintains the existing error handling pattern

This implementation provides a clean way to pass the flag values to the terraform execution.

internal/exec/terraform_generate_backend.go (2)

27-40: Flag extraction follows consistent pattern.

The flag extraction code follows the same pattern as other flag retrievals in this file. Each flag has proper error handling in place.


58-58: ProcessStacks call updated to use the new parameters.

The call to ProcessStacks is correctly updated to pass the newly extracted flag values. This ensures the flags control template processing, function processing, and which functions to skip.

internal/exec/terraform_generate_varfile.go (2)

26-39: Well-implemented flag handling for template and function processing controls.

The code correctly retrieves and handles the new flags for controlling Go template processing, YAML function processing, and function skipping. Error handling follows the established pattern.


57-57: Good update to ProcessStacks function call.

The modification to the ProcessStacks function call properly passes the new flag values, replacing the previous hardcoded values with user-configurable options.

internal/exec/terraform.go (1)

63-63: Clean implementation of ProcessStacks parameter update.

The change simplifies the function call by directly using the properties from the info object instead of calculating an intermediate variable. This is more maintainable and directly reflects the user's intent from command line arguments.

website/docs/cli/commands/terraform/terraform-deploy.mdx (1)

87-96: Thorough documentation of new command flags.

The documentation clearly explains the purpose of each new flag and provides good examples for the --skip flag, showing both multiple flag usage and comma-separated values. Table formatting is clean and consistent.

website/docs/cli/commands/terraform/terraform-workspace.mdx (1)

52-58: Clear and consistent documentation for the workspace command flags.

Flag documentation matches the pattern established in other command files, providing consistent help information across the CLI. Examples for the --skip flag are particularly helpful.

website/docs/cli/commands/terraform/terraform-shell.mdx (1)

66-72: Well-documented CLI flags with clear descriptions.

The additions of --process-templates, --process-functions, and --skip flags are properly documented with detailed descriptions that clearly explain their purpose and usage. The examples for the --skip flag particularly help users understand how to specify multiple functions to skip.

website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1)

48-54: Documentation is consistent and informative.

The flag table has been expanded with the same three new flags that were added to other commands, maintaining consistency across the CLI documentation. The descriptions are thorough and include helpful examples for the --skip flag.

website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1)

47-53: Clear and consistent documentation for CLI flags.

The three new flags have been documented with the same level of detail as in other command files, which helps maintain a consistent user experience across the CLI. The examples for the --skip flag are particularly helpful.

cmd/terraform_commands.go (1)

257-260: Flag implementations match documentation.

The implementation of the CLI flags aligns perfectly with the documentation:

  • Updated description for --skip-init provides clarity
  • New flags --process-templates and --process-functions default to true
  • The --skip flag is implemented as a string slice, allowing for multiple values

This provides users with fine-grained control over template and function processing during command execution.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
website/docs/cli/commands/terraform/terraform-deploy.mdx (1)

94-96: Deployment flags section looks good.
The additions for --process-templates, --process-functions, and --skip are well integrated into the table. Just double-check the table formatting—there seems to be extra spacing in the --skip row that might benefit from a quick review for consistency.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03ac289 and 81035aa.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (18)
  • atmos.yaml (0 hunks)
  • cmd/terraform.go (1 hunks)
  • cmd/terraform_commands.go (1 hunks)
  • examples/quick-start-advanced/Dockerfile (1 hunks)
  • go.mod (11 hunks)
  • internal/exec/terraform.go (1 hunks)
  • internal/exec/terraform_generate_backend.go (2 hunks)
  • internal/exec/terraform_generate_varfile.go (2 hunks)
  • internal/exec/utils.go (1 hunks)
  • pkg/config/const.go (1 hunks)
  • pkg/schema/schema.go (1 hunks)
  • website/docs/cli/commands/terraform/terraform-deploy.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-shell.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-workspace.mdx (1 hunks)
  • website/docs/cli/commands/terraform/usage.mdx (1 hunks)
  • website/docs/integrations/atlantis.mdx (1 hunks)
💤 Files with no reviewable changes (1)
  • atmos.yaml
🧰 Additional context used
🧠 Learnings (1)
examples/quick-start-advanced/Dockerfile (2)
Learnt from: aknysh
PR: cloudposse/atmos#775
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.426Z
Learning: It is acceptable to set `ARG ATMOS_VERSION` to a future version like `1.105.0` in `examples/quick-start-advanced/Dockerfile` if that will be the next release.
Learnt from: osterman
PR: cloudposse/atmos#801
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.425Z
Learning: When updating the `ATMOS_VERSION` in Dockerfiles, the team prefers to pin to the next future version when the PR merges, even if the version is not yet released.
🧬 Code Definitions (2)
cmd/terraform.go (1)
internal/exec/terraform.go (1) (1)
  • ExecuteTerraform (39:505)
internal/exec/utils.go (1)
pkg/config/const.go (3) (3)
  • ProcessTemplatesFlag (73:73)
  • ProcessFunctionsFlag (74:74)
  • SkipFlag (75:75)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Acceptance Tests (macos-latest, macos)
  • GitHub Check: Acceptance Tests (windows-latest, windows)
  • GitHub Check: Acceptance Tests (ubuntu-latest, linux)
  • GitHub Check: Summary
🔇 Additional comments (19)
website/docs/integrations/atlantis.mdx (1)

675-677: Bump ATMOS_VERSION for Consistency

The update to ATMOS_VERSION: 1.167.0 is correctly applied and helps ensure that the GitHub Actions workflow uses the intended Atmos release. Please make sure that any other documentation references to the previous version are updated consistently if needed.

examples/quick-start-advanced/Dockerfile (1)

9-9: Update Atmos Version in Dockerfile

The ARG ATMOS_VERSION has been updated to 1.167.0, which aligns with the changes in the documentation and the version used in the GitHub Actions workflow. This is consistent with our team’s best practices regarding version pinning for upcoming releases.

go.mod (2)

6-6: Dependency update looks good

This PR includes numerous dependency updates to keep the codebase current with the latest package versions. These updates improve security, fix bugs, and potentially add new features that will be beneficial to the project.

Also applies to: 23-23, 32-32, 40-40, 44-44, 59-59, 65-66


74-77: New dependencies added appropriately

The addition of new dependencies like cel.dev/expr, cloud.google.com/go/auth, and others appear to be related to the updated Google Cloud APIs and supporting functionality needed for the new features.

Also applies to: 80-81, 84-86, 259-260

pkg/config/const.go (1)

73-75: New CLI flags added correctly

These three new constants define the flags that will be used to control the processing of templates and YAML functions in Atmos stack manifests. The naming is clear and consistent with the existing flag naming pattern in the codebase.

pkg/schema/schema.go (1)

420-422: Appropriate struct fields added for new flags

The new fields added to the ConfigAndStacksInfo struct correctly correspond to the CLI flags defined in const.go. This will allow the application to store and pass these flag values through the execution flow.

internal/exec/terraform_generate_backend.go (2)

27-40: Proper flag parsing implementation

The code correctly retrieves the flag values with appropriate error handling. The variable names clearly indicate their purpose, making the code easy to understand.


58-58: Updated function call with new parameters

The ProcessStacks function call has been correctly updated to use the parsed flag values instead of hardcoded values. This implements the core functionality of allowing users to control template and function processing through the CLI.

cmd/terraform.go (1)

64-86: Well-implemented command flag handling for the Terraform commands.

This change adds three new flags:

  • --process-templates: Controls Go template processing
  • --process-functions: Controls YAML function processing
  • --skip: Allows specifying YAML functions to skip

The implementation correctly retrieves these flags and assigns them to the info structure before executing the command. Error handling is consistent with the codebase's patterns.

internal/exec/terraform.go (1)

63-63: Correctly updated ProcessStacks parameters to use the new command-line flags.

The change properly passes the user-provided values for process-templates, process-functions, and skip through to the ProcessStacks function, which aligns with the flags added in cmd/terraform.go.

internal/exec/utils.go (1)

53-55: Appropriate addition of new flags to the commonFlags list.

Adding these flags to commonFlags ensures they'll be processed by Atmos and removed before passing arguments to Terraform. This is critical since Terraform wouldn't recognize these Atmos-specific flags.

internal/exec/terraform_generate_varfile.go (2)

26-40: Proper implementation of flag retrieval in the varfile command.

The implementation correctly retrieves the three new flags with appropriate error handling, maintaining consistency with the changes in cmd/terraform.go.


57-57: Correctly updated ProcessStacks call to use the retrieved flag values.

The function now passes the user-provided values to ProcessStacks rather than using fixed values, providing consistent behavior with other terraform commands.

website/docs/cli/commands/terraform/terraform-shell.mdx (1)

66-72: Great documentation update for CLI flags.
The newly added rows for --process-templates, --process-functions, and --skip are clearly described and consistent with the style of the existing table. This should help users understand their usage easily.

website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1)

48-55: Backend generation command flags are well integrated.
The new entries for --process-templates, --process-functions, and --skip are clearly documented and mirror the style used in other command pages. This consistency will help users apply similar options across commands.

website/docs/cli/commands/terraform/terraform-workspace.mdx (1)

52-59: Workspace command flag additions are consistent.
The inclusion of --process-templates, --process-functions, and --skip in the flags table is clear and follows the same formatting as in other documentation files, ensuring consistency across the CLI docs.

website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1)

47-54: Varfile command flags addition looks solid.
The new flags --process-templates, --process-functions, and --skip have been added with detailed descriptions. Their formatting and explanatory notes are consistent with the rest of the documentation, which helps maintain clarity.

website/docs/cli/commands/terraform/usage.mdx (1)

149-158: Documentation updated with new flags.

The table now includes the three new flags with clear descriptions and usage examples. The formatting is consistent, and the examples show both single and multiple flag usage patterns, which is helpful.

cmd/terraform_commands.go (1)

257-260: Implementation of new CLI flags looks good.

The implementation adds the three new flags as described in the PR objectives:

  1. --process-templates (boolean, defaults to true)
  2. --process-functions (boolean, defaults to true)
  3. --skip (string slice, defaults to nil)

The defaults maintain backward compatibility by enabling processing by default, which is appropriate.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
go.mod (1)

74-77: Update multiple Cloud Go libraries.
This block updates several dependencies—cel.dev/expr to v0.19.1, cloud.google.com/go to v0.118.3, along with cloud.google.com/go/auth (v0.15.0) and cloud.google.com/go/auth/oauth2adapt (v0.2.7). These collective updates should offer improved stability with Google Cloud integrations. Please verify any potential API changes.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03ac289 and 81035aa.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (18)
  • atmos.yaml (0 hunks)
  • cmd/terraform.go (1 hunks)
  • cmd/terraform_commands.go (1 hunks)
  • examples/quick-start-advanced/Dockerfile (1 hunks)
  • go.mod (11 hunks)
  • internal/exec/terraform.go (1 hunks)
  • internal/exec/terraform_generate_backend.go (2 hunks)
  • internal/exec/terraform_generate_varfile.go (2 hunks)
  • internal/exec/utils.go (1 hunks)
  • pkg/config/const.go (1 hunks)
  • pkg/schema/schema.go (1 hunks)
  • website/docs/cli/commands/terraform/terraform-deploy.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-shell.mdx (1 hunks)
  • website/docs/cli/commands/terraform/terraform-workspace.mdx (1 hunks)
  • website/docs/cli/commands/terraform/usage.mdx (1 hunks)
  • website/docs/integrations/atlantis.mdx (1 hunks)
💤 Files with no reviewable changes (1)
  • atmos.yaml
🧰 Additional context used
🧠 Learnings (1)
examples/quick-start-advanced/Dockerfile (2)
Learnt from: aknysh
PR: cloudposse/atmos#775
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.426Z
Learning: It is acceptable to set `ARG ATMOS_VERSION` to a future version like `1.105.0` in `examples/quick-start-advanced/Dockerfile` if that will be the next release.
Learnt from: osterman
PR: cloudposse/atmos#801
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2025-03-18T00:20:29.425Z
Learning: When updating the `ATMOS_VERSION` in Dockerfiles, the team prefers to pin to the next future version when the PR merges, even if the version is not yet released.
🧬 Code Definitions (2)
internal/exec/utils.go (1)
pkg/config/const.go (3) (3)
  • ProcessTemplatesFlag (73:73)
  • ProcessFunctionsFlag (74:74)
  • SkipFlag (75:75)
cmd/terraform.go (1)
internal/exec/terraform.go (1) (1)
  • ExecuteTerraform (39:505)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Acceptance Tests (macos-latest, macos)
  • GitHub Check: Acceptance Tests (windows-latest, windows)
  • GitHub Check: Acceptance Tests (ubuntu-latest, linux)
  • GitHub Check: Summary
🔇 Additional comments (42)
examples/quick-start-advanced/Dockerfile (1)

9-9: Version bumped appropriately.

Updating the ATMOS_VERSION from 1.165.3 to 1.167.0 for the next release aligns with team practices. Perfect.

internal/exec/utils.go (1)

53-55: New CLI flags added correctly to commonFlags.

The three new flags for controlling template and function processing have been added to the commonFlags slice, which will ensure they're properly handled by Atmos and not passed to the underlying tools.

pkg/config/const.go (1)

73-75: Three new flag constants defined clearly.

The new constant declarations for the process-templates, process-functions, and skip flags are well named and follow the project's conventions for flag definitions.

website/docs/integrations/atlantis.mdx (1)

676-676: Version updated in documentation example.

The ATMOS_VERSION has been updated to 1.167.0 in the GitHub Action example, maintaining consistency with the Dockerfile update.

pkg/schema/schema.go (1)

420-422: Solid addition of configuration fields for controlling template and function processing.

These new fields align well with the PR objectives to add CLI flags for controlling template and function processing. The field types are appropriate for their purposes:

  • ProcessTemplates as a boolean for enabling/disabling template processing
  • ProcessFunctions as a boolean for enabling/disabling function processing
  • Skip as a string slice for specifying functions to skip
internal/exec/terraform.go (1)

63-63: Good implementation of passing configuration fields to ProcessStacks.

The function now properly utilizes the new configuration fields directly from the info structure instead of using a calculated or default value. This allows the CLI flags to directly control template and function processing behavior.

website/docs/cli/commands/terraform/terraform-shell.mdx (1)

66-72: Well-documented new flags with clear descriptions and examples.

The documentation provides clear explanations of the new flags:

  • --process-templates for controlling Go template processing
  • --process-functions for controlling YAML functions processing
  • --skip for specifying functions to skip

The examples showing multiple ways to use the --skip flag are particularly helpful for users.

Consider adding the default values for these flags in the documentation to make it even clearer for users.

website/docs/cli/commands/terraform/terraform-workspace.mdx (1)

52-58: Consistent documentation of the new flags across commands.

The documentation maintains consistency with other commands, providing the same clear descriptions and examples for the new flags. This consistency improves the user experience.

internal/exec/terraform_generate_backend.go (2)

27-40: Implementation of CLI flags looks good

The additions properly retrieve the new --process-templates, --process-functions, and --skip flags from the command line with appropriate error handling.

The implementation aligns with the PR objectives to provide users with more control over template and function processing in Atmos stack manifests.


58-58: ProcessStacks call correctly updated

The function call has been properly modified to utilize the newly added flags instead of hardcoded values, maintaining the same function signature while providing more flexibility.

website/docs/cli/commands/terraform/terraform-generate-varfile.mdx (1)

47-53: Documentation updated with new flags

The flags table has been properly expanded to include the three new command-line options:

  • --process-templates for controlling Go template processing
  • --process-functions for controlling YAML functions processing
  • --skip for specifying YAML functions to skip

The descriptions are clear and examples are provided for handling multiple values with the --skip flag.

website/docs/cli/commands/terraform/terraform-generate-backend.mdx (1)

48-54: Documentation updated with new flags

The added flags are consistent with the implementation in the code and match the documentation in other command files:

  • --process-templates
  • --process-functions
  • --skip

The examples for the --skip flag clearly demonstrate both methods for specifying multiple functions.

website/docs/cli/commands/terraform/terraform-deploy.mdx (1)

87-96: Documentation updated with new flags

The flags table has been correctly expanded to include the three new command-line options while maintaining consistency with other command documentation:

  • --process-templates
  • --process-functions
  • --skip

The formatting is consistent and the descriptions provide clear guidance on flag usage.

internal/exec/terraform_generate_varfile.go (2)

26-39: Good implementation of new flag parsing

The implementation correctly retrieves and validates the new command-line flags for controlling template and function processing, following consistent error handling patterns.


57-57: Correctly updated ProcessStacks call with new parameters

The call has been properly modified to use the newly added flag values instead of hardcoded values, providing users with runtime control over processing behavior.

cmd/terraform.go (1)

65-85: Well-structured implementation of flag processing

The code effectively retrieves and handles the new command-line flags, with appropriate error handling and assignment to the info structure that will be used downstream by ExecuteTerraform.

website/docs/cli/commands/terraform/usage.mdx (1)

149-158: Clear and comprehensive documentation of the new flags

The documentation clearly explains each new flag's purpose, usage syntax, and default behavior. The table formatting is consistent and provides users with all necessary information to understand how to use these options.

cmd/terraform_commands.go (1)

257-260: Appropriate flag definitions with sensible defaults

The implementation adds three new flags with proper descriptions and default values, while also improving the existing skip-init flag description. This provides users with more granular control over Terraform command execution.

go.mod (24)

6-6: Update dependency for Secret Manager.
The version for cloud.google.com/go/secretmanager has been updated to v1.14.6. This update should improve compatibility and features. Please verify that our usage remains fully compatible with the new version.


23-23: Upgrade EditorConfig Checker.
The dependency github.com/editorconfig-checker/editorconfig-checker/v3 is now at v3.2.1. This minor upgrade should be safe, but a quick check for any API adjustments might be worthwhile.


32-32: Bump Google GAX dependency.
The version for github.com/googleapis/gax-go/v2 has been bumped to v2.14.1. Ensure that any breaking changes or new features are handled in our integrations.


40-40: Update JFrog Client dependency.
The dependency github.com/jfrog/jfrog-client-go is now at v1.51.1. Please confirm that this update does not introduce any regressions in our usage of the library.


44-44: Refresh Bubblezone version.
github.com/lrstanley/bubblezone has been updated to a new developmental version (v0.0.0-20250315020633-c249a3fe1231). Since this appears to be a pre-release, please verify its stability within our codebase.


59-59: Bump Viper to a newer version.
The update for github.com/spf13/viper to v1.20.0 should enhance configuration management. Double-check that there are no breaking changes in configuration handling.


65-66: Upgrade Google API and gRPC dependencies.
Both google.golang.org/api and google.golang.org/grpc have been updated (to v0.226.0 and v1.71.0 respectively). It’s important to test RPC-related features to ensure smooth integration.


79-81: Refresh Cloud IAM/Monitoring dependencies.
The updates for cloud.google.com/go/iam (v1.4.1), cloud.google.com/go/monitoring (v1.24.0), and cloud.google.com/go/storage (v1.50.0) are in line with our cloud integration needs. Running integration tests is recommended to catch any subtle issues.


84-86: Enhance observability with opentelemetry updates.
The dependencies under the github.com/GoogleCloudPlatform/opentelemetry-operations-go namespace—detectors (v1.25.0), exporter (v0.49.0), and internal/resourcemapping (v0.49.0)—have been updated. These changes support our observability improvements; please verify they function well with our telemetry setup.


140-140: Incorporate latest CNCF XDS changes.
The dependency github.com/cncf/xds/go has been updated to v0.0.0-20241223141626-cff3c89139a3, which appears to be a pre-release. Please check the overall stability and ensure it meets our production needs before wide-scale use.


159-159: Update EditorConfig Core library.
github.com/editorconfig/editorconfig-core-go/v2 has been bumped to v2.6.3. This should refine our EditorConfig handling—confirm that everything parses correctly post-update.


162-163: Refresh Envoy-related dependencies.
The upgrades for github.com/envoyproxy/go-control-plane/envoy (v1.32.4) and github.com/envoyproxy/protoc-gen-validate (v1.2.1) are included. Ensure that any API modifications align with our current implementation.


175-175: Bump Mapstructure version.
The dependency github.com/go-viper/mapstructure/v2 is now v2.2.1. This update should improve data mapping functionality—please run tests to be certain of a smooth transition.


185-185: Update Google S2A library.
github.com/google/s2a-go has been updated to v0.1.9. Validate that any security or performance improvements are effective as intended within our context.


187-187: Refresh Enterprise Certificate Proxy.
The dependency github.com/googleapis/enterprise-certificate-proxy has been updated to v0.3.5. Please ensure that our certificate-based workflows continue to operate correctly.


269-269: Update Locafero dependency.
github.com/sagikazarmark/locafero now stands at v0.7.0. Double-check that any filesystem abstractions or related functionalities remain unaffected by this update.


275-276: Bump Afero and Cast libraries.
The updates for github.com/spf13/afero (v1.12.0) and github.com/spf13/cast (v1.7.1) should enhance file operations and type conversion utilities. Ensure our tests pass with these revisions.


296-297: Upgrade opentelemetry instrumentation.
The updates to go.opentelemetry.io/contrib/detectors/gcp (v1.34.0) and go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (v0.59.0) are key for observability. Please run thorough tests to check for any instrumentation-related issues.


302-302: Refresh opentelemetry SDK Metric component.
go.opentelemetry.io/otel/sdk/metric is now v1.34.0. This update could impact metric export behavior; checking the performance and correctness of our metric routines is advisable.


309-309: Update x/crypto dependency.
golang.org/x/crypto has been updated to v0.36.0. This is important for security, so please verify our cryptographic routines against any API changes.


312-312: Bump x/net library.
The update to golang.org/x/net now at v0.37.0 might introduce subtle changes in networking utilities. A review of network-related tests is suggested.


315-315: Refresh x/time library.
golang.org/x/time has been updated to v0.11.0. This change should be safe, but please check any time-sensitive logic for correctness.


317-317: Upgrade x/xerrors.
The dependency golang.org/x/xerrors is now at v0.0.0-20231012003039-104605ab7028, which can affect error wrapping and formatting. Ensure that error handling remains robust.


318-321: Update Genproto and Protobuf packages.
The changes to google.golang.org/genproto, googleapis/api, googleapis/rpc, and google.golang.org/protobuf (with the latter updated to v1.36.5) are aimed at improving RPC and serialization support. Please run end-to-end tests for any potential impact on our gRPC communications.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
tests/README.md (1)

55-55: Improve Documentation Clarity: Add Missing Comma

It’s a minor nitpick but consider adding a comma after "snapshots" in the sentence. This will improve readability and align with conventional punctuation. For example:

-To regenerate ALL snapshots pass the `-regenerate-snapshots` flag.
+To regenerate ALL snapshots, pass the `-regenerate-snapshots` flag.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~55-~55: Possible missing comma found.
Context: ...directory ### Flags To regenerate ALL snapshots pass the -regenerate-snapshots flag. ...

(AI_HYDRA_LEO_MISSING_COMMA)

tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden (1)

109-109: Consider using HTML entities for angle brackets in examples.

Based on previous feedback, angle brackets in command examples should use HTML entities (e.g., &lt;component-name&gt; instead of <component-name>). This isn't related to your current changes but would improve consistency.

-  $ atmos terraform [subcommand] <component-name> -s <stack-name>
+  $ atmos terraform [subcommand] &lt;component-name&gt; -s &lt;stack-name&gt;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81035aa and 7c4153b.

📒 Files selected for processing (10)
  • tests/README.md (1 hunks)
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
  • tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
  • tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
🧰 Additional context used
🧠 Learnings (5)
tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (1)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-18T00:20:29.425Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden (2)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-18T00:20:29.425Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden:59-64
Timestamp: 2025-03-18T00:20:29.426Z
Learning: For Atmos CLI help text, angle brackets in command examples and flag descriptions should be escaped using HTML entities (e.g., `&lt;component&gt;`) rather than converted to backticks or other markdown formatting.
tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (2)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-18T00:20:29.425Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden:59-64
Timestamp: 2025-03-18T00:20:29.426Z
Learning: For Atmos CLI help text, angle brackets in command examples and flag descriptions should be escaped using HTML entities (e.g., `&lt;component&gt;`) rather than converted to backticks or other markdown formatting.
tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden (1)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-18T00:20:29.425Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden (1)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-18T00:20:29.425Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
🪛 LanguageTool
tests/README.md

[uncategorized] ~55-~55: Possible missing comma found.
Context: ...directory ### Flags To regenerate ALL snapshots pass the -regenerate-snapshots flag. ...

(AI_HYDRA_LEO_MISSING_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Summary
  • GitHub Check: Build (windows-latest, windows)
🔇 Additional comments (10)
tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden (3)

39-46: Well-structured flag documentation for template processing controls.

These new flags allow users to control Go template and YAML function processing in Atmos stack manifests, which aligns perfectly with the PR objectives. The descriptions clearly communicate their purpose and default values.


52-55: Good addition of the function-skipping capability.

The --skip flag provides granular control over which YAML functions to skip during execution, enhancing flexibility for users. The default empty array is sensible as it preserves current behavior by default.


56-58: Improved clarity in skip-init description.

The description now specifically mentions "executing terraform commands" instead of the more generic "executing the command", providing better context for users.

tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (2)

62-73: Consistent flag documentation across command help outputs.

The flags added here match those in the apply help output, maintaining consistency across the CLI documentation. Clear descriptions with default values help users understand the available options.


74-76: Consistent improvement to skip-init description.

The description update matches the change made in the apply help output, maintaining consistency across the documentation.

tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (2)

67-78: Maintained consistency in flag documentation.

The flag documentation is consistent with other help outputs, providing users with the same clear information regardless of how they access the help.


79-81: Consistent skip-init description update.

The description improvement for the skip-init flag matches the changes made in other help outputs.

tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden (2)

39-46: Consistent flag documentation across help variants.

The documentation for the new processing control flags is consistent with other help outputs, maintaining uniformity across the CLI interface.


52-58: Consistent documentation for skip flags.

Both the new --skip functionality and the improved --skip-init description match the documentation in other help outputs, ensuring users receive consistent information.

tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden (1)

62-73: The added CLI flags enhance user control over manifest processing.

The new flags provide useful control for processing YAML functions, templates, and skipping specific functions. Each flag has a clear description and default value.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
@codecov
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 38.00000% with 31 lines in your changes missing coverage. Please review.

Project coverage is 24.35%. Comparing base (03ac289) to head (0426693).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/exec/terraform_generate_backend.go 0.00% 13 Missing ⚠️
internal/exec/terraform_generate_varfile.go 0.00% 13 Missing ⚠️
cmd/terraform.go 73.68% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1157      +/-   ##
==========================================
+ Coverage   21.64%   24.35%   +2.70%     
==========================================
  Files         172      176       +4     
  Lines       19292    20181     +889     
==========================================
+ Hits         4176     4915     +739     
- Misses      14336    14462     +126     
- Partials      780      804      +24     
Flag Coverage Δ
unittests 24.35% <38.00%> (+2.70%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 20, 2025
@aknysh aknysh requested a review from osterman March 20, 2025 02:22
@mergify
Copy link

mergify bot commented Mar 20, 2025

💥 This pull request now has conflicts. Could you fix it @aknysh? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Mar 20, 2025
@mergify mergify bot removed the conflict This PR has conflicts label Mar 20, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53810ed and 6c3409d.

📒 Files selected for processing (7)
  • cmd/terraform.go (1 hunks)
  • cmd/terraform_commands.go (1 hunks)
  • internal/exec/terraform.go (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (1 hunks)
  • tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (1 hunks)
  • website/docs/cli/commands/terraform/usage.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • internal/exec/terraform.go
  • tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
  • cmd/terraform_commands.go
🧰 Additional context used
🧠 Learnings (2)
tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (1)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-19T20:50:42.838Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (2)
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-03-19T20:50:42.838Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.
Learnt from: samtholiya
PR: cloudposse/atmos#1068
File: tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden:59-64
Timestamp: 2025-03-19T20:50:42.839Z
Learning: For Atmos CLI help text, angle brackets in command examples and flag descriptions should be escaped using HTML entities (e.g., `&lt;component&gt;`) rather than converted to backticks or other markdown formatting.
🪛 golangci-lint (1.64.8)
cmd/terraform.go

[error] 88-88: ineffectual assignment to err

(ineffassign)

🪛 GitHub Check: golangci-lint
cmd/terraform.go

[failure] 88-88:
ineffectual assignment to err

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Acceptance Tests (macos-latest, macos)
  • GitHub Check: Acceptance Tests (windows-latest, windows)
  • GitHub Check: Acceptance Tests (ubuntu-latest, linux)
  • GitHub Check: [localstack] demo-localstack
  • GitHub Check: Summary
🔇 Additional comments (8)
tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden (2)

68-79: New flags added, good implementation.

The addition of these three new flags (--process-functions, --process-templates, and --skip) aligns perfectly with the PR objectives. The descriptions are clear and inform users about their default values.


80-82: Improved description for --skip-init flag.

The updated description makes it clearer that this flag skips running terraform init specifically before executing terraform commands, rather than just skipping initialization in general.

cmd/terraform.go (1)

67-87: Implementation of new flags looks good.

The approach for retrieving and processing the new flags is clean and consistent with error handling patterns used elsewhere in the codebase.

tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden (2)

63-74: New CLI flags added correctly.

The implementation of the three new flags (--process-functions, --process-templates, and --skip) is consistent with the format of other flags in the help text. The descriptions clearly explain the purpose and default values of each flag.


75-77: Updated description for --skip-init flag.

The clarified description for the --skip-init flag improves user understanding of its purpose.

website/docs/cli/commands/terraform/usage.mdx (3)

143-148: Changed arguments section to definition list format.

Good conversion to definition list format as requested in previous review.


152-180: Improved flags section with definition list format.

The conversion to definition list format improves readability and consistency. The use of proper shell code blocks and organization of flag descriptions makes this documentation clearer for users.


181-223: New flags well-documented with examples.

The documentation for the new flags (--skip-init, --process-templates, --process-functions, and --skip) is comprehensive and includes helpful examples showing how to use each flag. The explanation of default behaviors is particularly useful.

@aknysh aknysh merged commit 34cc497 into main Mar 20, 2025
51 checks passed
@aknysh aknysh deleted the add-terraform-flags branch March 20, 2025 15:10
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants