Repository navigation
ci: serve Terraform providers from a read-only mirror in the Rust job - #887
Merged
Merged
Conversation
The Terraform generator tests run `terraform init` in a fresh directory for each stack, downloading every provider again (~920 test-seconds per run). A shared plugin cache breaks under parallel inits; a filesystem mirror is only read. Providers not in the mirror still install from the registry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The generator's provider constraints now come from one PROVIDER_REQUIREMENTS table, and a unit test fails when scripts/terraform-provider-mirror.sh declares different providers or constraints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
terraform_validate(andterraform_test/terraform_plan_with_vars) incrates/alien-terraform/src/test_utils.rsrunterraform initin a fresh temp directory for each stack, so every test downloads its providers again. In CI the generator suite takes ~920 test-seconds.A shared
TF_PLUGIN_CACHE_DIRisn't an option. Parallel inits write to the cache and fail with "the cached package … does not match any of the checksums recorded in the dependency lock file" (#853, and again when pre-warmed).Change
scripts/terraform-provider-mirror.shruns oneterraform initwith every provider the generator declares (aws, awscc, tls, google, google-beta, azurerm, Azure/azapi, time, kubernetes, helm, random, same constraints asgenerator.rs). It copies them into a local directory and writes a CLI config:filesystem_mirrorfor exactly the mirrored providersdirectfor everything else, so a provider added later still installs from the registryTF_CLI_CONFIG_FILE. Tests andtest_utils.rsare unchanged.PROVIDER_REQUIREMENTStable ingenerator.rs. The unit testprovider_mirror_matches_generator_requirementsfails if the script's list drifts from it.Measured
🤖 Generated with Claude Code