Skip to content

fix: pin Terraform 1.15.5 for all Nix platforms - #25799

Merged
nickvigilante merged 3 commits into
mainfrom
nick/fix-nix-terraform-version
Jun 12, 2026
Merged

fix: pin Terraform 1.15.5 for all Nix platforms#25799
nickvigilante merged 3 commits into
mainfrom
nick/fix-nix-terraform-version

Conversation

@nickvigilante

@nickvigilante nickvigilante commented May 28, 2026

Copy link
Copy Markdown
Contributor

The terraform_1_15_5 derivation previously only handled linux/amd64, falling through to unstablePkgs.terraform on all other platforms. On macOS this meant a different Terraform version was used, which caused the version check in make pre-commit to trigger generate.sh, regenerating all testdata with the host platform's OS/arch (darwin/arm64) instead of the committed linux/amd64 values.

Three changes:

  1. flake.nix: add explicit linux_arm64, darwin_arm64, and darwin_amd64 cases with SHA256 hashes from the official HashiCorp release. Unknown platforms still fall back to unstablePkgs.terraform.

  2. provisioner/terraform/testdata/generate.sh: guard full regeneration behind a Linux-only check. The committed testdata encodes linux/amd64 values from the coder_provisioner data source, so regenerating on macOS would permanently bake in darwin/arm64. The --check path still runs on all platforms so the version target can detect provider mismatches. Regeneration via CI or an explicit Linux run is unchanged.

  3. scripts/release/check_commit_metadata.sh: fix a shfmt (>=3.13) false positive. The [install.sh] key in an associative array literal was parsed as floating-point arithmetic (a zsh-only feature). Moving it to a post-declaration assignment satisfies the stricter parser without changing runtime behavior.

Linear: DOCS-279

@nickvigilante nickvigilante changed the title fix(flake.nix): pin Terraform 1.15.5 for all Nix platforms fix: pin Terraform 1.15.5 for all Nix platforms May 28, 2026
@nickvigilante
nickvigilante force-pushed the nick/fix-nix-terraform-version branch from e6ff6fe to 4734aa4 Compare May 28, 2026 15:45
@nickvigilante

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-05-28 17:12 UTC by @nickvigilante
Spend: $30.25 / $100.00

Review history
  • R1 (2026-05-28): 10 reviewers, 6 Nit, 1 Note, 2 P3, COMMENT. Review
  • R2 (2026-05-28), 6 Nit, 1 Note, 2 P3, COMMENT. Review
  • R3 (2026-05-28): 6 reviewers, 7 Nit, 1 Note, 2 P3, COMMENT. Review
  • R4 (2026-05-28): 3 reviewers, 7 Nit, 1 Note, 2 P3, APPROVE. Review

deep-review v0.6.0 | Round 4 | 12520ee..426c178

Last posted: Round 4, 10 findings (2 P3, 7 Nit, 1 Note), APPROVE. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Author fixed (d797d32) generate.sh:148 exit 0 silently swallows --upgrade on non-Linux R1 Hisoka P3, Chopper P3 Yes
CRF-2 P3 Author fixed (d797d32) flake.nix:116 if/else chain reconstructs platform identity; lookup table matches existing pattern R1 Zoro Yes
CRF-3 Nit Author fixed (d797d32) flake.nix:113 Comment padding ("Keep Terraform aligned with" vs "Pin to") R1 Gon (downgraded from P2) Yes
CRF-4 Nit Author fixed (d797d32) generate.sh:145 Third comment sentence restates the if-check and echo R1 Gon (downgraded from P2) Yes
CRF-5 Nit Author fixed (d797d32) check_commit_metadata.sh:91 Trailing clause restates what the code shows R1 Gon (downgraded from P2) Yes
CRF-6 Nit Author acknowledged R2 (deferred to merge squash) (commit) Commit scope fix(flake.nix) doesn't contain all changed files R1 Mafu-san, Leorio Yes
CRF-7 Nit Author fixed via CRF-2 (d797d32) flake.nix:116 terraformPlatform.platform tautological naming R1 Gon Yes
CRF-8 Nit Author contested; orchestrator closed R2 check_commit_metadata.sh:90 Unrelated shfmt fix bundled in platform-pinning commit R1 Mafu-san (downgraded from P3) Yes
CRF-9 Note Author acknowledged R2 (shfmt 3.13.1 in nix-shell verified) check_commit_metadata.sh:90 shfmt claim targets >=3.13 but project pins 3.12.0 R1 Mafu-san Yes
CRF-10 Nit Author fixed (426c178) flake.nix:116 hashes binding holds {platform, hash} records, not bare hashes R3 Gon Yes

Cross-check notes

CRF-1 convergence: Hisoka and Chopper independently flagged the same exit 0 issue from different angles. Hisoka focused on --upgrade being silently dropped; Chopper focused on Makefile callers seeing success. Hisoka's angle is sharper (explicit user intent silently ignored). Both confirmed at P3.

CRF-2 interaction with CRF-7: If the lookup table is adopted, the tautological naming (terraformPlatform.platform) goes away. The table would use hashes.${system} or null and a local binding like target.

CRF-3/4/5 pattern: Three instances of the same pattern (comment trailing clause restates code). Downgraded from Gon's P2 to Nit: these are convention/style issues. The comments are accurate and explain why; the extra words are marginally redundant.

CRF-8 downgrade: Mafu-san rated P3 for commit atomicity. Kite explicitly said "Change 3 is a one-line mechanical fix that doesn't warrant its own PR." Downgraded to Nit: the fix is one line, documented in the commit body, and practically zero risk.

CRF-9 folded into CRF-8: The shfmt version observation provides context for CRF-8 but is not actionable on its own.

Pariston, Kite, Mafuuu, Bisky: No findings. Pariston performed adversarial analysis and could not construct a failure scenario. Kite traced both Makefile callers and confirmed correct behavior. Mafuuu performed contract tracing on all three changes.

Contested and acknowledged

CRF-8 (Nit, check_commit_metadata.sh:90) - Unrelated shfmt fix bundled in commit

  • Finding: The shfmt parser workaround is functionally independent from the Terraform platform-pinning changes (different file, different tool, different problem). A separate commit would make it independently discoverable.
  • Author defense: The shfmt issue was discovered as a direct blocker to committing the primary change on macOS. The pre-commit hook rejected the commit until the script was fixed. Splitting into a separate commit would require two nix-shell commit invocations with no practical benefit; both changes land in one PR.
  • Orchestrator disposition (R2): Author's defense is valid. The shfmt fix was causally necessary to commit the Nix changes (pre-commit hook blocked the commit). While atomicity is ideal, the causal link through the development workflow (fix shfmt to unblock commit of primary change) makes the bundling reasonable. Closed.

CRF-9 (Note, check_commit_metadata.sh:90) - shfmt version unverified

  • Finding: mise.toml pins shfmt to v3.12.0 but the comment says "shfmt (>=3.13)." The trigger condition appeared unverified.
  • Author explanation: pinnedPkgs.shfmt in the nix-shell resolves to 3.13.1 (confirmed by shfmt --version). The comment targets the nix-shell toolchain where the issue is real and reproducible. CI (using mise-pinned 3.12.0) would not hit it, but nix-shell users do.
  • Orchestrator disposition (R2): Acknowledged. The trigger condition is verified for nix-shell users. The Note's concern was legitimate but the author has provided the missing evidence. Closed.

CRF-6 (Nit, commit) - Commit scope

  • Finding: Commit scope fix(flake.nix) doesn't contain every changed file.
  • Author acknowledgment: "Correct per CLAUDE.md. Will be fixed by amending or squashing before merge."
  • Status: Acknowledged, deferred to merge time. No ticket needed; this is a merge-time squash operation.

Round log

Round 1

Panel. 2 P3, 6 Nit, 1 Note. 9 findings total. Reviewed against 12520ee..4734aa4.

Round 2

No panel (code unchanged). Author responded to all 9 findings: 6 claimed fixed (no push), 1 acknowledged/deferred, 1 contested (CRF-8, closed by orchestrator), 1 acknowledged with evidence (CRF-9, closed). Head SHA unchanged: 4734aa4. Panel deferred to round 3 after push.

Round 3

Churn guard: PROCEED. 6 findings addressed in d797d32, all verified by panel (6 of 6 reviewers confirmed). CRF-6/8/9 unchanged (closed/deferred in R2). 1 new Nit (CRF-10). Reviewed against 12520ee..d797d32.

Round 4

Churn guard: PROCEED. CRF-10 addressed in 426c178 (renamed hashes to releases). All findings resolved. Reviewed against 12520ee..426c178.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well-designed PR with defense in depth: the Nix pin fixes the root cause while the generate.sh guard prevents wrong testdata even if the pin is bypassed. The PR description is exemplary, tracing the causal chain from Nix fallback through version mismatch to testdata contamination. Multiple reviewers attempted to find a simpler alternative and concluded both layers are needed.

"I tried to build a case against this PR and couldn't." (Pariston)

2 P3, 6 Nit, 1 Note.

🤖 This review was automatically generated with Coder Agents.

Comment thread provisioner/terraform/testdata/generate.sh
Comment thread flake.nix Outdated
Comment thread flake.nix Outdated
Comment thread provisioner/terraform/testdata/generate.sh Outdated
Comment thread scripts/release/check_commit_metadata.sh Outdated
Comment thread flake.nix Outdated
Comment thread scripts/release/check_commit_metadata.sh
Comment thread scripts/release/check_commit_metadata.sh Outdated
Comment thread flake.nix Outdated
@nickvigilante

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

1 similar comment
@nickvigilante

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the thorough responses. All 9 findings addressed in comments.

CRF-8 (contested): accepted. The shfmt fix was a direct blocker to committing the primary change on macOS (pre-commit hook rejection). The causal link through the development workflow makes the bundling reasonable.

CRF-9 (acknowledged): closed. pinnedPkgs.shfmt resolving to 3.13.1 in the nix-shell verifies the trigger condition. The Note's concern was legitimate; the author provided the missing evidence.

CRF-6 (acknowledged): deferred to merge squash. No action needed before push.

CRF-1, 2, 3, 4, 5, 7: author claims fixed but head SHA is unchanged (4734aa4, same as R1). Verification deferred until the push lands. Panel will run on the updated code.

🤖 This review was automatically generated with Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All R1 findings verified fixed in d797d32. Six reviewers independently confirmed: the lookup table is idiomatic Nix, the --upgrade guard correctly differentiates intent, and the comment edits are concise. One new Nit.

"Both sentences carry non-obvious information. First: what the committed data contains. Second: consequence. Minimum-draft is equivalent length. Kept." (Gon, verifying CRF-4 fix)

0 P3 remaining (both resolved), 1 new Nit, 6 verified fixed, 3 closed/deferred from R2.

CRF-6 (commit scope) remains deferred to merge squash.

🤖 This review was automatically generated with Coder Agents.

Comment thread flake.nix Outdated
@nickvigilante

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All 10 findings resolved across 4 rounds. CRF-10 verified: hashes renamed to releases in 426c178. Three reviewers confirmed no new issues.

Final tally: 2 P3 fixed, 7 Nit fixed (1 contested and accepted, 1 deferred to merge squash), 1 Note closed. Clean mechanical pass from Netero.

CRF-6 (commit scope) remains deferred to merge squash.

🤖 This review was automatically generated with Coder Agents.

@nickvigilante
nickvigilante marked this pull request as ready for review May 28, 2026 17:26
@nickvigilante
nickvigilante force-pushed the nick/fix-nix-terraform-version branch from 426c178 to 5e3f892 Compare May 28, 2026 18:06
@github-actions github-actions Bot added the stale This issue is like stale bread. label Jun 12, 2026
The terraform_1_15_5 derivation previously only handled linux/amd64,
falling through to unstablePkgs.terraform on all other platforms. On
macOS this meant a different Terraform version was used, which caused
the version check in make pre-commit to trigger generate.sh, regenerating
all testdata with the host platform's OS/arch (darwin/arm64) instead of
the committed linux/amd64 values.

Three changes:

1. flake.nix: add explicit linux_arm64, darwin_arm64, and darwin_amd64
   cases with SHA256 hashes from the official HashiCorp release. Unknown
   platforms still fall back to unstablePkgs.terraform.

2. provisioner/terraform/testdata/generate.sh: guard full regeneration
   behind a Linux-only check. The committed testdata encodes linux/amd64
   values from the coder_provisioner data source, so regenerating on
   macOS would permanently bake in darwin/arm64. The --check path still
   runs on all platforms so the version target can detect provider
   mismatches. Regeneration via CI or an explicit Linux run is unchanged.

3. scripts/release/check_commit_metadata.sh: fix a shfmt (>=3.13)
   false positive. The [install.sh] key in an associative array literal
   was parsed as floating-point arithmetic (a zsh-only feature). Moving
   it to a post-declaration assignment satisfies the stricter parser
   without changing runtime behavior.
@nickvigilante
nickvigilante force-pushed the nick/fix-nix-terraform-version branch from 5e3f892 to c5e395d Compare June 12, 2026 15:28
@nickvigilante
nickvigilante merged commit a86e1ca into main Jun 12, 2026
28 checks passed
@nickvigilante
nickvigilante deleted the nick/fix-nix-terraform-version branch June 12, 2026 20:28
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants