Skip to content

Conversation

@InfiniteTabs
Copy link
Member

This pull request refactors how Terraform provider download URLs and keys are generated, switching from local string construction to querying the Terraform Registry API for accurate metadata. It also updates dependencies to support async operations and adds comprehensive tests to ensure robustness across various scenarios.

Provider URL/key generation and API integration:

  • Refactored get_provider_url_key in utils/src/terraform.rs to be asynchronous and fetch provider metadata from the Terraform Registry API, improving accuracy and future-proofing the logic. The function now returns a Result type for better error handling.
  • Updated usages of get_provider_url_key in env_common/src/logic/api_module.rs and terraform_runner/src/terraform.rs to await the async function and handle errors. [1] [2]

Testing and error handling:

  • Added extensive async tests to utils/src/terraform.rs covering valid and invalid targets, categories, and provider versions, ensuring reliability and clear error messages for edge cases.

Dependency updates for async and serialization:

  • Added serde with derive feature and updated reqwest to include json support in utils/Cargo.toml for API response deserialization.
  • Added tokio with necessary features to dev-dependencies in utils/Cargo.toml to support async tests.

* to always get correct download-url:s, including third-party providers
@InfiniteTabs InfiniteTabs added the enhancement New feature or request label Oct 25, 2025
due to terraform license change (closing down registry for non-terraform software): https://registry.terraform.io/terms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants