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

Parser: KDL #266

Merged
merged 15 commits into from
Dec 31, 2023
Merged

Parser: KDL #266

merged 15 commits into from
Dec 31, 2023

Conversation

dezren39
Copy link
Contributor

No description provided.

* add kdl

* stuff

* 2

* mod

* mod

* Update README.md

* Update koanf_test.go

* changes

* impl

* method

* trythis

* fix

* fix

* nil

* nil

* nil

* options

* simple

* note
@knadh
Copy link
Owner

knadh commented Dec 25, 2023

Thanks for the PR @dezren39. Could you move kdl references and tests from tests/koanf_test.go? All the tests can be self-contained in kdl/kdl_test.go.

@knadh knadh added the enhancement New feature or request label Dec 25, 2023
@dezren39
Copy link
Contributor Author

dezren39 commented Dec 26, 2023

I can! I wanted to clarify, should I not add a KDL case to koanf_test? The main reason I have changes there is because kdl-go treats empty kdl node values as 'nil' instead of an empty map, and so if I add the KDL case, I need to handle the tests involving 'empty' slightly differently. I did raise an issue in the kdl-go library confirming whether this behavior was intended and noting that it differs from other libraries somewhat. So, I treated the behavior as an intended difference in the data specs between the formats. I tried my best to generically add the 'emptyIsNil' concept so that kdl isn't being directly referenced in tests. I'm open to solving this however works best for you. What do you think?

@knadh
Copy link
Owner

knadh commented Dec 26, 2023

The main reason I have changes there is because kdl-go treats empty kdl node values as 'nil' instead of an empty map.

This can be handled in the provider. You can iterate, type-check, and set it to an empty map.

I can! I wanted to clarify, should I not add a KDL case to koanf_test?

That's not necessary. All the KDL tests can be in the KDL package.

@dezren39
Copy link
Contributor Author

dezren39 commented Dec 26, 2023

that makes things much easier! i've removed the changes in tests now. I'll look about the kdl tests within the provider I had mostly focused on ensuring the existing tests worked. 😅

@dezren39
Copy link
Contributor Author

ok i've cleaned up and fixed the tests. :-)

@knadh knadh merged commit d2028fd into knadh:master Dec 31, 2023
codeboten pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Feb 6, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/knadh/koanf/v2](https://togithub.com/knadh/koanf) |
`v2.0.1` -> `v2.0.2` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fknadh%2fkoanf%2fv2/v2.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fknadh%2fkoanf%2fv2/v2.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fknadh%2fkoanf%2fv2/v2.0.1/v2.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fknadh%2fkoanf%2fv2/v2.0.1/v2.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>knadh/koanf (github.com/knadh/koanf/v2)</summary>

### [`v2.0.2`](https://togithub.com/knadh/koanf/releases/tag/v2.0.2)

[Compare
Source](https://togithub.com/knadh/koanf/compare/v2.0.1...v2.0.2)

#### What's Changed

- feat: add nats provider by
[@&#8203;TECHNOFAB11](https://togithub.com/TECHNOFAB11) in
[knadh/koanf#213
- feat: add flag to optionally fetch secret metadata by
[@&#8203;Thunderbottom](https://togithub.com/Thunderbottom) in
[knadh/koanf#219
- chore: change WithMeta to ExcludeMeta for backwards compatibility by
[@&#8203;Thunderbottom](https://togithub.com/Thunderbottom) in
[knadh/koanf#220
- typos and little clearer code by
[@&#8203;GreyXor](https://togithub.com/GreyXor) in
[knadh/koanf#222
- Fixed a nil panic issue in vault provider by
[@&#8203;wangkang](https://togithub.com/wangkang) in
[knadh/koanf#224
- Not use deprecated io/ioutil by
[@&#8203;tchssk](https://togithub.com/tchssk) in
[knadh/koanf#226
- Proposal: support Vault auth method by
[@&#8203;missedone](https://togithub.com/missedone) in
[knadh/koanf#229
- Add parameterstore provider by
[@&#8203;tchssk](https://togithub.com/tchssk) in
[knadh/koanf#227
- feat: optional support net/http transport by
[@&#8203;missedone](https://togithub.com/missedone) in
[knadh/koanf#232
- breaking change:
[#&#8203;233](https://togithub.com/knadh/koanf/issues/233) return error
struct to avoid panic at runtime by
[@&#8203;missedone](https://togithub.com/missedone) in
[knadh/koanf#234
- Bump github.com/nats-io/nkeys from 0.4.4 to 0.4.6 in /providers/nats
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#246
- Bump golang.org/x/net from 0.7.0 to 0.17.0 in /providers/etcd by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#248
- Bump golang.org/x/net from 0.7.0 to 0.17.0 in /providers/vault by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#247
- Bump github.com/nats-io/nats-server/v2 from 2.9.15 to 2.9.23 in
/providers/nats by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[knadh/koanf#241
- Bump google.golang.org/grpc from 1.53.0 to 1.56.3 in /providers/etcd
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#243
- fix: typo by [@&#8203;testwill](https://togithub.com/testwill) in
[knadh/koanf#251
- Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /providers/vault by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#261
- Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /providers/nats by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[knadh/koanf#260
- Add optional `Opt{}` param that takes a koanf instance to match
posflag's default value behaviour in basic flag. Closes
[#&#8203;255](https://togithub.com/knadh/koanf/issues/255). by
[@&#8203;knadh](https://togithub.com/knadh) in
[knadh/koanf#259
- Parser: KDL by [@&#8203;dezren39](https://togithub.com/dezren39) in
[knadh/koanf#266
- Parser: KDL kdl-go dependency update by
[@&#8203;dezren39](https://togithub.com/dezren39) in
[knadh/koanf#267

#### New Contributors

- [@&#8203;TECHNOFAB11](https://togithub.com/TECHNOFAB11) made their
first contribution in
[knadh/koanf#213
- [@&#8203;GreyXor](https://togithub.com/GreyXor) made their first
contribution in
[knadh/koanf#222
- [@&#8203;wangkang](https://togithub.com/wangkang) made their first
contribution in
[knadh/koanf#224
- [@&#8203;tchssk](https://togithub.com/tchssk) made their first
contribution in
[knadh/koanf#226
- [@&#8203;missedone](https://togithub.com/missedone) made their first
contribution in
[knadh/koanf#229
- [@&#8203;testwill](https://togithub.com/testwill) made their first
contribution in
[knadh/koanf#251
- [@&#8203;dezren39](https://togithub.com/dezren39) made their first
contribution in
[knadh/koanf#266

**Full Changelog**:
knadh/koanf@v2.0.1...v2.0.2

</details>

---

### 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.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants