Skip to content

Commit

Permalink
[cmd/builder] Remove undocumented strictness check (#9999)
Browse files Browse the repository at this point in the history
Partially reverts #9897. This was not documented on the original PR and
is IMO too strict.
We likely want to allow for some skew between versions.

Mentioned on
#9513 (comment)

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
mx-psi and codeboten committed Apr 19, 2024
1 parent 0aa9b10 commit 7b046d9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
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 @@ -34,7 +34,7 @@ jobs:
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest GOTEST_TIMEOUT=240s
run: make gotest

windows-service-test:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ALL_PKGS := $(sort $(shell go list ./...))
# COVER_PKGS is the list of packages to include in the coverage
COVER_PKGS := $(shell go list ./... | tr "\n" ",")

GOTEST_TIMEOUT?=120s
GOTEST_TIMEOUT?=240s
GOTEST_OPT?= -race -timeout $(GOTEST_TIMEOUT)
GOCMD?= go
GOTEST=$(GOCMD) test
Expand Down
3 changes: 0 additions & 3 deletions cmd/builder/internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ func Generate(cfg Config) error {
}
// create a warning message for non-aligned builder and collector base
if cfg.Distribution.OtelColVersion != defaultOtelColVersion {
if !cfg.SkipStrictVersioning {
return fmt.Errorf("builder version %q does not match build configuration version %q: %w", cfg.Distribution.OtelColVersion, defaultOtelColVersion, ErrVersionMismatch)
}
cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", zap.String("builder-version", defaultOtelColVersion))
}
// if the file does not exist, try to create it
Expand Down
26 changes: 15 additions & 11 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,25 @@ func TestVersioning(t *testing.T) {
},
{
description: "old otel version",
cfgBuilder: func() Config {
cfg := NewDefaultConfig()
cfg.Distribution.OtelColVersion = "0.90.0"
return cfg
},
expectedErr: ErrVersionMismatch,
},
{
description: "old otel version without strict mode",
cfgBuilder: func() Config {
cfg := NewDefaultConfig()
cfg.Verbose = true
cfg.Distribution.Go = "go"
cfg.SkipStrictVersioning = true
cfg.Distribution.OtelColVersion = "0.90.0"
cfg.Distribution.OtelColVersion = "0.97.0"
cfg.Distribution.RequireOtelColModule = true
var err error
cfg.Exporters, err = parseModules([]Module{
{
GoMod: "go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0",
},
})
require.NoError(t, err)
cfg.Receivers, err = parseModules([]Module{
{
GoMod: "go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0",
},
})
require.NoError(t, err)
return cfg
},
expectedErr: nil,
Expand Down

0 comments on commit 7b046d9

Please sign in to comment.