Fixed issues with repeated validation errors / warnings#254
Merged
Conversation
This test might run into problems like being too slow, or running out of API quotas / rate limiting. We might disable it in the future, or merge it into the other similar test, at 'tests/shell/validate.sh'. However, for now, it is useful, especially as I'm debugging why this fails in the other repo. Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
When we use warn_about_unused_keys from _validate_config() we really want it to raise exceptions, like the rest of the valiation code. validate_config() will handle the exception, and the code calling it will determine how strict to be when it comes to the result. (cfbs validate should be very strict, cfbs build is intentionally not strict for backwards compatibility, other commands are somewhere in between). This fixes an issue seen in the build index tests, where these warnings are printed many times by cfbs validate, because the "index" field is not recognized, and cfbs validate still exits with 0 (success). Further fixes are needed for other commands and for making cfbs validate recognize the "index" field, this is just the first step. Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
When we are not using exceptions, avoid printing the same warning again and again. This fix is only for the places where we don't use the exceptions, for example, it has no effect on cfbs validate. Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
It will be useful to call this function directly, in many cases. Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
jakub-nt
approved these changes
Jul 16, 2025
jakub-nt
reviewed
Jul 16, 2025
jakub-nt
reviewed
Jul 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
More fixes are needed to fix the actual issue (not just the log spamming), but this is a good improvement.