-
Notifications
You must be signed in to change notification settings - Fork 288
chore: bump Go 1.26.0 to 1.26.1 and add version management tooling #7488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a119748
chore: bump Go version from 1.26.0 to 1.26.1 across all modules
jongio 2a9cf15
chore: update ADO pipeline Go version and CONTRIBUTING.md
jongio c255c5e
chore: add Go version management tooling
jongio 998e617
chore: include testdata Go version in bump tooling
jongio 46a764a
chore: include devcontainer.json in Go version management
jongio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: validate-go-version | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "**/go.mod" | ||
| - "**/Dockerfile" | ||
| - ".devcontainer/devcontainer.json" | ||
| - "eng/pipelines/templates/steps/setup-go.yml" | ||
| - ".github/workflows/validate-go-version.yml" | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check-go-version-consistency: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Validate Go version consistency | ||
| run: | | ||
| # Source of truth: cli/azd/go.mod | ||
| EXPECTED=$(grep -m1 '^go ' cli/azd/go.mod | awk '{print $2}') | ||
| echo "Expected Go version (from cli/azd/go.mod): $EXPECTED" | ||
|
|
||
| ERRORS=0 | ||
|
|
||
| # Check all go.mod files | ||
| echo "" | ||
| echo "Checking go.mod files..." | ||
| for f in $(find cli/azd -name 'go.mod'); do | ||
| VERSION=$(grep -m1 '^go ' "$f" | awk '{print $2}') | ||
| if [ "$VERSION" != "$EXPECTED" ]; then | ||
| echo "::error file=$f::Go version mismatch: found '$VERSION', expected '$EXPECTED'" | ||
| ERRORS=$((ERRORS + 1)) | ||
| else | ||
| echo " OK: $f ($VERSION)" | ||
| fi | ||
| done | ||
|
|
||
| # Check ADO pipeline template | ||
| echo "" | ||
| echo "Checking ADO pipeline template..." | ||
| ADO_FILE="eng/pipelines/templates/steps/setup-go.yml" | ||
| if [ -f "$ADO_FILE" ]; then | ||
| ADO_VERSION=$(grep -m1 'GoVersion:' "$ADO_FILE" | awk '{print $2}') | ||
| if [ "$ADO_VERSION" != "$EXPECTED" ]; then | ||
| echo "::error file=$ADO_FILE::GoVersion mismatch: found '$ADO_VERSION', expected '$EXPECTED'" | ||
| ERRORS=$((ERRORS + 1)) | ||
| else | ||
| echo " OK: $ADO_FILE ($ADO_VERSION)" | ||
| fi | ||
| fi | ||
|
|
||
| # Check Dockerfiles referencing golang:<version> base images | ||
| echo "" | ||
| echo "Checking Dockerfiles..." | ||
| for f in $(find cli/azd -name 'Dockerfile'); do | ||
| DOCKER_VERSION=$(grep -oP 'golang:\K[\d.]+' "$f" | head -1) | ||
| if [ -n "$DOCKER_VERSION" ] && [ "$DOCKER_VERSION" != "$EXPECTED" ]; then | ||
| echo "::error file=$f::Dockerfile golang version mismatch: found '$DOCKER_VERSION', expected '$EXPECTED'" | ||
| ERRORS=$((ERRORS + 1)) | ||
| elif [ -n "$DOCKER_VERSION" ]; then | ||
| echo " OK: $f (golang:$DOCKER_VERSION)" | ||
| fi | ||
| done | ||
|
|
||
| # Check devcontainer.json Go feature version | ||
| echo "" | ||
| echo "Checking devcontainer.json..." | ||
| DEVCONTAINER=".devcontainer/devcontainer.json" | ||
| if [ -f "$DEVCONTAINER" ]; then | ||
| DC_VERSION=$(grep -A1 'devcontainers/features/go' "$DEVCONTAINER" | grep -oP '"version":\s*"\K[\d.]+') | ||
| if [ -n "$DC_VERSION" ] && [ "$DC_VERSION" != "$EXPECTED" ]; then | ||
| echo "::error file=$DEVCONTAINER::devcontainer Go version mismatch: found '$DC_VERSION', expected '$EXPECTED'" | ||
| ERRORS=$((ERRORS + 1)) | ||
| elif [ -n "$DC_VERSION" ]; then | ||
| echo " OK: $DEVCONTAINER ($DC_VERSION)" | ||
| fi | ||
| fi | ||
|
|
||
| echo "" | ||
| if [ "$ERRORS" -gt 0 ]; then | ||
| echo "::error::$ERRORS Go version mismatch(es) found. Run 'pwsh eng/scripts/Update-GoVersion.ps1 -NewVersion $EXPECTED' to fix." | ||
| exit 1 | ||
| fi | ||
| echo "All Go versions are consistent ($EXPECTED)." |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module azureaiagent | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module azure.ai.finetune | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module azure.ai.models | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module azureappservice | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module azurecodingagent | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module concurx | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 | ||
|
|
||
| require ( | ||
| github.com/azure/azure-dev/cli/azd v1.23.13 | ||
|
|
||
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
2 changes: 1 addition & 1 deletion
2
cli/azd/test/functional/testdata/samples/containerappjob/src/job/Dockerfile
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
2 changes: 1 addition & 1 deletion
2
cli/azd/test/functional/testdata/samples/containerappjob/src/job/go.mod
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module containerappjob | ||
|
|
||
| go 1.23 | ||
| go 1.26.1 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| parameters: | ||
| GoVersion: 1.26.0 | ||
| GoVersion: 1.26.1 | ||
| Condition: succeeded() | ||
|
|
||
| steps: | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| param( | ||
| [Parameter(Mandatory = $true)] | ||
| [string] $NewVersion | ||
| ) | ||
|
|
||
| Set-StrictMode -Version 4 | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| $repoRoot = Resolve-Path "$PSScriptRoot/../../" | ||
|
|
||
| # Canonical source of truth | ||
| $coreGoMod = Join-Path $repoRoot 'cli/azd/go.mod' | ||
|
|
||
| # All go.mod files that should track the same Go version (including testdata samples). | ||
| $goModFiles = Get-ChildItem -Path (Join-Path $repoRoot 'cli/azd') -Recurse -Filter 'go.mod' | ||
|
|
||
| # ADO pipeline template that pins the Go toolchain version | ||
| $adoSetupGo = Join-Path $repoRoot 'eng/pipelines/templates/steps/setup-go.yml' | ||
|
|
||
| $updated = @() | ||
| $skipped = @() | ||
|
|
||
| # --- Update go.mod files --- | ||
| foreach ($file in $goModFiles) { | ||
| $content = Get-Content $file.FullName -Raw | ||
| if ($content -match '(?m)^go\s+\S+') { | ||
| $newContent = $content -replace '(?m)^go\s+\S+', "go $NewVersion" | ||
| if ($newContent -ne $content) { | ||
| Set-Content -Path $file.FullName -Value $newContent -NoNewline -Encoding utf8NoBOM | ||
| $updated += $file.FullName.Substring($repoRoot.Path.Length) | ||
| } else { | ||
| $skipped += $file.FullName.Substring($repoRoot.Path.Length) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # --- Update ADO pipeline template --- | ||
| if (Test-Path $adoSetupGo) { | ||
| $content = Get-Content $adoSetupGo -Raw | ||
| $newContent = $content -replace '(?m)^(\s+GoVersion:\s+)\S+', "`${1}$NewVersion" | ||
| if ($newContent -ne $content) { | ||
| Set-Content -Path $adoSetupGo -Value $newContent -NoNewline -Encoding utf8NoBOM | ||
| $updated += $adoSetupGo.Substring($repoRoot.Path.Length) | ||
| } else { | ||
| $skipped += $adoSetupGo.Substring($repoRoot.Path.Length) | ||
| } | ||
| } | ||
|
|
||
| # --- Update Dockerfiles referencing golang:<version> base images --- | ||
| $dockerfiles = Get-ChildItem -Path (Join-Path $repoRoot 'cli/azd') -Recurse -Filter 'Dockerfile' | ||
| foreach ($file in $dockerfiles) { | ||
| $content = Get-Content $file.FullName -Raw | ||
| if ($content -match 'golang:\d+\.\d+') { | ||
| $newContent = $content -replace 'golang:\d+[\d.]*', "golang:$NewVersion" | ||
| if ($newContent -ne $content) { | ||
| Set-Content -Path $file.FullName -Value $newContent -NoNewline -Encoding utf8NoBOM | ||
| $updated += $file.FullName.Substring($repoRoot.Path.Length) | ||
| } else { | ||
| $skipped += $file.FullName.Substring($repoRoot.Path.Length) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # --- Update devcontainer.json Go feature version --- | ||
| $devcontainer = Join-Path $repoRoot '.devcontainer/devcontainer.json' | ||
| if (Test-Path $devcontainer) { | ||
| $content = Get-Content $devcontainer -Raw | ||
| $newContent = $content -replace '("ghcr\.io/devcontainers/features/go:\d+":\s*\{\s*"version":\s*")[\d.]+(")', "`${1}$NewVersion`${2}" | ||
| if ($newContent -ne $content) { | ||
| Set-Content -Path $devcontainer -Value $newContent -NoNewline -Encoding utf8NoBOM | ||
| $updated += $devcontainer.Substring($repoRoot.Path.Length) | ||
| } else { | ||
| $skipped += $devcontainer.Substring($repoRoot.Path.Length) | ||
| } | ||
| } | ||
|
|
||
| # --- Report --- | ||
| Write-Host "" | ||
| if ($updated.Count -gt 0) { | ||
| Write-Host "Updated $($updated.Count) file(s) to Go $NewVersion`:" -ForegroundColor Green | ||
| $updated | ForEach-Object { Write-Host " $_" } | ||
| } else { | ||
| Write-Host "No files needed updating." -ForegroundColor Yellow | ||
| } | ||
|
|
||
| if ($skipped.Count -gt 0) { | ||
| Write-Host "" | ||
| Write-Host "Already at Go $NewVersion ($($skipped.Count) file(s)):" -ForegroundColor Cyan | ||
| $skipped | ForEach-Object { Write-Host " $_" } | ||
| } | ||
|
|
||
| Write-Host "" | ||
| Write-Host "Done. GitHub Actions workflows read the version from cli/azd/go.mod automatically." -ForegroundColor Green | ||
| Write-Host "Run 'git diff' to review changes before committing." -ForegroundColor Gray |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.