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

Enhancing Terraform Feature Stability #657

Conversation

bulat-khusnimardanov
Copy link
Contributor

@bulat-khusnimardanov bulat-khusnimardanov commented Aug 17, 2023

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 @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 bulat-khusnimardanov requested a review from a team as a code owner August 17, 2023 16:02
@bulat-khusnimardanov
Copy link
Contributor Author

bulat-khusnimardanov commented Aug 17, 2023 via email

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.

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!

src/terraform/install.sh Outdated Show resolved Hide resolved
Co-authored-by: Samruddhi Khandale <[email protected]>
@bulat-khusnimardanov bulat-khusnimardanov marked this pull request as draft August 18, 2023 07:14
@bulat-khusnimardanov bulat-khusnimardanov marked this pull request as ready for review August 18, 2023 07:27
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.

Thanks! ❇️

@samruddhikhandale samruddhikhandale merged commit 71ac202 into devcontainers:main Aug 22, 2023
12 checks passed
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