Skip to content

ci: pin Taskfile tool versions on Linux and Windows (phase 1 of #277)#282

Merged
maniSbindra merged 1 commit into
mainfrom
ci/pin-taskfile-tool-versions-277-v2
May 29, 2026
Merged

ci: pin Taskfile tool versions on Linux and Windows (phase 1 of #277)#282
maniSbindra merged 1 commit into
mainfrom
ci/pin-taskfile-tool-versions-277-v2

Conversation

@maniSbindra

@maniSbindra maniSbindra commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Pins tool versions in 9 .taskfiles/*.Taskfile.yml files away from latest, addressing phase 1 of #277 (supply-chain hardening on Linux and Windows install paths).

This is a deliberately narrow re-scope of #281 (closed unmerged with 18 reviewer comments). Only the *_VERSION: map: scalar values change, plus one small, narrowly-scoped fix to install_terraform.sh so the Terraform pin actually resolves against the HashiCorp apt repo (see below).

What changed

27 of 30 tools pinned to concrete semver across 9 maps. Values match those proposed in #281. Three tools intentionally left at latest and tracked as follow-ups (see below).

Map (file) Pinned tools
GO_VERSION (golang.Taskfile.yml) dlv, gopls, deadcode, golangciLint, gotestsum, govulncheck, goimports, gofumpt, goTestCoverage, gocoverCobertura, goreleaser
AZURE_VERSION (azure.Taskfile.yml) az, azd, bicep
GITHUB_VERSION (github.Taskfile.yml) act, pinact, ghalint, gh
JAVASCRIPT_VERSION (javascript.Taskfile.yml) prettier
MARKDOWN_VERSION (markdown.Taskfile.yml) markdownTableFormatter
RUNTIME_VERSION (runtime.Taskfile.yml) uv, fnm, golang
SHELL_VERSION (shell.Taskfile.yml) shellcheck, shfmt
TERRAFORM_VERSION (terraform.Taskfile.yml) terraform, opentofu
YAML_VERSION (yaml.Taskfile.yml) yamllint

One script change: install_terraform.sh

HashiCorp's apt repo sometimes publishes Terraform with a bare version (terraform=1.15.4) and sometimes with a Debian revision suffix (terraform=1.15.4-1). The script now tries the bare form first and falls back to <version>-1 on failure, so a single pinned semver in the Taskfile resolves either way.

This is the only installer-script change in this PR. Terraform is a high-value supply-chain target, so the small script tweak was preferred over either leaving Terraform unpinned or pushing apt-packaging knowledge into the YAML.

Why this PR is small

#281 bundled value pinning, installer-script normalization, _internal.Taskfile.yml v-prefix handling, and a full setup_pwsh.sh rewrite into one PR. Eighteen unaddressed reviewer comments later it was closed. This PR keeps only the value-pinning portion (plus the one Terraform-script fix above) so each remaining concern can be reviewed on its own merits in a focused follow-up.

Coverage after merge

  • CI pipelines: every install task invoked by .github/workflows/ (task runtime:setup:uv, task go:tools:test, task az:install:bicep, task tf:install:terraform, task go:install:govulncheck, task go:install:goreleaser, etc.) resolves to a fixed version, except actionlint and markdownlint-cli2 (see deferred list).
  • Linux and Windows dev machines: pinned for the 27 covered tools.
  • macOS via devcontainer: pinned (devcontainer is Linux-based, so it goes through the pinned Linux scripts).
  • Native macOS (no devcontainer): still goes through _install:brew, which maps formulas like bicep@0.43.8 that Homebrew does not publish. Native-macOS setup is expected to fail until phase 2 of ci: pin all tool versions in Taskfiles to specific releases instead of latest #277. The devcontainer is the supported macOS workflow today.

Deliberately left at latest (each tracked as a follow-up)

Tool Reason
pwsh setup_pwsh.sh dies on any non-latest value. Pinning requires the script rewrite (FU-3). CI uses runner-preinstalled pwsh, so this only affects dev machines.
actionlint install_actionlint.sh prepends v to numeric inputs, but upstream download-actionlint.bash requires bare X.Y.Z. Wrapper bug must be fixed first (FU-2).
markdownlint-cli2 internal:command:version precondition (grep -F against markdownlint-cli2 --help) doesn't match at the pinned value — needs version-check normalization first (FU-1).

Other deferred follow-ups

None introduce a new silent supply-chain regression in CI — they are either dev-machine-only, loud failures rather than silent latest fallback, or pre-existing behavior unchanged by this commit.

  • FU-1_internal.Taskfile.yml version normalization (strip v, try both forms)
  • FU-2 — installer-script v-prefix stripping in install_actionlint.sh, install_gh.sh, install_opentofu.sh
  • FU-3setup_pwsh.sh direct-download rewrite with SHA256 verification
  • FU-4 — Phase 2 of ci: pin all tool versions in Taskfiles to specific releases instead of latest #277: native-macOS supply-chain hardening (replace _install:brew with tagged-release downloaders)
  • FU-6_install:winget ignore_error: true: pre-existing soft-fail policy. A rejected winget --version X on windows-2025 could fall through to a pre-installed tool. Should be tightened in its own focused follow-up.
  • FU-7 — Renovate automation (renovate.json + inline # renovate: comments)
  • FU-8 — Top-of-map docblock pinning convention
  • FU-9 — Devcontainer feature pinning (.devcontainer/devcontainer.json)

What reviewers should focus on

  1. Are the 27 pinned values themselves correct (typos, mismatched v prefix)?
  2. Is the install_terraform.sh try-then-fallback acceptable, or should terraform=<ver>-1 be the canonical form / split into a separate Taskfile var?
  3. Is the "phase 1 / phase 2" split acceptable, or should ci: pin all tool versions in Taskfiles to specific releases instead of latest #277 not be referenced until macOS is also pinned?
  4. Are the three latest exceptions adequately justified in the deferred table?

This PR intentionally does not address: any other installer script, _internal.Taskfile.yml, setup_pwsh.sh, devcontainer, Renovate, or docblocks. Comments about those are welcome but will be acted on in the linked follow-ups, not here.

Refs #277.


Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

@maniSbindra maniSbindra requested a review from a team as a code owner May 29, 2026 07:36
@maniSbindra maniSbindra requested a review from Copilot May 29, 2026 07:38

Copilot AI 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.

Pull request overview

This PR is part of issue #277 and aims to improve CI/dev reproducibility and supply-chain safety by replacing latest tool installs in Taskfiles with explicit, pinned versions (Linux + Windows first, with some macOS paths intentionally deferred).

Changes:

  • Replaced latest with concrete versions across 9 Taskfile *_VERSION maps (covering 29 tools).
  • Ensured Task targets invoked by GitHub Actions resolve to fixed tool versions (per PR description).
  • Left pwsh as latest intentionally due to current installer-script constraints.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.taskfiles/yaml.Taskfile.yml Pins yamllint to a specific version.
.taskfiles/terraform.Taskfile.yml Pins Terraform/OpenTofu versions in the Taskfile map.
.taskfiles/shell.Taskfile.yml Pins shellcheck and shfmt versions.
.taskfiles/runtime.Taskfile.yml Pins runtime tooling versions (uv, fnm, golang), keeps pwsh at latest.
.taskfiles/markdown.Taskfile.yml Pins markdown tool versions used for lint/formatting.
.taskfiles/javascript.Taskfile.yml Pins prettier version used for lint/formatting.
.taskfiles/golang.Taskfile.yml Pins Go toolchain-related utilities (linters/tools) to specific versions.
.taskfiles/github.Taskfile.yml Pins GitHub workflow/action tooling versions.
.taskfiles/azure.Taskfile.yml Pins Azure tooling versions (az, azd, bicep).

Comment thread .taskfiles/terraform.Taskfile.yml
@maniSbindra maniSbindra force-pushed the ci/pin-taskfile-tool-versions-277-v2 branch from 1e0efac to 853dbd9 Compare May 29, 2026 07:46
Refs #277. Replaces `latest` with concrete semver in 9 Taskfile
*_VERSION maps (27 of 30 tools pinned; pwsh, actionlint, and
markdownlint-cli2 deliberately left at latest — see deferred list).
Pinned values match those proposed in closed PR #281.

Also tightens `.taskfiles/scripts/install_terraform.sh` to handle
HashiCorp's apt packaging: the repo sometimes publishes the bare
upstream version (`terraform=1.15.4`) and sometimes a Debian
revision (`terraform=1.15.4-1`). The script now tries the bare
form first and falls back to the `-1` form so a single pinned
semver in the Taskfile resolves either way. This is the only
script change in this PR; it is included because Terraform is a
high-value supply-chain target and leaving it unpinned would
substantially weaken the change.

Coverage after this commit
  - 27 of 30 CI-reachable install paths are pinned. Every
    `task …` install target invoked by .github/workflows/
    resolves to a fixed version except for actionlint and
    markdownlint-cli2 (see deferred list).
  - Linux and Windows developer machines: pinned for 27 tools.
  - macOS developers using the repo's devcontainer: pinned for
    27 tools (devcontainer is Linux-based).
  - macOS developers running tasks natively on the host: still
    use `_install:brew`, which today maps to formula names like
    `bicep@0.43.8` that Homebrew does not publish. Native-macOS
    setup is therefore expected to fail until phase 2 of #277
    replaces the brew path; the devcontainer is the supported
    macOS workflow in the meantime.

Explicitly out of scope (deferred to follow-ups). None introduces
a new silent supply-chain regression in CI:
  - actionlint kept at `latest` because install_actionlint.sh
    prepends a `v` prefix that upstream download-actionlint.bash
    rejects — wrapper bug must be fixed first (FU-2)
  - markdownlint-cli2 kept at `latest` because the
    internal:command:version precondition (`grep -F` against
    `markdownlint-cli2 --help`) fails at the pinned value and
    needs version-check normalization first (FU-1)
  - pwsh kept at `latest` because setup_pwsh.sh `die`s on any
    non-`latest` value; pinning pwsh requires the script rewrite
    tracked alongside SHA verification (FU-3)
  - _internal.Taskfile.yml v-prefix normalization (FU-1)
  - installer-script v-prefix stripping (FU-2)
  - setup_pwsh.sh direct-download with SHA verification (FU-3)
  - _install:winget `ignore_error: true` pre-existing soft-fail
  - Native-macOS supply-chain hardening / phase 2 of #277
  - Renovate automation (FU-7)
  - Top-of-map docblock convention (FU-8)
  - Devcontainer feature pinning (FU-9)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maniSbindra maniSbindra force-pushed the ci/pin-taskfile-tool-versions-277-v2 branch from 853dbd9 to aa2e5de Compare May 29, 2026 11:04
@maniSbindra maniSbindra requested a review from Copilot May 29, 2026 11:12

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@maniSbindra maniSbindra added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit 77b9ebb May 29, 2026
18 checks passed
@maniSbindra maniSbindra deleted the ci/pin-taskfile-tool-versions-277-v2 branch May 29, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants