Skip to content

Update module github.com/knadh/koanf/providers/env to v2 #13304

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

Merged
merged 2 commits into from
Jul 2, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 1, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/knadh/koanf/providers/env v1.1.0 -> v2.0.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

⚠️ MAJOR VERSION UPDATE ⚠️ - please manually update this package


Release Notes

knadh/koanf (github.com/knadh/koanf/providers/env)

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 was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner July 1, 2025 01:37
@renovate renovate bot requested a review from jade-guiton-dd July 1, 2025 01:37
Copy link

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.62%. Comparing base (18b3b57) to head (982cd06).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13304      +/-   ##
==========================================
- Coverage   91.64%   91.62%   -0.02%     
==========================================
  Files         522      522              
  Lines       29183    29210      +27     
==========================================
+ Hits        26746    26765      +19     
- Misses       1920     1927       +7     
- Partials      517      518       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jade-guiton-dd jade-guiton-dd added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 2, 2025
@jade-guiton-dd
Copy link
Contributor

jade-guiton-dd commented Jul 2, 2025

For the record: The changelog in renovate's description is not accurate, here is the actual changelog entry. I based myself off of this PR to understand how to adapt the code to the new major version. I don't think we have any tests for setting the configuration through environment variables, but hopefully this is correct.

The comment in our code suggests that back when this was written, the env Koanf provider did not allow setting arrays from environment variables, which is why it only allows setting the dist part of the config. The new Transform handler seems capable of doing that, so if users want to configure OCB through environment variables we may want to look into using it.

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks @jade-guiton-dd, the change looks ok, but I'm wondering if the replace for dist_ is needed at this point. I'm not seeing references in documentation or code where this is still used.

My understanding from what the callback did before, was that in the even of it returning an empty string, the variable was ignored (https://github.com/knadh/koanf/blob/036e4bf8be1d35b4c6467894fe19ad6ed50f4567/providers/env/env.go#L31-L32), however, strings.Replace would not return an empty string if dist_ was not present, it would just return the key string as is. I wonder if the comment is misleading.

@bogdandrutu bogdandrutu added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit 1d377cd Jul 2, 2025
61 of 65 checks passed
@bogdandrutu bogdandrutu deleted the renovate/major-all-github.comknadhkoanf-packages branch July 2, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency-major-update Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants