Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Comments

More strict filter validation#92

Merged
prymitive merged 2 commits intomasterfrom
filters-validation
May 6, 2017
Merged

More strict filter validation#92
prymitive merged 2 commits intomasterfrom
filters-validation

Conversation

@prymitive
Copy link
Contributor

@silenced=true should now be marked as invalid filter, but it isn't, this commit refactors it so that instead of looping over all filters and falling back to fuzzy (which is very relaxed checking and can't find typos in filter names like @statuz=active) we tokenize the expression into ' ' and only fallback to fuzzy if there's only a static text (no filter name and operator). This is more manual but provides stronger checks so now @silenced=true is correctly marked as invalid.

@prymitive prymitive added the bug label May 5, 2017
prymitive added 2 commits May 6, 2017 16:46
@silenced=true should now be marked as invalid filter, but it isn't, this commit refactors it so that instead of looping over all filters and falling back to fuzzy (which is very relaxed checking and can't find typos in filter names like @statuz=active) we tokenize the expression into '<filter name> <operator> <value>' and only fallback to fuzzy if there's only a static text (no filter name and operator). This is more manual but provides stronger checks so now @silenced=true is correctly marked as invalid
Instead of compiling filter regexp on every filter match pre-compile it and use same instance
@prymitive prymitive force-pushed the filters-validation branch from a99aa94 to 003010f Compare May 6, 2017 15:46
@prymitive prymitive merged commit 1a3cfc8 into master May 6, 2017
@prymitive prymitive deleted the filters-validation branch May 6, 2017 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants