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

Update module github.com/knadh/koanf to v2 #7841

Conversation

renovate-bot
Copy link
Contributor

Mend Renovate

This PR contains the following updates:

Package Type Update Change
github.com/knadh/koanf require major v1.5.0 -> v2.0.1

Release Notes

knadh/koanf

v2.0.1

Compare Source

What's Changed

New Contributors

Full Changelog: knadh/koanf@v2.0.0...v2.0.1

v2.0.0

Compare Source

This is a major breaking change that ends koanf v1 (v1.5.0) and moves to v2. Continued usage of v1 is unaffected. While koanf does not bundle external dependencies into its core thereby avoiding them in the build, a go get would still pull them and go.mod, bringing in unnecessary references as all the providers and parsers were "sub" packages of the main module.

This PR upgrades koanf to v2 and separates every single provider and parser package into its own module, go.mod, and release tag (eg: providers/yaml/v0.1.0). That is, one-repository, many modules. This removes references to all indirect dependencies in the main koanf package significantly de-cluttering it.

What changes?
  • Going forward, koanf references should change to github.com/knadh/koanf/v2.
  • The required parsers and providers should be installed explicitly as they do not come bundled with the main koanf package anymore. Eg: go get github.com/knadh/koanf/providers/s3, go get github.com/knadh/koanf/parsers/json etc.
  • That's all. There is no change in functionality.

Full Changelog: knadh/koanf@v1.5.0...v2.0.0


Configuration

📅 Schedule: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate-bot renovate-bot requested review from a team and dmitryax June 6, 2023 23:25
@forking-renovate forking-renovate bot added the dependencies Pull requests that update a dependency file label Jun 6, 2023
@forking-renovate
Copy link

⚠ Artifact update problem

Renovate failed to update artifacts related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: confmap/go.sum
Command failed: docker run --rm --name=renovate_a_sidecar --label=renovate_a_child -v "/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector":"/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector" -v "/tmp/worker/e6ee3b/8adc26/cache":"/tmp/worker/e6ee3b/8adc26/cache" -e GOPATH -e GOPROXY -e GOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_COUNT -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector/confmap" ghcr.io/containerbase/sidecar bash -l -c "install-tool golang 1.20.5 && go get -d -t ./..."
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/stretchr/testify v1.8.4
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/knadh/koanf/maps v0.1.1
go: downloading go.uber.org/multierr v1.11.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/knadh/koanf v1.5.0
go: downloading github.com/knadh/koanf/providers/confmap v0.1.0
go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/maps: ambiguous import: found package github.com/knadh/koanf/maps in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/maps)
	github.com/knadh/koanf/maps v0.1.1 (/go/pkg/mod/github.com/knadh/koanf/[email protected])
go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/providers/confmap: ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/providers/confmap)
	github.com/knadh/koanf/providers/confmap v0.1.0 (/go/pkg/mod/github.com/knadh/koanf/providers/[email protected])

File name: cmd/builder/go.sum
Command failed: docker run --rm --name=renovate_a_sidecar --label=renovate_a_child -v "/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector":"/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector" -v "/tmp/worker/e6ee3b/8adc26/cache":"/tmp/worker/e6ee3b/8adc26/cache" -e GOPATH -e GOPROXY -e GOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_COUNT -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/worker/e6ee3b/8adc26/repos/github/open-telemetry/opentelemetry-collector/cmd/builder" ghcr.io/containerbase/sidecar bash -l -c "install-tool golang 1.20.5 && go get -d -t ./..."
go: downloading github.com/spf13/cobra v1.7.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading go.uber.org/zap v1.24.0
go: downloading github.com/stretchr/testify v1.8.4
go: downloading go.uber.org/multierr v1.11.0
go: downloading github.com/inconshreveable/mousetrap v1.1.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading go.uber.org/atomic v1.10.0
go: downloading github.com/benbjohnson/clock v1.3.0
go: downloading github.com/knadh/koanf v1.5.0
go: downloading github.com/knadh/koanf/providers/env v0.1.0
go: downloading github.com/knadh/koanf/parsers/yaml v0.1.0
go: downloading github.com/knadh/koanf/providers/file v0.1.0
go: downloading github.com/knadh/koanf/providers/fs v0.1.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go.opentelemetry.io/collector/cmd/builder/internal imports
	github.com/knadh/koanf/parsers/yaml: ambiguous import: found package github.com/knadh/koanf/parsers/yaml in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/parsers/yaml)
	github.com/knadh/koanf/parsers/yaml v0.1.0 (/go/pkg/mod/github.com/knadh/koanf/parsers/[email protected])
go.opentelemetry.io/collector/cmd/builder/internal imports
	github.com/knadh/koanf/providers/env: ambiguous import: found package github.com/knadh/koanf/providers/env in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/providers/env)
	github.com/knadh/koanf/providers/env v0.1.0 (/go/pkg/mod/github.com/knadh/koanf/providers/[email protected])
go.opentelemetry.io/collector/cmd/builder/internal imports
	github.com/knadh/koanf/providers/file: ambiguous import: found package github.com/knadh/koanf/providers/file in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/providers/file)
	github.com/knadh/koanf/providers/file v0.1.0 (/go/pkg/mod/github.com/knadh/koanf/providers/[email protected])
go.opentelemetry.io/collector/cmd/builder/internal/config imports
	github.com/knadh/koanf/providers/fs: ambiguous import: found package github.com/knadh/koanf/providers/fs in multiple modules:
	github.com/knadh/koanf v1.5.0 (/go/pkg/mod/github.com/knadh/[email protected]/providers/fs)
	github.com/knadh/koanf/providers/fs v0.1.0 (/go/pkg/mod/github.com/knadh/koanf/providers/[email protected])

@codeboten codeboten closed this Jun 14, 2023
@forking-renovate
Copy link

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 2.x releases. But if you manually upgrade to 2.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate-bot renovate-bot deleted the renovate/github.aaakk.us.kg-knadh-koanf-2.x branch June 14, 2023 15:35
@yurishkuro
Copy link
Member

yurishkuro commented Jul 11, 2023

@codeboten I am getting similar "ambiguous import" errors in Jaeger after upgrading to collector 1.81. I see multiple files in collector importing both v1 and v2, e.g.

"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/env"
"github.com/knadh/koanf/providers/file"
"github.com/knadh/koanf/v2"

Is there some special trick you did to prevent Go from complaining?

$ go run -tags=ui ./cmd/all-in-one
../../../golang/pkg/mod/go.opentelemetry.io/collector/[email protected]/confmap.go:11:2: ambiguous import: found package github.com/knadh/koanf/maps in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/ysh/golang/pkg/mod/github.com/knadh/[email protected]/maps)
	github.com/knadh/koanf/maps v0.1.1 (/Users/ysh/golang/pkg/mod/github.com/knadh/koanf/[email protected])
../../../golang/pkg/mod/go.opentelemetry.io/collector/[email protected]/confmap.go:12:2: ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/ysh/golang/pkg/mod/github.com/knadh/[email protected]/providers/confmap)
	github.com/knadh/koanf/providers/confmap v0.1.0 (/Users/ysh/golang/pkg/mod/github.com/knadh/koanf/providers/[email protected])

@codeboten
Copy link
Contributor

@yurishkuro this happened for me once when I tried compiling w/ go workspace enabled locally. I closed the PR because we're not ready to use renovatebot yet (unrelated to the error)

@yurishkuro
Copy link
Member

@codeboten thanks! that solved it. Don't know how I ended up with go.work in the jaeger repo, since it's a single module. Removing it helped.

@codeboten
Copy link
Contributor

@yurishkuro np, glad it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants