Skip to content

Commit

Permalink
Remove go 1.19 support, bump minimum to go 1.20 and add testing for 1…
Browse files Browse the repository at this point in the history
….21 (#8208)

Fixes #8207

---------

Co-authored-by: bryan-aguilar <[email protected]>
  • Loading branch information
mx-psi and bryan-aguilar authored Aug 11, 2023
1 parent c46704a commit 81242fa
Show file tree
Hide file tree
Showing 51 changed files with 76 additions and 54 deletions.
18 changes: 18 additions & 0 deletions .chloggen/mx-psi_refactor-service-telemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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:

change_logs: [api]
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
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")
}

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

0 comments on commit 81242fa

Please sign in to comment.