Skip to content

[CI] Use GVM to install Golang on Windows#3377

Merged
mrodm merged 9 commits intoelastic:mainfrom
mrodm:update_windows_ci
Mar 16, 2026
Merged

[CI] Use GVM to install Golang on Windows#3377
mrodm merged 9 commits intoelastic:mainfrom
mrodm:update_windows_ci

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Mar 13, 2026

This PR replaces Chocolatey-based Go installation with GVM in Windows CI steps, matching the approach used in package-registry#1617.

The shared PowerShell functions (fixCRLF, ensureBinPath, withGolang) have been extracted into a new common_windows.ps1 file, dot-sourced by both unit_tests_windows.ps1 and stack_tests_windows.ps1.

Motivation

Chocolatey does not always have the latest Go patch versions available (e.g. 1.25.8 was missing), which blocks CI when .go-version is bumped. GVM downloads Go directly from the official releases, avoiding this dependency on Chocolatey's package update cycle.

The SETUP_GVM_VERSION environment variable was already defined in .buildkite/pipeline.yml.

Changes

  • .buildkite/scripts/common_windows.ps1 (new): shared functions for CRLF fix, bin path setup, and GVM-based Go installation with retry logic.
  • .buildkite/scripts/unit_tests_windows.ps1: removed duplicated functions, dot-sources common_windows.ps1.
  • .buildkite/scripts/stack_tests_windows.ps1: removed duplicated functions, dot-sources common_windows.ps1. Docker/Docker Compose functions remain unchanged (still use Chocolatey).
  • test/packages/parallel/system/: added missing error.message field definition.

Author's Checklist

  • Verify Buildkite Windows CI step installs Go successfully via GVM.
  • Confirm the installed Go version matches .go-version (e.g. updating to 1.25.8).
  • Confirm stack and unit tests pass on the Windows step.
  • Update system test package to include error.message field definition.

References


Generated with the assistance of Cursor

@mrodm mrodm self-assigned this Mar 13, 2026
Comment on lines +52 to +53
- name: error.message
external: ecs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this field because of this error:

test case failed: one or more errors found in documents stored in metrics-system.process-96148 data stream: [0] field "error.message" is undefined

This is related to #3330 . Before the presence of this field error.message cause to fail the tests. As there is no event.kind , the field validator is executed and that field was not defined.

Example (buildkite link):

test case failed: one or more errors found in documents stored in metrics-system.process-63529 data stream: [0] found error.message in event: [non fatal error; reporting partial metrics: error fetching PID metrics for 1 processes, most likely a "permission denied" error. Enable debug logging to determine the exact cause.]

@mrodm mrodm marked this pull request as ready for review March 13, 2026 18:31
@mrodm mrodm requested a review from a team as a code owner March 13, 2026 18:31
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 13, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @mrodm

Copy link
Contributor

@teresaromero teresaromero left a comment

Choose a reason for hiding this comment

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

🪟 🚀

@mrodm mrodm merged commit c0bcd6c into elastic:main Mar 16, 2026
3 checks passed
@mrodm mrodm deleted the update_windows_ci branch March 16, 2026 11:12
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.

3 participants