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

[confmap] Add error hint when invalid YAML was passed #12180

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Jan 24, 2025

Description

Add error hint field to surface YAML parsing errors. This only surfaces the error for top-level URIs but it's a step in the right direction.

Link to tracking issue

Updates #12000

Testing

Documentation

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.76%. Comparing base (2447a81) to head (3ea155d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12180   +/-   ##
=======================================
  Coverage   91.75%   91.76%           
=======================================
  Files         464      464           
  Lines       24763    24773   +10     
=======================================
+ Hits        22722    22732   +10     
  Misses       1656     1656           
  Partials      385      385           

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

@mattsains
Copy link
Contributor

mattsains commented Jan 24, 2025

One thing I noticed a lot while researching this issue is that a lot of the test cases only test that some kind of error was produced, and not the content of the error. Perhaps you could consider fixing that as part of this PR. Examples:

Improving these tests would prevent a regression like this in the future, they're easy to find by searching for require.Error and easy to fix by changing them to require.EqualError(t, err, "expected message"). You can even just run the tests with the expected message set to blank and figure out what the expected error is.

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