@@ -113,7 +113,7 @@ supports these predicate types:
113113
114114| Predicate | Bash Shape | Example |
115115| -----------| -----------| ---------|
116- | ` RegexMatch { fact, pattern }` | ` echo "$VAR" \| grep -qE ' pattern' ` | Title matches ` \ [review\] ` |
116+ | ` GlobMatch { fact, pattern }` | ` fnmatch(value, pattern) ` | Title matches ` * [review]* ` |
117117| ` Equality { fact, value } ` | ` [ "$VAR" = "value" ] ` | Draft is ` false ` |
118118| ` ValueInSet { fact, values, case_insensitive } ` | ` echo "$VAR" \| grep -q[i]E '^(a\|b)$' ` | Author in allow-list |
119119| ` ValueNotInSet { fact, values, case_insensitive } ` | Inverse of ` ValueInSet ` | Author not in block-list |
@@ -169,12 +169,12 @@ Maps each field of `PrFilters` to a `FilterCheck`:
169169
170170| Field | Predicate | Fact(s) | Tag Suffix |
171171| -------| -----------| ---------| ------------|
172- | ` title ` | ` RegexMatch ` | ` PrTitle ` | ` title-mismatch ` |
172+ | ` title ` | ` GlobMatch ` | ` PrTitle ` | ` title-mismatch ` |
173173| ` author.include ` | ` ValueInSet ` (case-insensitive) | ` AuthorEmail ` | ` author-mismatch ` |
174174| ` author.exclude ` | ` ValueNotInSet ` (case-insensitive) | ` AuthorEmail ` | ` author-excluded ` |
175- | ` source_branch ` | ` RegexMatch ` | ` SourceBranch ` | ` source-branch-mismatch ` |
176- | ` target_branch ` | ` RegexMatch ` | ` TargetBranch ` | ` target-branch-mismatch ` |
177- | ` commit_message ` | ` RegexMatch ` | ` CommitMessage ` | ` commit-message-mismatch ` |
175+ | ` source_branch ` | ` GlobMatch ` | ` SourceBranch ` | ` source-branch-mismatch ` |
176+ | ` target_branch ` | ` GlobMatch ` | ` TargetBranch ` | ` target-branch-mismatch ` |
177+ | ` commit_message ` | ` GlobMatch ` | ` CommitMessage ` | ` commit-message-mismatch ` |
178178| ` labels ` | ` LabelSetMatch ` | ` PrLabels ` (→ ` PrMetadata ` ) | ` labels-mismatch ` |
179179| ` draft ` | ` Equality ` | ` PrIsDraft ` (→ ` PrMetadata ` ) | ` draft-mismatch ` |
180180| ` changed_files ` | ` FileGlobMatch ` | ` ChangedFiles ` | ` changed-files-mismatch ` |
@@ -187,8 +187,8 @@ Maps each field of `PrFilters` to a `FilterCheck`:
187187
188188| Field | Predicate | Fact(s) | Tag Suffix |
189189| -------| -----------| ---------| ------------|
190- | ` source_pipeline ` | ` RegexMatch ` | ` TriggeredByPipeline ` | ` source-pipeline-mismatch ` |
191- | ` branch ` | ` RegexMatch ` | ` TriggeringBranch ` | ` branch-mismatch ` |
190+ | ` source_pipeline ` | ` GlobMatch ` | ` TriggeredByPipeline ` | ` source-pipeline-mismatch ` |
191+ | ` branch ` | ` GlobMatch ` | ` TriggeringBranch ` | ` branch-mismatch ` |
192192| ` time_window ` | ` TimeWindow ` | ` CurrentUtcMinutes ` | ` time-window-mismatch ` |
193193| ` build_reason.include ` | ` ValueInSet ` | ` BuildReason ` | ` build-reason-mismatch ` |
194194| ` build_reason.exclude ` | ` ValueNotInSet ` | ` BuildReason ` | ` build-reason-excluded ` |
@@ -286,7 +286,7 @@ quoting issues. Decoded, it contains:
286286 " checks " : [
287287 {
288288 " name " : " title" ,
289- " predicate " : {"type": "regex_match ", "fact": "pr_title", "pattern": "\\ [review\\] "},
289+ " predicate " : {"type": "glob_match ", "fact": "pr_title", "pattern": "* [review]* "},
290290 " tag_suffix " : " title-mismatch"
291291 },
292292 {
@@ -335,7 +335,7 @@ The bash shim exports only the ADO macros needed by the spec's facts:
335335
336336| ` type ` | Fields | Description |
337337| --------| --------| -------------|
338- | ` regex_match ` | ` fact ` , ` pattern ` | Python ` re.search() ` |
338+ | ` glob_match ` | ` fact ` , ` pattern ` | Glob match ( ` * ` any chars, ` ? ` single char) |
339339| ` equals ` | ` fact ` , ` value ` | Exact string equality |
340340| ` value_in_set ` | ` fact ` , ` values ` , ` case_insensitive ` | Value membership |
341341| ` value_not_in_set ` | ` fact ` , ` values ` , ` case_insensitive ` | Inverse membership |
@@ -424,3 +424,4 @@ step-by-step guide. In summary:
424424 ` lower_pipeline_filters` )
4254256. Add validation rules if the new filter can conflict with existing ones
4264267. Write tests : lowering, validation, spec serialization, and evaluator
427+
0 commit comments