ci: lock terraform providers for darwin_arm64 + linux_amd64#17
Conversation
|
praise: clean first pass — 3 roots re-locked for both platforms, SHA-pinned workflow mirroring issue (fixed in 8f10999): the original check ran thought (out of scope): |
The committed .terraform.lock.hcl files only carried hashes for one platform (whoever ran `terraform init` last). On a different platform — Linux CI, a fresh machine — init then has to fetch missing hashes, which fails under `-lockfile=readonly` and churns the lock otherwise. - Re-lock all 3 roots (state-backend, cluster/local, cluster/scaleway) for darwin_arm64 (local dev) + linux_amd64 (CI) via `terraform providers lock`. - Add a PR-only CI workflow that re-runs `providers lock` for both platforms and fails on `git diff --exit-code`, so a lock incomplete for EITHER platform is caught regardless of the runner OS. - Add a `mise run lock` task and document when to re-run it in CLAUDE.md. Closes #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pris en compte dans |
8f10999 to
bf13b93
Compare
Problem
The committed
.terraform.lock.hclfiles only contained provider hashes for a single platform (darwin_arm64). On a Linux CI runner (or with-lockfile=readonly),terraform initwould fail or silently mutate the lock, creating churn across machines.Closes #16
What changed
Lock files (all 3 roots re-locked for both platforms):
state-backend/.terraform.lock.hcl— addslinux_amd64hashes forscaleway/scalewaycluster/local/.terraform.lock.hcl— addslinux_amd64hashes forhashicorp/helm,hashicorp/kubernetes,infisical/infisicalcluster/scaleway/.terraform.lock.hcl— addslinux_amd64hashes for all 6 providersCI (
.github/workflows/terraform-lock.yml):terraform init -backend=false -lockfile=readonly-backend=falseskips Scaleway/S3 backend credential requirements in CI-lockfile=readonlyturns an incomplete lock into a build failure instead of a silent mutationcontents: readpermission,persist-credentials: false— mirrorslint-workflows.ymlstyle.terraform.lock.hcl, anyversion.tf, or the workflow itselfTooling (
mise.toml):mise run locktask: re-runsproviders lock -platform=darwin_arm64 -platform=linux_amd64for all 3 roots in one shot. Devs and CI share the same invocation pattern.Docs (
CLAUDE.md):mise run lockin the Commands sectionterraform fmt:cluster/local/main.tf,variables.tf, andversion.tf(whitespace/alignment, no logic changes)How to verify
actionlint .github/workflows/*.yml— must pass with no output.grep -c 'h1:' {state-backend,cluster/local,cluster/scaleway}/.terraform.lock.hcl— each root should report at least 2 (one per platform per provider).docker run --rm -v $(pwd):/repo hashicorp/terraform:1.14 -chdir=/repo/state-backend init -backend=false -lockfile=readonly— must succeed.Reviewer notes
infisical/infisicalprovider is self-signed; that's expected and pre-existing. Both platforms' hashes were fetched from the official registry.cluster/localis pinned to infisical0.16.10andcluster/scalewayto0.16.26— these were already diverged before this PR and are intentionally left as-is (a separate bump can align them).hashicorp/setup-terraformaction is pinned to thev3.1.2commit SHA (b9cd54a3c349d3f38e8881555d616ced269862dd), matching the version inmise.toml(terraform = "1.14").🤖 Generated with Claude Code