Skip to content

Update Go version in tests to 1.25.0-rc.1 #19827

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 6 additions & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
pull_request:
paths:
- "go/**"
- "!go/documentation/**"
- "!go/documentation/**"
- "shared/**"
- .github/workflows/go-tests.yml
- .github/actions/**
Expand All @@ -31,10 +31,15 @@ jobs:
if: github.repository_owner == 'github'
name: Test Linux (Ubuntu)
runs-on: ubuntu-latest-xl
strategy:
fail-fast: false
matrix:
go-version: ['~1.24.0', '1.25.0-rc.1']
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
uses: ./go/actions/test
with:
run-code-checks: true
go-test-version: ${{ matrix.go-version }}
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local_path_override(
# see https://registry.bazel.build/ for a list of available packages

bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_go", version = "0.55.1-codeql.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
bazel_dep(name = "rules_python", version = "0.40.0")
Expand Down Expand Up @@ -233,7 +233,7 @@ use_repo(
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.0")
go_sdk.download(version = "1.25rc1")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//go/extractor:go.mod")
Expand Down
6 changes: 3 additions & 3 deletions go/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
go-test-version:
description: Which Go version to use for running the tests
required: false
default: "~1.24.0"
default: "1.25.0-rc.1"
run-code-checks:
description: Whether to run formatting, code and qhelp generation checks
required: false
Expand All @@ -17,11 +17,11 @@ runs:
using: composite
steps:
- name: Set up Go ${{ inputs.go-test-version }}
id: setup-go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-test-version }}
cache: false
id: go

- name: Set up CodeQL CLI
uses: ./.github/actions/fetch-codeql
Expand Down Expand Up @@ -65,7 +65,7 @@ runs:
if: inputs.run-code-checks == 'true' && !cancelled()
uses: actions/upload-artifact@v4
with:
name: qhelp-markdown
name: qhelp-markdown-${{ steps.setup-go.outputs.go-version }}
path: go/qhelp-out/**/*.md

- name: Cache compilation cache
Expand Down
2 changes: 1 addition & 1 deletion go/extractor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/github/codeql-go/extractor

go 1.24

toolchain go1.24.0
toolchain go1.25rc1

// when updating this, run
// bazel run @rules_go//go -- mod tidy
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module(
name = "rules_go",
# Updated by the Publish to BCR app.
version = "0.55.1-codeql.1",
compatibility_level = 0,
repo_name = "io_bazel_rules_go",
)

# The custom repo_name is used to prevent our bazel_features polyfill for WORKSPACE builds from
# conflicting with the real bazel_features repo.
bazel_dep(name = "bazel_features", version = "1.9.1", repo_name = "io_bazel_rules_go_bazel_features")
bazel_dep(name = "bazel_skylib", version = "1.2.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "protobuf", version = "29.0-rc2.bcr.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_shell", version = "0.3.0")

go_sdk = use_extension("//go:extensions.bzl", "go_sdk")

# Don't depend on this repo by name, use toolchains instead.
# See https://github.com/bazel-contrib/rules_go/blob/master/go/toolchains.rst
go_sdk.from_file(
name = "go_default_sdk",
go_mod = "//:go.mod",
)
use_repo(
go_sdk,
"go_host_compatible_sdk_label",
"go_toolchains",
# This name is ugly on purpose to avoid a conflict with a user-named SDK.
"io_bazel_rules_nogo",
)

register_toolchains("@go_toolchains//:all")

bazel_dep(name = "gazelle", version = "0.36.0")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_gogo_protobuf",
"com_github_golang_mock",
"com_github_golang_protobuf",
"com_github_pmezard_go_difflib",
"org_golang_google_genproto",
"org_golang_google_grpc",
"org_golang_google_grpc_cmd_protoc_gen_go_grpc",
"org_golang_google_protobuf",
"org_golang_x_net",
"org_golang_x_tools",
# Exported by gazelle specifically for rules_go.
"bazel_gazelle_go_repository_config",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl
index 156bb25..feb55eb 100644
--- a/go/private/sdk.bzl
+++ b/go/private/sdk.bzl
@@ -443,13 +443,13 @@ def _sdk_build_file(ctx, platform, version, experiments):
ctx.file("ROOT")
goos, _, goarch = platform.partition("_")

- pv = parse_version(version)
- if pv != None and pv[1] >= 20:
- # Turn off coverageredesign GOEXPERIMENT on 1.20+
- # until rules_go is updated to work with the
- # coverage redesign.
- if not "nocoverageredesign" in experiments and not "coverageredesign" in experiments:
- experiments = experiments + ["nocoverageredesign"]
+ # pv = parse_version(version)
+ # if pv != None and pv[1] >= 20:
+ # # Turn off coverageredesign GOEXPERIMENT on 1.20+
+ # # until rules_go is updated to work with the
+ # # coverage redesign.
+ # if not "nocoverageredesign" in experiments and not "coverageredesign" in experiments:
+ # experiments = experiments + ["nocoverageredesign"]

ctx.template(
"BUILD.bazel",
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"integrity": "sha256-nXL3uJBBKK+5jUa774KtciPsn/NxjUGa+zVf3dn5SEo=",
"strip_prefix": "",
"url": "https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
"patches": {
"codeql_do_not_use_nocoverageredesign.patch": "sha256-v/eo1XWUpNLWKVAUcR/MlIYqKAGTS+2eWopxTl8lEwk="
},
"patch_strip": 1
}
30 changes: 30 additions & 0 deletions misc/bazel/registry/modules/rules_go/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"homepage": "https://github.com/bazelbuild/rules_go",
"maintainers": [
{
"email": "fabian@meumertzhe.im",
"github": "fmeum",
"name": "Fabian Meumertzheim",
"github_user_id": 4312191
},
{
"email": "zplin@uber.com",
"github": "linzhp",
"name": "Zhongpeng Lin",
"github_user_id": 98395
},
{
"email": "tfrench@uber.com",
"github": "tyler-french",
"name": "Tyler French",
"github_user_id": 66684063
}
],
"repository": [
"github:bazel-contrib/rules_go"
],
"versions": [
"0.55.1-codeql.1"
],
"yanked_versions": {}
}
Loading