GeezerVison is showing github.com — chore: add script to bump bundled terraform by coder[bot] · Pull Request #31463 · coder/coder
Conversation
coder
Bot
commented
Oct 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Part 1 of 2 for automating Terraform bumps. This PR adds the bump script. #31461 is stacked on top and adds the weekly workflow that runs it. Today these bumps are done by hand (#30516, #31301, #31438 and their backports).
scripts/update_terraform_version.sh [--skip-fixtures] <version>
Run from the repo root. It updates every file that pins the bundled Terraform version. Files a branch doesn't have are skipped, so the same script works on main and on older release branches:
provisioner/terraform/install.go: TerraformVersion. maxTerraformVersion changes only on a minor/major bump (it moves to X.Y.9).
provisioner/terraform/terraform_SHA256SUMS (from fix: verify bundled terraform against a checksum file in the Coder repo #31600), when the branch has it: replaced with the verified SHA256SUMS. scripts/Dockerfile.base and install.sh read the version and checksums from that file, so neither is edited.
- Otherwise (older branches):
install.sh and scripts/Dockerfile.base are edited directly, as before.
dogfood/coder/Dockerfile, airgap docs (docs/install/airgap.md or docs/install/prepare/airgap.md), .github/actions/setup-tf/action.yaml, testdata/{,resources/}version.txt
mise.toml, mise.lock (per-platform checksums), flake.nix (per-platform SRI hashes, old and new layouts)
provisioner/terraform/testdata/generation.sha1: re-fingerprinted with generate.sh --if-needed using the new binary
Every checksum comes from terraform_<v>_SHA256SUMS, and the script fails unless that file carries a valid signature from HashiCorp's release key (C874 011F 0AB4 0511 0D02 1055 3436 5D94 72D7 468F). It refuses downgrades and fails if a touched file still points at another release, or if a branch that pins TERRAFORM_VERSION in install.sh didn't end up on the new version. It doesn't source lib.sh, so CI can run main's copy against a release branch checkout.
Testing
Run in a dogfood workspace:
main, 1.16.7 to 1.17.1: byte-identical to fix: bump bundled terraform to 1.17.1 #31438, including maxTerraformVersion and generation.sha1.
release/2.38, 1.16.7 to 1.17.1: byte-identical to fix: bump bundled terraform to 1.17.1 (backport 2.38) #31441.
release/2.29 (1.16.6 to 1.16.7) and release/2.34, release/2.36 (to 1.17.1): same file sets as the earlier manual backports (fix: bump bundled terraform to 1.16.6 for 2.29 #30555, fix: bump bundled terraform to 1.16.6 for 2.34 #30554, fix: bump bundled terraform to 1.16.6 for 2.36 #30553).
- Rerunning on an already-bumped tree makes no changes. Downgrades, unknown versions and bad flags fail with a clear error.
- Checksum-file layout (fix: verify bundled terraform against a checksum file in the Coder repo #31600 head, 1.16.7 to 1.17.1,
--skip-fixtures): terraform_SHA256SUMS is byte-identical to HashiCorp's signed file, install.sh and Dockerfile.base are untouched, the new TestTerraformChecksumFileMatchesVersion passes, and mise.toml, mise.lock, flake.nix, the airgap doc and the install.go versions are byte-identical to fix: bump bundled terraform to 1.17.1 #31438. Rerunning changes nothing.
- Old layout (
main, 1.16.7 to 1.17.1, --skip-fixtures): output is byte-identical to the previous revision of this script.
shellcheck (v0.10.0) and shfmt -d (v3.12.0) are clean on the updated script.
make lint/shellcheck fmt/shfmt lint/emdash lint/typos pass.
None of the three touch the same files, and merging all three onto main is conflict-free. On that combined tree, the bump script took 1.16.7 to 1.17.1 by replacing the checksum file, the new Go test passes, and actionlint and shellcheck pass. They can merge in any order. Merge #31461 after #31463, retargeted to main.
Opened by Superblink on behalf of @droopy4096.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
scripts/update_terraform_version.sh updates every file that pins the bundled Terraform version, using GPG-verified HashiCorp checksums, and regenerates the fixture fingerprint. It works on main and on older release branches.
On branches with provisioner/terraform/terraform_SHA256SUMS (#31600),
replace it with the verified SHA256SUMS and regenerate install.sh with
the branch's scripts/gen_install_sh_terraform.sh, instead of editing
install.sh and scripts/Dockerfile.base. Branches without it keep the
existing behavior. Also check that install.sh ends up on the new
version.
The NOTE above TerraformVersion is rewritten by #31600, which now points at
this script, so drop the line added here to avoid a conflict.
install.sh now reads the Terraform version and checksums from
terraform_SHA256SUMS at install time (#31600), so on branches with that
file the script only replaces it. The install.sh version check now only
applies to branches that still pin TERRAFORM_VERSION.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Labels
community
Pull Requests and issues created by the community.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|