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

Improved input validation error messages for values from env variables #78

Merged
merged 4 commits into from
Dec 15, 2024

Conversation

dskrypa
Copy link
Owner

@dskrypa dskrypa commented Dec 15, 2024

In terms of the publicly-facing API, nothing changed in this PR, except for the error messages presented to end users when input validation fails for values that were provided via environment variables. Now, when an invalid value is found in an environment variable, the name of the environment variable that contained the invalid value is included in the error message. This should make it easier to troubleshoot errors caused by forgotten environment variables and other similar cases.

In the internal API, potentially breaking changes were made to some internal methods related to ParamActions and their interaction with Parameters while parsing / validating values. Unused cruft was removed, a method was refactored to move away from having a param used for a single purpose to having a separate method for that purpose, and the new env_var param was added so it could be included in error messages.

@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.00%. Comparing base (7db5287) to head (71342d4).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #78   +/-   ##
=======================================
  Coverage   98.00%   98.00%           
=======================================
  Files          49       49           
  Lines        6772     6780    +8     
  Branches     1064     1065    +1     
=======================================
+ Hits         6637     6645    +8     
  Misses        110      110           
  Partials       25       25           
Flag Coverage Δ
unittests 98.00% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@dskrypa dskrypa merged commit e2f6e28 into main Dec 15, 2024
7 checks passed
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