Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell/general-technical.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ gitops
gmail
GMSH
golang
golangci
google
googlecloud
gpu
Expand Down
3 changes: 2 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Run `npm install` (or `npm ci`) before any `npm run` lint commands. `shellcheck`
| `*.md` | `npm run lint:md`, `npm run spell-check`, `npm run format:tables` |
| `*.tf`, `*.tfvars` | `npm run lint:tf`, `npm run lint:tf:validate`, `terraform plan` |
| `*.tftest.hcl` | `npm run test:tf`, `cd infrastructure/terraform/modules/<name> && terraform test` or `cd infrastructure/terraform && terraform test` |
| `*.go` | `npm run lint:go` (golangci-lint), `npm run test:go` (`go test`) |
| `*.sh` | `shellcheck <file>` |
| `*.ps1` | `npm run lint:ps` |
| `*.yml` (GitHub Actions) | `npm run lint:yaml` |
Expand All @@ -188,7 +189,7 @@ Run `npm install` (or `npm ci`) before any `npm run` lint commands. `shellcheck`

### Linting

* `npm run lint:all` runs `lint:md` + `lint:ps` + `lint:links` + `lint:yaml` + `lint:tf` in sequence
* `npm run lint:all` runs `lint:md` + `lint:ps` + `lint:links` + `lint:yaml` + `lint:tf` + `lint:go` in sequence
* `npm run spell-check` and `npm run format:tables` are NOT included in `lint:all` — run them separately
* `npm run lint:md:fix` and `npm run format:tables` auto-fix markdown issues
* `.copilot-tracking/` is excluded from markdown linting via `.markdownlint-cli2.jsonc`
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Go Lint

on:
workflow_call:
inputs:
soft-fail:
description: 'Whether to continue on Go lint failures'
required: false
type: boolean
default: false
changed-files-only:
description: 'Only lint when Go files changed'
required: false
type: boolean
default: false

permissions:
contents: read

defaults:
run:
shell: pwsh

jobs:
go-lint:
name: Go Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: ${{ inputs.changed-files-only && '0' || '1' }}

- name: Create logs directory
run: New-Item -ItemType Directory -Force -Path logs | Out-Null

- name: Setup Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: infrastructure/terraform/e2e/go.mod
cache-dependency-path: infrastructure/terraform/e2e/go.mod

- name: Run Go lint
id: go-lint
continue-on-error: ${{ inputs.soft-fail }}
run: |
$params = @{}
if ('${{ inputs.changed-files-only }}' -eq 'true') {
$params['ChangedFilesOnly'] = $true
}
./shared/ci/linting/Invoke-GoLint.ps1 @params

- name: Upload Go lint results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: go-lint-results
path: logs/go-lint-results.json
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
soft-fail:
description: 'Whether to continue on Go test or lint failures'
description: 'Whether to continue on Go test failures'
required: false
type: boolean
default: false
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,16 @@ jobs:
contents: read
id-token: write

# Go tests (golangci-lint + go test)
# Go linting using golangci-lint
go-lint:
name: Go Lint
uses: ./.github/workflows/go-lint.yml
with:
soft-fail: true
permissions:
contents: read

# Go tests
go-tests:
name: Go Tests
uses: ./.github/workflows/go-tests.yml
Expand Down Expand Up @@ -202,6 +211,7 @@ jobs:
- terraform-lint
- terraform-validation
- terraform-tests
- go-lint
- go-tests
- codeql-analysis
name: Release Please
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,17 @@ jobs:
contents: read
id-token: write

# Go tests (golangci-lint + go test)
# Go linting using golangci-lint
go-lint:
name: Go Lint
uses: ./.github/workflows/go-lint.yml
with:
soft-fail: true
changed-files-only: true
permissions:
contents: read

# Go tests
go-tests:
name: Go Tests
uses: ./.github/workflows/go-tests.yml
Expand Down
3 changes: 2 additions & 1 deletion docs/contributing/contribution-workflow.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 4
title: Contribution Workflow
description: How to contribute including legal requirements, bug reports, enhancement suggestions, and documentation improvements
author: Microsoft Robotics-AI Team
ms.date: 2026-03-18
ms.date: 2026-03-25
ms.topic: how-to
keywords:
- contributing
Expand Down Expand Up @@ -170,6 +170,7 @@
| Full infrastructure changes | Deployment testing in dev subscription with cost estimate and teardown confirmation |
| Training scripts | AzureML job submission in test workspace with logs |
| Workflow templates | Workflow execution validation with job outputs |
| Go modules | `npm run lint:go` (golangci-lint), `npm run test:go` (`go test`) |
| Configuration manifests | Syntax validation, test deployment in non-production cluster |

### Testing Documentation
Expand Down
20 changes: 19 additions & 1 deletion docs/contributing/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 6
title: Prerequisites and Build Validation
description: Required tools, Azure access, NGC credentials, and build validation commands for contributing
author: Microsoft Robotics-AI Team
ms.date: 2026-02-08
ms.date: 2026-03-25
ms.topic: how-to
keywords:
- prerequisites
Expand Down Expand Up @@ -33,6 +33,8 @@ Install these tools before contributing:
| Python | 3.11+ | <https://www.python.org/downloads/> |
| shellcheck | 0.10+ | <https://www.shellcheck.net/> |
| uv | latest | <https://docs.astral.sh/uv/> |
| Go | 1.24+ | <https://go.dev/dl/> |
| golangci-lint | 2.11+ | <https://golangci-lint.run/welcome/install/> |
| Docker | latest | <https://docs.docker.com/get-docker/> (with NVIDIA Container Toolkit) |
| OSMO CLI | latest | <https://developer.nvidia.com/osmo> |
| hve-core | latest | <https://github.com/microsoft/hve-core> |
Expand Down Expand Up @@ -130,6 +132,12 @@ shellcheck --version # >= 0.10
# uv (Python package manager)
uv --version

# Go
go version # >= 1.24

# golangci-lint
golangci-lint version # >= 2.11

# Docker with NVIDIA Container Toolkit
docker --version
nvidia-ctk --version
Expand Down Expand Up @@ -167,6 +175,16 @@ tflint --recursive infrastructure/terraform/
shellcheck deploy/**/*.sh scripts/**/*.sh
```

**Go:**

```bash
# Lint Go modules (required for Go changes)
npm run lint:go

# Test Go modules (required for Go changes)
npm run test:go
```

**Documentation:**

```bash
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"lint:md:fix": "markdownlint-cli2 \"**/*.md\" --fix",
"lint:ps": "pwsh -File shared/ci/linting/Invoke-PSScriptAnalyzer.ps1",
"lint:links": "pwsh -File shared/ci/linting/Invoke-LinkLanguageCheck.ps1",
"lint:go": "pwsh -File shared/ci/linting/Invoke-GoLint.ps1",
"lint:yaml": "pwsh -File shared/ci/linting/Invoke-YamlLint.ps1",
"lint:tf": "pwsh -File shared/ci/linting/Invoke-TFLint.ps1",
"lint:tf:validate": "pwsh -File shared/ci/linting/Invoke-TerraformValidation.ps1",
"lint:all": "npm run lint:md && npm run lint:ps && npm run lint:links && npm run lint:yaml && npm run lint:tf",
"lint:all": "npm run lint:md && npm run lint:ps && npm run lint:links && npm run lint:yaml && npm run lint:tf && npm run lint:go",
"format:tables": "markdown-table-formatter \"**/*.md\"",
"test:ps": "pwsh -File ./shared/ci/tests/Invoke-PesterTests.ps1",
"test:tf": "pwsh -File shared/ci/linting/Invoke-TerraformTest.ps1",
Expand Down
Loading
Loading