Skip to content

[confmap] Maintain nil slice values when marshaling and unmarshaling #11882

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 5 commits into from
Mar 11, 2025

Conversation

evan-bradley
Copy link
Contributor

Expands on #11755 to show how we could test for a 1:1 mapping between map[string]any <-> confmap.Conf <-> Config structs for []any(nil) and []any{} slices.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.18%. Comparing base (7d3e03e) to head (3766cc7).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11882   +/-   ##
=======================================
  Coverage   92.18%   92.18%           
=======================================
  Files         469      469           
  Lines       25394    25394           
=======================================
  Hits        23409    23409           
  Misses       1574     1574           
  Partials      411      411           

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

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 28, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jan 15, 2025
@evan-bradley evan-bradley reopened this Mar 10, 2025
@github-actions github-actions bot requested a review from mx-psi March 10, 2025 13:32
@evan-bradley evan-bradley changed the title [chore][confmap] Do not merge: demonstrate empty slice handling [confmap] Maintain nil slices values when marshaling and unmarshaling Mar 10, 2025
@evan-bradley evan-bradley marked this pull request as ready for review March 10, 2025 20:36
@evan-bradley evan-bradley requested a review from a team as a code owner March 10, 2025 20:36
@evan-bradley evan-bradley changed the title [confmap] Maintain nil slices values when marshaling and unmarshaling [confmap] Maintain nil slice values when marshaling and unmarshaling Mar 11, 2025
@mx-psi mx-psi added this pull request to the merge queue Mar 11, 2025
Merged via the queue into open-telemetry:main with commit b8830dd Mar 11, 2025
73 checks passed
evan-bradley added a commit to evan-bradley/opentelemetry-collector that referenced this pull request Mar 18, 2025
evan-bradley added a commit to evan-bradley/opentelemetry-collector that referenced this pull request Mar 18, 2025
evan-bradley added a commit to evan-bradley/opentelemetry-collector that referenced this pull request Mar 18, 2025
codeboten pushed a commit that referenced this pull request Mar 18, 2025
#### Description

#11882
introduced issues with handling slices which have default values. It's
likely that the removal of `zeroSliceHookFunc` is causing problems with
overriding default lists.
github-merge-queue bot pushed a commit that referenced this pull request Apr 16, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Adds a test for #12661 and another test present on #11882.

I verified that the first test fails in v0.123.0: on this version the
slice has `[]S{A: "A", B: "B"}` instead.
github-merge-queue bot pushed a commit that referenced this pull request Apr 21, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

A second attempt at #11882.

Note that I added some tests in #12871 to prevent something like #12661
from happening again.

#### Link to tracking issue
Fixes #11749

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->

See tests from #12871 as well as the new tests added here.
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.

3 participants