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

node: add check for unmarshalling config to validate #3037

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

End-rey
Copy link
Contributor

@End-rey End-rey commented Nov 29, 2024

This is a check in case there is a ",remain" tag in the configuration field, and if there is an incorrect data format, then the value of the field was ignored, since then there will be a check to see if this field is correct or not. This makes some errors clearer after unmarshalling.

Closes #3034.

Actually, I don't like this fix. I want the attribute field to be a list.

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

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

Project coverage is 22.62%. Comparing base (7b592bd) to head (ff65a8c).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
cmd/neofs-node/config/config.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3037      +/-   ##
==========================================
- Coverage   22.63%   22.62%   -0.01%     
==========================================
  Files         791      791              
  Lines       58615    58616       +1     
==========================================
- Hits        13265    13264       -1     
- Misses      44452    44454       +2     
  Partials      898      898              

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

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Far from being pretty, but looks like unavoidable at the same time.

Changes to go.mod?

Can we also not throw a panic from SN and fail gracefully?

@roman-khimov
Copy link
Member

At the same time, if we're to do #2993, this won't be a problem, right?

@End-rey
Copy link
Contributor Author

End-rey commented Nov 29, 2024

Changes to go.mod?

No, mapstructure is a part of the viper package and it's been in go.mod for a long time, if that's what you mean.

At the same time, if we're to do #2993, this won't be a problem, right?

I think yes.

@roman-khimov
Copy link
Member

No, mapstructure is a part of the viper package

But that was an indirect import while here it's a direct one.

I think we better handle panic here and leave the rest for #2993, it can be scheduled for the next release then.

@End-rey
Copy link
Contributor Author

End-rey commented Nov 29, 2024

leave the rest for #2993

So, remove the check for unmarshalling?

@roman-khimov
Copy link
Member

Yes.

@End-rey End-rey force-pushed the 3034-improve-validate-config-error-message branch from 57d1485 to 5512bdb Compare November 29, 2024 17:51
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Changelog?

@End-rey End-rey force-pushed the 3034-improve-validate-config-error-message branch from 5512bdb to ff65a8c Compare December 2, 2024 07:22
@roman-khimov roman-khimov merged commit f831c75 into master Dec 3, 2024
20 of 22 checks passed
@roman-khimov roman-khimov deleted the 3034-improve-validate-config-error-message branch December 3, 2024 05:30
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.

neofs-node breaks after update to 0.44.0
2 participants