Skip to content

Enhancing Terraform Feature Stability - #657

Merged
Samruddhi Khandale (samruddhikhandale) merged 3 commits into
devcontainers:mainfrom
bulat-khusnimardanov:bugfix/terraform_cosign_version
Aug 22, 2023
Merged

Enhancing Terraform Feature Stability#657
Samruddhi Khandale (samruddhikhandale) merged 3 commits into
devcontainers:mainfrom
bulat-khusnimardanov:bugfix/terraform_cosign_version

Conversation

@bulat-khusnimardanov

@bulat-khusnimardanov Bulat Khusnimardanov (bulat-khusnimardanov) commented Aug 17, 2023

Copy link
Copy Markdown
Contributor

Description:
This pull request aims to enhance the stability of the Terraform feature by addressing a limitation in the ensure_cosign function. The function currently relies on the GitHub API for retrieving information, but this API has usage limitations, allowing only 60 calls per hour for non-authorized users (as documented here).

Problem:
The existing implementation poses challenges, especially within corporate networks where multiple users often share the same external IP address. This setup can quickly exhaust the rate limit, disrupting the reliability of the feature.

Solution:
This pull request introduces a solution to address the rate-limiting issue. A fallback method has been implemented to retrieve the latest cosign version number.
This pull request presents a solution to mitigate the rate-limiting issue. Instead of implementing a separate fallback mechanism, we've leveraged the existing function, find_version_from_git_tags, to retrieve the latest cosign version. This approach, as suggested by Samruddhi Khandale (@samruddhikhandale), streamlines the codebase and effectively overcomes the rate-limiting constraint.

Changes Made:
- Implemented a fallback mechanism to retrieve the latest cosign version number.

  • Replaced the direct GitHub API call by the existing find_version_from_git_tags function.

@bulat-khusnimardanov

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you so much for taking the time to contribute the PR.
I agree that we should avoid using Git APIs due to the limits 👍

Left one comment on the approach!

Comment thread src/terraform/install.sh Outdated
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
@bulat-khusnimardanov
Bulat Khusnimardanov (bulat-khusnimardanov) marked this pull request as ready for review August 18, 2023 07:27

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! ❇️

@samruddhikhandale
Samruddhi Khandale (samruddhikhandale) merged commit 71ac202 into devcontainers:main Aug 22, 2023
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