Migrate filter DSL to the filt-rs crate#590
Conversation
|
|
||
| - `like` performs a case-insensitive [glob](https://en.wikipedia.org/wiki/Glob_(programming)) match, where `*` matches any | ||
| sequence of characters (including none), `?` matches exactly one character, and a backslash makes the following character | ||
| literal (`\*`, `\?`, `\\`). For example, `repo.name like "feat/*"` matches any repository whose name begins with `feat/`. |
There was a problem hiding this comment.
@copilot let's use repo.name like "*-rs" as an example instead; since the example provided here implies that repo names can include slashes (which is not the case).
There was a problem hiding this comment.
Updated the example to repo.name like "*-rs" in 2086f63.
There was a problem hiding this comment.
Correction: the change is in commit 4b10b94.
| literal (`\*`, `\?`, `\\`). For example, `repo.name like "*-rs"` matches any repository whose name ends with `-rs`. | ||
| - `matches` performs a [regular expression](https://docs.rs/regex/latest/regex/#syntax) match. Regular expressions are | ||
| case-sensitive (use `(?i)` to ignore case) and unanchored (use `^` and `$` to anchor the match). For example, | ||
| `repo.name matches r"^release/v\d+(\.\d+){2}$"` matches names like `release/v1.2.3`. |
There was a problem hiding this comment.
@copilot Let's also update the field and example used here to be more realistic (for example, checking that the release.tag matches a semver version number).
There was a problem hiding this comment.
@copilot Let's also update the field and example used here to be more realistic (for example, checking that the release.tag matches a semver version number).
There was a problem hiding this comment.
Updated the example to release.tag matches r"^v\d+(\.\d+){2}$", matching semver tags like v1.2.3, in 3e76e6f.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #590 +/- ##
==========================================
- Coverage 72.64% 70.87% -1.77%
==========================================
Files 36 28 -8
Lines 2709 1971 -738
==========================================
- Hits 1968 1397 -571
+ Misses 741 574 -167 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replaces the in-tree
src/filtermodule with the extractedfilt-rscrate. This is a near drop-in swap that also brings glob (like) and regex (matches) pattern matching, plus native datetime filtering.Changes
filt-rs1.1.0 with thechrono,regex, andserdefeatures; re-exportFilter/FilterValue/Filterablefromfilt_rsinmain.rs.src/filter/module (lexer, parser, interpreter, value, etc.).FilterValue→FilterValue<'_>.MetadatacachesFilterValue<'static>(entries outlive the entity they derive from) andinsertnow accepts anyInto<FilterValue<'a>>, so call sites keep passing&strrather than allocatingStrings.repo.pushed_at/created_at/updated_at,release.created_at/published_at,asset.created_at/updated_at, andgist.created_at/updated_at(gist fields changed fromStringtoDateTime<Utc>).like/matches, the_cscase-sensitive variants, raw strings, duration literals andnow()/trim(); add the new datetime fields to the repo/release/gist reference tables; correct the equality note to reflect Unicode case-folding.New filtering capabilities