Skip to content
Merged
7 changes: 7 additions & 0 deletions .buildkite/scripts/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ function fixCRLF {

function withGolang($version) {
Write-Host "--- Install golang"
$latest_1_25_versions = @('1.25.8')
# not all latest Golang versions of 1.25.x are available since 1.26.0 is released
if ($version -in $latest_1_25_versions) {
Write-Host "$version not available in cholocatey, using 1.25.7"
# latest Golang version available for 1.25.x
$version = '1.25.7'
}
choco install -y golang --version $version
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.7
1.25.8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This version is not available in chocolatey, because there are already 1.26.x versions published.

https://community.chocolatey.org/packages/golang#versionhistory

We could add some workaround like this one
https://github.com/elastic/package-registry/pull/1425/changes#diff-c5e35c6e40d940300d332e3c9a1e3fa03c3f19d767b00e05166b9a7c19097b2dR13-R19

to install a specific version for the unit tests running in Windows.

WDYT @jsoriano @teresaromero ?

Other option, but I didn't test it, is to update the .buildkite/hooks/pre-command to allow use an environment variable in a given buildkite step.

That would mean to update this script:

echo "Golang version:"
version=$(cat .go-version)
export SETUP_GOLANG_VERSION="${version}"
echo "${SETUP_GOLANG_VERSION}"

To be something like this:

echo "Golang version:"
version=$(cat .go-version)
export SETUP_GOLANG_VERSION="${SETUP_GOLANG_VERSION:-$version}"
echo "${SETUP_GOLANG_VERSION}"

And then add the environment variable here:

- label: ":windows: Test on Windows"
key: test-win
command:
- ".buildkite/scripts/run-tests.ps1"
agents:
provider: "gcp"
image: "${WINDOWS_AGENT_IMAGE}"
artifact_paths:
- "tests-report-win.xml"

      - label: ":windows: Test on Windows"
        key: test-win
        command:
          - ".buildkite/scripts/run-tests.ps1"
        env:
          SETUP_GOLANG_VERSION: 1.25.7 
        agents:
          provider: "gcp"
          image: "${WINDOWS_AGENT_IMAGE}"
        artifact_paths:
          - "tests-report-win.xml"

The problem with this last approach is that it should be removed that environment variable once a 1.26.x version is set in .go-version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tried to use a different approached based on gvm (same tool that it is used in linux steps) to avoid these "ifs"

#1617

5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased](https://github.com/elastic/package-registry/compare/v1.36.0...main)
## [v1.37.0](https://github.com/elastic/package-registry/compare/v1.36.0...v1.37.0)

### Breaking changes

### Bugfixes

* Update Go runtime to 1.25.8 [1613](https://github.com/elastic/package-registry/pull/1613)

### Added

* Add `requires` field to package index and search responses so clients can inspect package dependencies (input and content) before downloading. [#1612](https://github.com/elastic/package-registry/pull/1612)
Expand All @@ -20,7 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Known Issues


## [v1.36.0](https://github.com/elastic/package-registry/compare/v1.35.0...v1.36.0)

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
)

const (
version = "1.36.1"
version = "1.37.0"
defaultInstanceName = "localhost"
)

Expand Down
2 changes: 1 addition & 1 deletion testdata/generated/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"service.name": "package-registry",
"service.version": "1.36.1"
"service.version": "1.37.0"
}