Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Terraform] feature fallback fix #912

Conversation

gauravsaini04
Copy link
Contributor

@gauravsaini04 gauravsaini04 commented Mar 14, 2024

Feature name:

  • Terraform

Description:

This PR introduces the following functionality:

  • When the latest tag for packages/tools installed by terraform feature does not have a source binary released yet, then it will continue installing the previous working version for which a source binary will be available
  • Packages for which patch has been applied to terraform feature - cosign, terraform, tflint, terragrunt, tfsec, terraform_docs

Changelog:

  • Updated install.sh such that the fallback mechanism is properly configured for all these above listed tools/ packages
  • Updated tests files to validate that when a fake version is tried to be downloaded with curl command thus representing a scenario when trying to access a source binary which is not deployed yet, then it will pick up the binary for the latest released tag which will eventually work successfully, and if github api limits are reached then will try to find a prev. version from find_prev_version_from_git_tags() function and get the binary for that instead.
  • Have updated tests for all the above mentioned packages.

Checklist:

  • Checked that applied changes work as expected

src/terraform/install.sh Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Show resolved Hide resolved
src/terraform/install.sh Show resolved Hide resolved
src/terraform/install.sh Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
@gauravsaini04 gauravsaini04 marked this pull request as ready for review March 17, 2024 14:30
@gauravsaini04 gauravsaini04 requested a review from a team as a code owner March 17, 2024 14:30
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
@gauravsaini04 gauravsaini04 marked this pull request as draft March 27, 2024 04:33
@gauravsaini04 gauravsaini04 marked this pull request as ready for review March 27, 2024 16:20
Copy link
Member

@samruddhikhandale samruddhikhandale left a comment

Choose a reason for hiding this comment

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

Overall it looks great, left some comments

src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
src/terraform/install.sh Outdated Show resolved Hide resolved
Copy link
Member

@samruddhikhandale samruddhikhandale left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! 🎉

@samruddhikhandale samruddhikhandale merged commit 988cdd2 into devcontainers:main Mar 28, 2024
11 checks passed
@gauravsaini04 gauravsaini04 deleted the terraform_feature_fallback_fix branch March 28, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants