Repository navigation
ci: install Terraform to fix CI failure that Terraform is not found - #717
Conversation
📝 WalkthroughWalkthroughThe pull request modifies the GitHub Actions workflow file Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Terraform
User->>GitHub Actions: Trigger workflow
GitHub Actions->>Terraform: Setup Terraform (v1.9.7) in localstack
GitHub Actions->>Terraform: Setup Terraform (v1.9.7) in mock
GitHub Actions->>Terraform: Lint with version from previous step
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range comments (2)
.github/workflows/test.yml (2)
Line range hint
1-324: Overall LGTM with suggestions for improvementThe changes successfully address the PR objectives by adding Terraform setup steps across multiple jobs, which should resolve the CI failure due to missing Terraform.
To improve consistency and maintainability, consider the following suggestions:
- Centralize the Terraform version management by using a GitHub Actions variable or environment variable at the workflow level.
- Ensure all jobs use the same method for setting the Terraform version, either all using the centralized variable or all using the
steps.config.outputs.terraform-versionapproach.- If using the
configstep approach, make sure it's clearly defined and visible in the workflow file.These changes would make future updates easier and reduce the risk of version inconsistencies across jobs.
Action Required: Define the
configstep to provideterraform-version.The
lintjob referencessteps.config.outputs.terraform-version, but theconfigstep is not defined in.github/workflows/test.yml. Please ensure that theconfigstep is properly defined to set the Terraform version.
- File:
.github/workflows/test.yml- Lines: 157-166
🔗 Analysis chain
Line range hint
322-324: LGTM, but please clarify the source of the Terraform version.The use of a dynamic Terraform version (
${{ steps.config.outputs.terraform-version }}) in thelintjob is a good practice for flexibility. However, it differs from the hardcoded versions used in other jobs.Could you please clarify where the
configstep is defined and how theterraform-versionoutput is set? This information is crucial for understanding the version management across the workflow.To verify the existence and output of the
configstep, you can run the following:This will help ensure that the
configstep is properly defined and its output is consistently used throughout the workflow.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and output of the config step # Test: Search for the config step definition echo "Searching for config step definition:" rg --type yaml 'id:\s*config' .github/workflows/test.yml # Test: Search for uses of steps.config.outputs.terraform-version echo "Searching for uses of steps.config.outputs.terraform-version:" rg --type yaml 'steps\.config\.outputs\.terraform-version' .github/workflows/test.ymlLength of output: 439
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- .github/workflows/test.yml (2 hunks)
🧰 Additional context used
🔇 Additional comments (1)
.github/workflows/test.yml (1)
269-272: LGTM! Consider centralizing the Terraform version.The addition of the Terraform setup step in the
mockjob is consistent with the changes in thelocalstackjob and addresses the CI failure mentioned in the PR objectives.As mentioned in the previous comment, consider using a centralized variable for the Terraform version to ensure consistency and ease of updates across all jobs.
|
These changes were released in v1.90.0. |
what
Install Terraform using
hashicorp/setup-terraformaction in CI.why
CI failed because Terraform wasn't found.
https://github.com/cloudposse/atmos/actions/runs/11307359580/job/31449045566
https://github.com/cloudposse/atmos/actions/runs/11307359580/job/31449046010
This is because ubuntu-latest was updated to ubuntu-24.04 and Terraform was removed from it.
https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
On the other hand, Ubuntu 22.04 has Terraform.
https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
references
Summary by CodeRabbit