ci(infrastructure): add terraform fmt and validate reusable CI workflow#293
Merged
Conversation
- create Invoke-TerraformValidation.ps1 with format check and per-directory validation - create terraform-validation.yml reusable workflow with soft-fail and changed-files-only - wire into pr-validation.yml and main.yml orchestrators with soft-fail rollout - add terraform-validation to release-please needs gate 🔧 - Generated by Copilot
…ferences - add Invoke-TerraformValidation npm script entry and Pester tests - fix single-item array handling in Invoke-TerraformValidation.ps1 with @() wrapping - update docs and copilot-instructions to use npm run lint:tf:validate - update boolean prefix convention to should_ in infrastructure-style.md - gitignore dependency-pinning-artifacts/ and remove tracked artifact 🔧 - Generated by Copilot
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #293 +/- ##
=====================================
Coverage 9.79% 9.79%
=====================================
Files 29 29
Lines 3881 3881
Branches 497 497
=====================================
Hits 380 380
Misses 3491 3491
Partials 10 10
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
🔧 - Generated by Copilot
This was referenced Mar 17, 2026
WilliamBerryiii
approved these changes
Mar 17, 2026
13 tasks
katriendg
added a commit
that referenced
this pull request
Mar 18, 2026
…#299) Clarify issue assignment requirement before starting work. Two contributors independently opened PRs for the same issue (#288 → #293 and #294) because the contribution workflow didn't require issue assignment before starting work. Add step 1 to PR Workflow in `docs/contributing/contribution-workflow.md`: "Check the issue is open and unassigned" — request assignment via comment before starting work. Covers both "already assigned" and `needs-triage` edge cases. Renumbers existing steps 2–9 and updates `ms.date`. The new step reads: ```markdown 1. **Check the issue is open and unassigned.** Comment on the issue to request assignment before starting any work. Maintainers will assign you when confirmed. * If the issue is already assigned to someone, do not open a competing PR without first coordinating with the assignee or a maintainer. * Issues labelled `needs-triage` are not ready to be picked up. You are welcome to comment your interest in being assigned — maintainers will follow up once triage is complete. ``` ## Type of Change - [x] 📚 Documentation update ## Component(s) Affected - [x] `docs/` - Documentation ## Testing Performed - [x] `npm run lint:md` passes with 0 errors - [x] `cspell` spell check passes with 0 issues ## Documentation Impact - [x] Documentation updated in this PR ## Checklist - [x] My code follows the [project conventions](copilot-instructions.md) - [x] Commit messages follow [conventional commit format](instructions/commit-message.instructions.md) - [x] I have performed a self-review - [x] Documentation impact assessed above - [x] No new linting warnings introduced Closes #295 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: katriendg <838216+katriendg@users.noreply.github.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.
Description
Adds automated
terraform fmtandterraform validateenforcement to the CI pipeline, closing the last gap in Terraform quality checks. TFLint was added in #229 but formatting and validation remained manual-only. This PR adds a reusable workflow that runs both checks on every PR and main branch push.Closes #288
Implementation
A new PowerShell script (
Invoke-TerraformValidation.ps1) runsterraform fmt -check -recursiveacross all Terraform files andterraform init -backend=false && terraform validatein each of the four deployment directories (.,vpn/,dns/,automation/). Thechanged-files-onlyworkflow input scopes PR validation to directories with modified.tfor.tfvarsfiles, skipping unaffected directories.Both
pr-validation.ymlandmain.ymlwire in the workflow withsoft-fail: true, matching the pattern used byterraform-lint.yml. Thelint:tf:validatenpm script exposes the same check locally.Files changed
.github/workflows/terraform-validation.ymlshared/ci/linting/Invoke-TerraformValidation.ps1shared/ci/tests/Invoke-TerraformValidation.Tests.ps1.github/workflows/pr-validation.yml.github/workflows/main.ymlpackage.jsonlint:tf:validatescript.gitignoredependency-pinning-artifacts/docs/contributing/(3 files)npm run lint:tf:validate.github/copilot-instructions.mdType of Change
Component(s) Affected
infrastructure/terraform/prerequisites/- Azure subscription setupinfrastructure/terraform/- Terraform infrastructureinfrastructure/setup/- OSMO control plane / Helmworkflows/- Training and evaluation workflowstraining/- Training pipelines and scriptsdocs/- DocumentationTesting Performed
planreviewed (no unexpected changes)applytested in dev environmentsmoke_test_azure.py)Pester tests (
npm run test:ps) passed. No Azure credentials required —terraform init -backend=falseskips all remote backend calls. Terraformplanis not applicable to CI workflow and script changes.Documentation Impact
Checklist
Note
Also updated
.gitignoreto not track files in the ephemeral folder./dependency-pinning-artifacts/