feat: add regex support to path matching via regex_paths flag#177
Open
Megh03 wants to merge 3 commits into
Open
feat: add regex support to path matching via regex_paths flag#177Megh03 wants to merge 3 commits into
Megh03 wants to merge 3 commits into
Conversation
Add a new boolean option to watch blocks in the plugin
config. When set to true, all path matching for , ,
and is handled by regexp2 instead of the existing
glob/prefix matching.
regexp2 was chosen over Go's stdlib regexp package because it supports
full PCRE syntax including negative lookaheads, which is required for
the customer's use case of collapsing 30+ glob patterns into a single
regex expression.
When regex_paths is false (the default), existing glob and prefix
matching behaviour is completely unchanged — no impact on existing users.
Changes:
- plugin.go: added RegexPaths field to WatchConfig struct
- pipeline.go: updated matchPath to accept a useRegex flag and route
through regexp2 when set; updated all 3 call sites in stepsToTrigger
- pipeline_test.go: added TestRegexPaths with 10 test cases covering
lookaheads, skip_path, except_path, invalid regex, mixed blocks,
and regression check for existing glob behaviour
- plugin.yml: documented regex_paths as a boolean property
- README.md: added regex_paths section with customer example pattern
Closes SUP-5848
petetomasik
reviewed
May 29, 2026
Contributor
petetomasik
left a comment
There was a problem hiding this comment.
Great work @Megh03! Just a few comments, suggestions, questions.
- run make quality to fix spacing on RegexPaths field - anchor README example pattern with ^ to prevent partial path matches - add TestPluginParsesRegexPaths to plugin_test.go - add MatchTimeout to prevent catastrophic backtracking - improve error message when glob syntax is used with regex_paths: true
b9ab9d9 to
8c97966
Compare
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.
Add a new boolean option to watch blocks in the plugin config. When set to true, all path matching for ,and is handled by regexp2 instead of the existing glob/prefix matching.
When regex_paths is false (the default), existing glob and prefix matching behaviour is completely unchanged ,so no impact on existing users.
Changes: