feat(build): split Go CI into separate lint and test pipelines#354
Open
feat(build): split Go CI into separate lint and test pipelines#354
Conversation
…tes and add Go testing instructions - update ms.date to 2026-03-25 in prerequisites and contribution workflow - add Go and golangci-lint installation instructions - include Go testing command in contribution workflow 🔧 - Generated by Copilot
- add Invoke-GoLint.ps1 with golangci-lint wrapper and SHA256-verified install - refactor Invoke-GoTest.ps1 to test-only, remove all lint logic - add go-lint.yml reusable workflow and wire into main.yml and pr-validation.yml - add lint:go npm script, update *.go quick reference in docs and copilot-instructions - add golangci to cspell dictionary 🔧 - Generated by Copilot
- include lint:go in lint:all command - update Invoke-GoLint.ps1 shebang for consistency - refactor Invoke-GoTest.ps1 for improved readability 🔧 - Generated by Copilot
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
=======================================
Coverage 43.58% 43.58%
=======================================
Files 242 242
Lines 14840 14840
Branches 1903 1903
=======================================
Hits 6468 6468
Misses 8082 8082
Partials 290 290
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
nguyena2
approved these changes
Mar 25, 2026
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
Split Go CI validation into dedicated lint and test pipelines to align with the established Terraform pattern, where linting (
tflint.yml) and validation/testing run as separate workflows and npm scripts. A discovery during #333 documentation work revealed that Go linting and testing were bundled in a singleInvoke-GoTest.ps1script andgo-tests.ymlworkflow — inconsistent with how every other toolchain in this repository separates these concerns.Extracted all golangci-lint logic from Invoke-GoTest.ps1 into a new Invoke-GoLint.ps1 script, added a dedicated go-lint.yml reusable workflow, wired it into both orchestrator workflows, introduced the
lint:gonpm script, and updated contributing documentation with Go tooling prerequisites.CI/CD Workflow Changes
The new go-lint.yml reusable workflow runs golangci-lint with configurable
soft-failandchanged-files-onlyinputs. Both main.yml and pr-validation.yml now callgo-lintas a separate job positioned beforego-tests, withsoft-fail: trueto prevent lint failures from blocking releases andchanged-files-only: truein PR validation for faster feedback.workflow_calltrigger andsoft-fail/changed-files-onlyinputsScript Extraction
Created Invoke-GoLint.ps1 as a standalone golangci-lint wrapper following established PowerShell conventions (shebang, copyright,
#Requires,CmdletBinding). The script includes SHA256-verified binary installation,go.modguard,ChangedFilesOnlyparameter, JSON results output, CI annotations, and step summary generation.shared/ci/linting/Invoke-GoLint.ps1with SHA256-verified golangci-lint install and lint executionshared/ci/linting/Invoke-GoTest.ps1to remove all lint logic, simplified pass/fail to test-onlylint_passedandgolangci_lint_versionfrom JSON output schema (breaking change)Test Suite
Added a comprehensive Pester test suite for the new lint script and decoupled lint-related tests from the existing test suite.
shared/ci/tests/linting/Invoke-GoLint.Tests.ps1with 17 tests across 6 contexts (tool availability, go.mod guard, ChangedFilesOnly, lint success/failure, output file creation)shared/ci/tests/linting/Invoke-GoTest.Tests.ps1by removing all golangci-lint mocks and lint-coupled test contextsDocumentation and Configuration
lint:gonpm script to package.json and integrated into thelint:allcommand chain*.govalidation entry in copilot-instructions.md with bothnpm run lint:goandnpm run test:goCloses #333
Closes #353
Type 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)Documentation Impact
Bug Fix Checklist
Complete this section for bug fix PRs. Skip for other contribution types.
Checklist