Config: harden meta and references config validation - #358
Open
ol-nata wants to merge 3 commits into
Open
Conversation
Reject `set-patterns` entries that are not valid regular expressions at config save time via JSON schema validation, instead of letting them fail silently later during `meta_categorization`. Related to: ts-factory#259 Signed-off-by: Natalia Rybchenko <natalia.rybchenko@oktetlabs.ru>
Require at least one log base, and at least one URI per log base, in the references config schema, so an empty log base entry — or an empty list of log bases — is rejected at config save time instead of being silently stored as a no-op. Signed-off-by: Natalia Rybchenko <natalia.rybchenko@oktetlabs.ru>
Require the http(s) scheme for `uri` fields in the references config schema (`LOGS_BASES`, `ISSUES`, `REVISIONS`), rejecting malformed or unsupported URIs at config save time instead of letting them reach the UI as broken links. Closes: ts-factory#259 Signed-off-by: Natalia Rybchenko <natalia.rybchenko@oktetlabs.ru>
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.
Info
Addresses the validation gaps described in #259:
metaconfig patterns andreferencesconfig URIs were only checked for basic JSON schema shape, with no checks that would catch a broken pattern or a broken link before it reaches the database.Overview of Changes
Meta config
set-patternsentries are now validated as regular expressions at config save time. Previously an invalid pattern was accepted, stored, and only failed later — silently — inside themeta_categorizationtask.References config
LOGS_BASES— an empty entry is no longer silently accepted.urifields inLOGS_BASES,ISSUES, andREVISIONSmust now use the http(s) scheme, so a malformed or unsupported URI is rejected instead of reaching the UI as a broken link.Closes: #259