Skip to content

[PoC] Test alternative configoptional implementation #13060

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented May 21, 2025

Description

Implements alternative described here: #13044 (comment)

@mx-psi mx-psi force-pushed the mx-psi/configoptional-enabled branch 2 times, most recently from 9fbc1b8 to 115fb2c Compare May 21, 2025 09:48
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.60%. Comparing base (ee2c784) to head (3ef60da).
Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
receiver/otlpreceiver/otlp.go 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13060      +/-   ##
==========================================
+ Coverage   91.58%   91.60%   +0.01%     
==========================================
  Files         505      506       +1     
  Lines       28319    28359      +40     
==========================================
+ Hits        25937    25977      +40     
  Misses       1873     1873              
  Partials      509      509              

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

@mx-psi mx-psi force-pushed the mx-psi/configoptional-enabled branch from c11701a to 3ef60da Compare May 21, 2025 10:57
@mx-psi
Copy link
Member Author

mx-psi commented May 21, 2025

This mostly works but I would need #13064 to avoid some quirks with expanded values

// The zero value of Optional is None.
type Optional[T any] struct {
// Enabled indicates if the value is present.
Enabled bool `mapstructure:"enabled"`
Copy link
Member

Choose a reason for hiding this comment

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

Left a response on the original PR #13044 (comment). IMO adding enabled directly to the optional type is an abstraction leak, it does not need to be done at the framework level, the user always has the option of adding it explicitly to T.

github-merge-queue bot pushed a commit that referenced this pull request May 21, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds a method to delete a path from a `Conf` object.

I needed this for #13060

---------

Co-authored-by: Jade Guiton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants