Skip to content

Commit

Permalink
Detect revised Groups footer link.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobbins committed Nov 6, 2024
1 parent 7debf8a commit 13b5a52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internals/detect_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ def detect_gate_id(body) -> int | None:


THREAD_LINK_RE = re.compile(
r'To view this discussion on the web visit\s+'
r'To view this discussion visit\s+'
r'(> )?(https://groups\.google\.com/a/chromium.org/d/msgid/blink-dev/'
r'[-_0-9a-zA-Z%.]+[-_0-9a-zA-Z])', re.MULTILINE)
STAGING_THREAD_LINK_RE = re.compile(
r'To view this discussion on the web visit\s+'
r'To view this discussion visit\s+'
r'(> )?(https://groups\.google\.com/d/msgid/jrobbins-test/'
r'[-_0-9a-zA-Z%.]+[-_0-9a-zA-Z])', re.MULTILINE)

Expand Down
14 changes: 7 additions & 7 deletions internals/detect_intent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_detect_thread_url(self):
'Groups "blink-dev" group.\n'
'To unsubscribe from this group and stop receiving emails from it,'
'send an email to [email protected].\n'
'To view this discussion on the web visit https://groups.google.com'
'To view this discussion visit https://groups.google.com'
'/a/chromium.org/d/msgid/blink-dev/CAMO6jDPGfXfE5z6hJcWO112zX3We'
'-oNTb%2BZjiJk%2B6RNb9%2Bv05w%40mail.gmail.com. ')
self.assertEqual(
Expand All @@ -304,15 +304,15 @@ def test_detect_thread_url__quoted(self):
'> Groups "blink-dev" group.\n'
'> To unsubscribe from this group and stop receiving emails from it, send\n'
'> an email to [email protected].\n'
'> To view this discussion on the web visit\n'
'> To view this discussion visit\n'
'> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com\n'
'> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com?utm_medium=email&utm_source=foo\\n'
'ter>.\n'
'\n'
'--\n'
'You received this message because you are subscribed to the Google Groups "blink-dev" group.\n'
'To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].\n'
'To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7c94d7c3-212a-62de-dfa4-76bbd25990c9%40chromium.org.')
'To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7c94d7c3-212a-62de-dfa4-76bbd25990c9%40chromium.org.')
self.assertEqual(
('https://groups.google.com'
'/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com'),
Expand All @@ -329,15 +329,15 @@ def test_detect_thread_url__quoted_return_and_newline_before_period(self):
'> Groups "blink-dev" group.\r\n'
'> To unsubscribe from this group and stop receiving emails from it, send\r\n'
'> an email to [email protected].\r\n'
'> To view this discussion on the web visit\r\n'
'> To view this discussion visit\r\n'
'> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com\r\n'
'> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com?utm_medium=email&utm_source=foo\\r\n'
'ter>.\r\n'
'\r\n'
'--\r\n'
'You received this message because you are subscribed to the Google Groups "blink-dev" group.\r\n'
'To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].\r\n'
'To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7c94d7c3-212a-62de-dfa4-76bbd25990c9%40chromium.org\r\n.')
'To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7c94d7c3-212a-62de-dfa4-76bbd25990c9%40chromium.org\r\n.')
self.assertEqual(
('https://groups.google.com'
'/a/chromium.org/d/msgid/blink-dev/CAL5BFfULP5d3fNCAqeO2gLP56R3HCytmaNk%2B9kpYsC2dj4%3DqoQ%40mail.gmail.com'),
Expand All @@ -350,7 +350,7 @@ def test_detect_thread_url__staging(self):
'Groups "jrobbins-test" group.\n'
'To unsubscribe from this group and stop receiving emails from it,'
'send an email to [email protected].\n'
'To view this discussion on the web visit https://groups.google.com'
'To view this discussion visit https://groups.google.com'
'/d/msgid/jrobbins-test/CAMO6jDPGfXfE5z6hJcWO112zX3We'
'-oNTb%2BZjiJk%2B6RNb9%2Bv05w%40mail.gmail.com.\n')
self.assertEqual(
Expand Down Expand Up @@ -502,7 +502,7 @@ def setUp(self):
'\n--\n'
'instructions...\n'
'---\n'
'To view this discussion on the web visit ' +
'To view this discussion visit ' +
self.thread_url + '.')
self.review_json_data = {
'from_addr': '[email protected]',
Expand Down

0 comments on commit 13b5a52

Please sign in to comment.