Repository navigation
Allow multiple capture groups for debounce regex action - #14687
Conversation
fmarier
left a comment
There was a problem hiding this comment.
Instead of manually adding slashes (and potentially adding them at the end where it may not work), why not simply capture one of the slashes in a capture group?
e.g. instead of ^/([^/]+)/s/(.*)$, we could use ^/([^/]+)/s(/.*)$
pilgrim-brave
left a comment
There was a problem hiding this comment.
Not opposed to the concept. Deferring to François about the regexes. Definitely needs a lot more tests.
0294030 to
88d160e
Compare
fmarier
left a comment
There was a problem hiding this comment.
That looks good to me, but someone more familiar with Chromium idioms should check whether that's the best way to concatenate StringPieces.
@bridiver any thoughts? https://github.com/brave/brave-core/pull/14687/files#diff-19bb36033aacc98f6f730c5cbda666206d951a19f782c58fca555b7e44765ab3R215 |
88d160e to
29132b6
Compare
60fdef8 to
319b562
Compare
| return false; | ||
| // If URL matches an explicitly excluded pattern, this rule does not apply. | ||
| if (exclude_pattern_set_.MatchesURL(original_url)) | ||
| if (exclude_pattern_set_.MatchesURL(original_url)) { |
There was a problem hiding this comment.
this diff is not needed, existing formatting is acceptable
There was a problem hiding this comment.
I know but I just wanted to match everything up. It helps me a tiny bit when I want to add local logging to have these, and given that they're both equivalent I thought might as well. Personally I think always specifying {} is easier to read, but no strong feelings
|
@ShivanKaul can you attach testplan please? |
|
@MadhaviSeelam working on adding a test rule to the debounce.json list, but in the meantime the De-Yandex rules should be sufficient. I've updated the URLs to test in the test plan. |
|
@MadhaviSeelam updated the test plan with the test rule: https://dev-pages.brave.software/navigation-tracking/debouncing.html, all tests should pass (thanks @pes10k!) |
Resolves brave/brave-browser#24750
Submitter Checklist:
QA/YesorQA/No;release-notes/includeorrelease-notes/exclude;OS/...) to the associated issuenpm run test -- brave_browser_tests,npm run test -- brave_unit_tests,npm run lint,npm run gn_check,npm run tslintgit rebase master(if needed)Reviewer Checklist:
gnAfter-merge Checklist:
changes has landed on
Test Plan:
The following URLs should get debounced to the publisher URL, once the component update goes out:
https://dev-pages.brave.software/navigation-tracking/debouncing.html, all tests should pass for regression; the one under test is
Regex (multi)