Skip to content

fix(ci): pin tflint plugin verification to pgp to unblock linting - #61

Merged
JacobPEvans-personal merged 2 commits into
mainfrom
fix/tflint-plugin-verification
Jul 17, 2026
Merged

fix(ci): pin tflint plugin verification to pgp to unblock linting#61
JacobPEvans-personal merged 2 commits into
mainfrom
fix/tflint-plugin-verification

Conversation

@JacobPEvans-personal

Copy link
Copy Markdown
Member

Summary

Every PR touching .tf is currently blocked at the Merge Gate. The cause is
outside this repo: GitHub removed the bundle field from attestation API
responses (documented breaking change),
so tflint >= 0.61 hits a nil pointer dereference in sigstore-go while
verifying the ruleset plugin's attestation during tflint --init.

The crash happens while downloading the plugin — before tflint reads a single
line of Terraform. Upstream issue: terraform-linters/tflint#2591.

This sets signature = "pgp" on the plugin block, which still verifies the
plugin cryptographically
via the legacy signing key. It is deliberately not
signature = "none", which would skip verification entirely and emit
"disabling verification can pose security risks".

Why this is temporary

The real fix is terraform-linters/tflint#2593
("fetch attestation bundles from bundle_url"), currently open and
unreleased
. The config carries a dated comment to revert to the default
auto mode once that ships.

Verification

Reproduced and verified against tflint v0.63.1 — the version CI resolves
via tflint_version: latest:

Config Result
default (auto) Panic: runtime error: invalid memory address or nil pointer dereference
signature = "pgp" Installed + lint exits 0

This PR's own CI Gate run is the real test: if the Terraform job goes green,
the fix works.

Cost impact

Free. Config-only change to a linter already running in CI. No GitHub
feature enabled, no per-seat cost, no change to Actions minutes (this repo is
public, so Actions are exempt).

Follow-up (not in this PR)

ci-gate.yml pins the action by SHA but passes tflint_version: latest, so
an upstream release can turn every PR red with no change to this repo. Worth
pinning to a known-good >= 0.61 separately.

GitHub removed the `bundle` field from attestation API responses, so
tflint >=0.61 nil-derefs during `tflint --init` while verifying the
ruleset plugin. The crash happens during plugin download, before any
linting runs, so every PR touching .tf is blocked at the Merge Gate.

Pin `signature = "pgp"`, which still verifies the plugin
cryptographically via the legacy signing key rather than skipping
verification. Marked TEMPORARY with the upstream issue to revert once
terraform-linters/tflint#2593 ships.

Verified against tflint v0.63.1 (the version CI resolves): init
succeeds and lint exits 0.
Copilot AI review requested due to automatic review settings July 17, 2026 03:13
The terraform path filter covered **.tf and the lock file but not the
linter's own config, so a change to .tflint.hcl skipped the Terraform job
entirely -- meaning a tflint config change could never be validated by the
job that runs tflint.

Without this, the signature fix in the previous commit merges with the
Terraform job SKIPPED and no proof it works.

Copilot AI left a comment

Copy link
Copy Markdown

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 unblocks the CI merge gate for Terraform changes by configuring the tflint-ruleset-terraform plugin to use PGP signature verification instead of the default auto mode, avoiding a known upstream crash triggered by GitHub’s attestation API breaking change.

Changes:

  • Pin the terraform plugin verification mode to signature = "pgp" to avoid the auto-mode attestation verification panic.
  • Add a dated, explicit revert note documenting when/why this should be removed once the upstream fix is released.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JacobPEvans-personal
JacobPEvans-personal merged commit 0340a3f into main Jul 17, 2026
6 checks passed
JacobPEvans-personal added a commit that referenced this pull request Jul 17, 2026
…#67)

The Copilot review ruleset from #60 was scoped via the gitflow custom
property -- all 9 gitflow-tagged repos, and it grows automatically as
more repos opt into gitflow. That ruleset was never applied (tofu apply
was left as an operator step and never run), but the org has already
exhausted its Copilot review capacity from unrelated usage. With 0
assigned Copilot seats, every review bills AI credits directly with no
pooled allowance -- property-based scoping is the wrong shape for a
budget that's already tight.

Replace it with an explicit (branch, repo-list) target model, mirroring
merge-gate.tf's existing for_each-over-buckets pattern rather than
inventing a new one. Starting scope: just ansible-proxmox-apps on
develop, in the new config/copilot-review.yml. Growing the pilot is a
one-line YAML edit, never a broader property match.

Since nothing was ever applied, this is a clean replacement: no import,
no moved block, no state migration. The enforcement variable is renamed
org_gitflow_copilot_review_enforcement -> org_copilot_review_enforcement
since it's no longer gitflow-tied (safe -- variables aren't in state).

Verified: tofu fmt/validate pass; tflint passes against v0.63.1 (the
version CI resolves, via the signature = "pgp" pin from #61/#64).
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