Add Terraform fmt, validate, and fixture-plan PR check for infra/** - #13
Merged
Merged
Conversation
PRs that touch infra/** now run terraform fmt -check and the existing offline env-gate script (validate + terraform test). No apply, no Azure credentials, and no real secrets — enable_tls=true plans use example.test and TEST-NET-1 placeholders. Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
Offline env-gate now plans enable_tls=true with placeholder Entra UUIDs: empty viewer list, one viewer, skip when the ID is also an admin, and skip when it matches the apply-principal stand-in. Still no apply. Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
cursor
Bot
force-pushed
the
cursor/terraform-pr-ci-270c
branch
from
September 15, 2026 14:12
58b18e1 to
83ae1ee
Compare
cookieofcode
marked this pull request as ready for review
September 15, 2026 14:13
Path filters now live in a Paths job, not on pull_request.paths, so a required Terraform status is green on app-only PRs instead of pending. Infra and this workflow still run fmt, validate, and env-gate plans. Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
Keep the Azure LB /healthz probe note from #14 and the Terraform CI check wording from this PR. Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a lean GitHub Actions PR check so every PR to
mainreports a Terraform status: run fmt / validate / offline plan wheninfra/**(or this workflow) changed, or succeed with an explicit skip otherwise. Never apply.New workflow:
.github/workflows/terraform.yml(same style asci.ymlplus the PR #12 e2e path pattern).Required-check fix (Quality should-fix)
on.pull_request.pathswas removed. Path filters live in aPathsjob (same idea as PR #12’s e2echangesjob): list PR files viagh api, setterraform=trueonly forinfra/**and.github/workflows/terraform.yml. The job named Terraform always runs (if: always() && !cancelled()):terraform fmt -check+infra/azure/scripts/check-env-gates.shWhat a run covers
check-env-gates.sh:terraform init -backend=false+validateon the workload root andbootstrap/terraform test(command = plan) ininfra/azure/tests/env-gate/variables.tf/locals.tf/identity.tfviewer skip / the TLS-onload_balancer_ip = nullexpression from PR Use null for Service load_balancer_ip to unblock TLS enable_tls plan #11No
terraform apply. No Azure login, OIDC, backend, or Key Vault.Env-gate: wired, not duplicated
Quality noted
infra/azure/tests/env-gatewas unused by PR CI. Reuse is clean: the script already validates both roots and plans the provider-free gate module. A second parallel test root would only drift.A full
terraform planofinfra/azure/is not in this check. That still needsaz loginand a real Key Vault (ephemeral.azurerm_key_vault_secretcannot be mocked). Accepted gap.Fixtures (no real secrets)
Plan runs with
enable_tls=true(hostnameci.example.test, reserved test TLD):prod_tls_enabled_plansload_balancer_ipis null (not""); emptyaks_viewer_user_object_idsdev0_tls_enabled_plansviewer_one_fixture_idviewer_skipped_when_adminaks_admin_user_object_idsis skippedviewer_skipped_when_apply_principalPlaceholder Entra UUIDs only (
…0000a1admin,…0000b2viewer,…0000c3apply principal). HTTP fixture IP is192.0.2.10(TEST-NET-1 / RFC 5737). No subscription IDs, real object IDs, Key Vault names, or ACME accounts.FinOps
No Azure resources added or resized. No cost report in this PR (CI YAML + offline tests only).
Why
After PR #11 (
enable_tls=truebroke plan on empty-stringload_balancer_ip), Quality flagged that CI was Lint & Build / Playwright only — no Terraform seam. PR #10 addedaks_viewer_user_object_idsskip-when-admin. Quality then asked that the check always report (skip vs run) so it can be a required merge check without blocking app-only PRs. Apply stays gated.