Skip to content
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

Remove go 1.19 support, bump minimum to go 1.20 and add testing for 1.21 #8208

Merged
merged 8 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 16 additions & 0 deletions .chloggen/mx-psi_refactor-service-telemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: all

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove go 1.19 support, bump minimum to go 1.20 and add testing for 1.21

# One or more tracking issues or pull requests related to the change
issues: [8207]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
dmitryax marked this conversation as resolved.
Show resolved Hide resolved
mx-psi marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7

# Generate apidiff states of Main
- name: Generate-States
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
uses: actions/cache@v3
env:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -88,7 +88,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
unittest-matrix:
strategy:
matrix:
go-version: ["1.20", 1.19] # 1.20 needs quotes otherwise it's interpreted as 1.2
go-version: ["1.21", "1.20"] # 1.20 needs quotes otherwise it's interpreted as 1.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also use the ~ convention to force min version? Aligning across actions could make search and replace easier in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to do that, but I am worried that ~ is not a supported character on cache keys and since we use this variable here

key: unittest-${{ runner.os }}-go-build-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
it would break things, so I would prefer to work on this on a separate PR.

runs-on: ubuntu-latest
needs: [setup-environment]
steps:
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/builder-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Test
run: make builder-integration-test
2 changes: 1 addition & 1 deletion .github/workflows/builder-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Run Contrib Tests
run: |
contrib_path=/tmp/opentelemetry-collector-contrib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
- name: Run dependabot-pr.sh
run: ./.github/workflows/scripts/dependabot-pr.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7

- name: Run benchmark
run: make gobenchmark
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.12
go-version: ~1.20.7
# Prepare Core for release.
# - Update CHANGELOG.md file, this is done via chloggen
# - Run make prepare-release PREVIOUS_VERSION=1.0.0 RELEASE_CANDIDATE=1.1.0 MODSET=stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tidy-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ~1.20.7
cache: false
- name: Cache Go
id: go-cache
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fmt: $(GOIMPORTS)
.PHONY: tidy
tidy:
rm -fr go.sum
$(GOCMD) mod tidy -compat=1.19
$(GOCMD) mod tidy -compat=1.20

.PHONY: lint
lint: $(LINT)
Expand Down
2 changes: 1 addition & 1 deletion cmd/builder/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module go.opentelemetry.io/collector/cmd/builder

go 1.19
go 1.20

require (
github.com/knadh/koanf/parsers/yaml v0.1.0
Expand Down
2 changes: 1 addition & 1 deletion cmd/builder/internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func GetModules(cfg Config) error {
}

// #nosec G204 -- cfg.Distribution.Go is trusted to be a safe path
cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.19")
cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.20")
cmd.Dir = cfg.Distribution.OutputPath
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to update go.mod: %w. Output:\n%s", err, out)
Expand Down
4 changes: 4 additions & 0 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func TestGenerateInvalidOutputPath(t *testing.T) {
}

func TestSkipGenerate(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("skipping the test on Windows, see https://github.com/open-telemetry/opentelemetry-collector/issues/5403")
}

djaglowski marked this conversation as resolved.
Show resolved Hide resolved
cfg := NewDefaultConfig()
cfg.Distribution.OutputPath = t.TempDir()
cfg.SkipGenerate = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/builder/internal/builder/templates/go.mod.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module {{.Distribution.Module}}

go 1.19
go 1.20

require (
{{- range .Connectors}}
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module go.opentelemetry.io/collector/cmd/otelcorecol

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion component/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/component

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion config/configauth/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configauth

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion config/configcompression/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configcompression

go 1.19
go 1.20

require github.com/stretchr/testify v1.8.4

Expand Down
2 changes: 1 addition & 1 deletion config/configgrpc/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configgrpc

go 1.19
go 1.20

require (
github.com/mostynb/go-grpc-compression v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion config/confighttp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/confighttp

go 1.19
go 1.20

require (
github.com/golang/snappy v0.0.4
Expand Down
2 changes: 1 addition & 1 deletion config/confignet/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/confignet

go 1.19
go 1.20

require github.com/stretchr/testify v1.8.4

Expand Down
2 changes: 1 addition & 1 deletion config/configopaque/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configopaque

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion config/configtelemetry/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configtelemetry

go 1.19
go 1.20

require github.com/stretchr/testify v1.8.4

Expand Down
2 changes: 1 addition & 1 deletion config/configtls/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/configtls

go 1.19
go 1.20

require (
github.com/fsnotify/fsnotify v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion config/internal/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/config/internal

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion confmap/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/confmap

go 1.19
go 1.20

require (
github.com/knadh/koanf/maps v0.1.1
Expand Down
2 changes: 1 addition & 1 deletion connector/forwardconnector/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/connector/forwardconnector

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion connector/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/connector

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion consumer/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/consumer

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion exporter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/exporter

go 1.19
go 1.20

require (
github.com/cenkalti/backoff/v4 v4.2.1
Expand Down
2 changes: 1 addition & 1 deletion exporter/loggingexporter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/exporter/loggingexporter

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion exporter/otlpexporter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/exporter/otlpexporter

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion exporter/otlphttpexporter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/exporter/otlphttpexporter

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion extension/auth/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/extension/auth

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion extension/ballastextension/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/extension/ballastextension

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 1 addition & 1 deletion extension/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/collector/extension

go 1.19
go 1.20

require (
github.com/stretchr/testify v1.8.4
Expand Down
Loading
Loading