Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Q Workflow Optimization Report

Context

This PR addresses issue #14951, which reported CI failures related to Go toolchain download attempts. The CI Failure Doctor workflow identified that the runner could not download golang.org/toolchain due to network restrictions or availability issues.

Root Cause

The go.mod file specifies go 1.25.0, which triggers Go's automatic toolchain management. When the exact Go version isn't available locally, Go attempts to download it from golang.org/toolchain. In CI environments, this can fail due to:

  1. Network access restrictions
  2. The exact version not being available yet (Go 1.25 is very recent)
  3. Download timeouts or connectivity issues

Changes Made

Added GOTOOLCHAIN: local environment variable to 9 Go-based CI jobs in .github/workflows/ci.yml:

Jobs Updated

  • test - Main unit test suite
  • integration - Integration test matrix
  • build - Binary build and validation
  • lint-go - Go linting with golangci-lint
  • fuzz - Fuzz testing (main branch only)
  • security-scan - Security scanning (main branch only)
  • mcp-server-compile-test - MCP server compilation validation
  • cross-platform-build - macOS and Windows builds
  • alpine-container-test - Alpine Linux container testing

How It Works

Setting GOTOOLCHAIN=local instructs Go to use the locally installed toolchain version (from actions/setup-go@v6) instead of attempting to download a newer version. This:

  • ✅ Eliminates network-dependent Go toolchain downloads
  • ✅ Ensures consistent Go version across all CI jobs
  • ✅ Prevents authentication and download failures
  • ✅ Speeds up CI by removing download attempts
  • ✅ Maintains compatibility with go.mod requirements

Expected Impact

Before

❌ Failed to download Go modules after 3 attempts
❌ golang.org/toolchain download blocked
❌ CI jobs fail intermittently

After

✅ Uses Go version from actions/setup-go@v6
✅ No network downloads for toolchain
✅ Consistent, reliable CI runs

Validation

  • ✅ YAML syntax validated with Python yaml parser
  • ✅ All 9 jobs now include env: GOTOOLCHAIN: local
  • ✅ No functional changes to test behavior
  • ✅ Changes are additive and non-breaking (18 lines added)

References

  • Go Documentation: GOTOOLCHAIN environment variable
  • Root Cause: Go automatic toolchain management attempting downloads
  • Prevention: Setting GOTOOLCHAIN=local disables automatic downloads

Testing Strategy

CI will automatically validate these changes:

  1. All Go jobs should complete successfully
  2. No toolchain download attempts in logs
  3. Tests pass using locally installed Go version
  4. Build artifacts generate correctly

Note: This is a targeted fix that addresses the specific CI failure without changing test behavior or Go version requirements. The workflow will continue to use the Go version specified in go.mod, but will rely on the version installed by actions/setup-go@v6 instead of attempting downloads.

AI generated by Q

  • expires on Feb 13, 2026, 1:38 PM UTC
Original prompt

This section details on the original issue you should resolve

<issue_title>[q] CI: Add GOTOOLCHAIN=local to prevent automatic toolchain downloads</issue_title>
<issue_description># Q Workflow Optimization Report

Context

This PR addresses issue #14951, which reported CI failures related to Go toolchain download attempts. The CI Failure Doctor workflow identified that the runner could not download golang.org/toolchain due to network restrictions or availability issues.

Root Cause

The go.mod file specifies go 1.25.0, which triggers Go's automatic toolchain management. When the exact Go version isn't available locally, Go attempts to download it from golang.org/toolchain. In CI environments, this can fail due to:

  1. Network access restrictions
  2. The exact version not being available yet (Go 1.25 is very recent)
  3. Download timeouts or connectivity issues

Changes Made

Added GOTOOLCHAIN: local environment variable to 9 Go-based CI jobs:

Jobs Updated

  • test - Main unit test suite
  • integration - Integration test matrix
  • build - Binary build and validation
  • lint-go - Go linting with golangci-lint
  • fuzz - Fuzz testing (main branch only)
  • security-scan - Security scanning (main branch only)
  • mcp-server-compile-test - MCP server compilation validation
  • cross-platform-build - macOS and Windows builds
  • alpine-container-test - Alpine Linux container testing

How It Works

Setting GOTOOLCHAIN=local instructs Go to use the locally installed toolchain version (from actions/setup-go@v6) instead of attempting to download a newer version. This:

  • ✅ Eliminates network-dependent Go toolchain downloads
  • ✅ Ensures consistent Go version across all CI jobs
  • ✅ Prevents authentication and download failures
  • ✅ Speeds up CI by removing download attempts
  • ✅ Maintains compatibility with go.mod requirements

Expected Impact

Before

❌ Failed to download Go modules after 3 attempts
❌ golang.org/toolchain download blocked
❌ CI jobs fail intermittently
```

### After
```
✅ Uses Go version from actions/setup-go@v6
✅ No network downloads for toolchain
✅ Consistent, reliable CI runs

Validation

  • ✅ YAML syntax validated with Python yaml parser
  • ✅ All jobs now include env: GOTOOLCHAIN: local
  • ✅ No functional changes to test behavior
  • ✅ Changes are additive and non-breaking

References

Testing Strategy

CI will automatically validate these changes:

  1. All Go jobs should complete successfully
  2. No toolchain download attempts in logs
  3. Tests pass using locally installed Go version
  4. Build artifacts generate correctly

Note: This is a targeted fix that addresses the specific CI failure without changing test behavior or Go version requirements. The workflow will continue to use the Go version specified in go.mod, but will rely on the version installed by actions/setup-go@v6 instead of attempting downloads.

AI generated by Q

  • expires on Feb 13, 2026, 1:38 PM UTC

[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/github/gh-aw/actions/runs/21906996052
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 21906996052 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch preview (118 of 118 lines)
From 38a5698343888fba28a6eedd39adec79011e2b31 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Wed, 11 Feb 2026 13:35:21 +0000
Subject: [PATCH] ci: add GOTOOLCHAIN=local to prevent automatic toolchain
 downloads

Fixes github/gh-aw#14951

Adds GOTOOLCHAIN=local environment variable to all Go-based CI jobs
to prevent Go from attempting to download newer toolchains from
golang.org/toolchain when the go.mod specifies go 1.25.0.

This ensures CI uses the Go version installed by actions/setup-go@v6
without network-dependent downloads that can fail or timeout.

Jobs updated:
- test
- integration
- build
- lint-go
- fuzz...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes github/gh-aw#14956

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/github/gh-aw/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

@pelikhan
Copy link
Contributor

@copilot Keep working

Copy link
Contributor Author

Copilot AI commented Feb 11, 2026

@copilot Keep working

I've successfully added GOTOOLCHAIN: local to all 9 Go-based CI jobs in .github/workflows/ci.yml. This prevents Go from attempting to download toolchains from golang.org/toolchain, which was causing CI failures.

Commit: adb9225

Jobs updated:

  • test, integration, build, lint-go, fuzz, security-scan, mcp-server-compile-test, cross-platform-build, alpine-container-test

The changes have been validated:

  • ✅ YAML syntax is valid
  • ✅ All 9 jobs confirmed to have the environment variable
  • ✅ Changes are minimal and non-breaking

CI will now use the Go version installed by actions/setup-go@v6 instead of attempting downloads.

Copilot AI changed the title [WIP] [q] CI: Add GOTOOLCHAIN=local to prevent automatic toolchain downloads CI: Add GOTOOLCHAIN=local to prevent automatic toolchain downloads Feb 11, 2026
@pelikhan pelikhan marked this pull request as ready for review February 11, 2026 15:15
Copilot AI review requested due to automatic review settings February 11, 2026 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@pelikhan pelikhan closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI Failure Doctor] CI Failure Investigation - Run #34851

2 participants