diff --git a/src/sentry/grouping/parameterization.py b/src/sentry/grouping/parameterization.py index b508747d5eb408..e0a1031b0adfb9 100644 --- a/src/sentry/grouping/parameterization.py +++ b/src/sentry/grouping/parameterization.py @@ -142,8 +142,27 @@ def _get_pattern(self, raw_pattern: str) -> str: (\d{4}-?[01]\d-?[0-3]\d[\sT][0-2]\d:?[0-5]\d) # no seconds ) | - # Kitchen - ([1-9]\d?:\d{2}(:\d{2})?(?:\s?[aApP][Mm])?) + # Kitchen, 12-hr + ( + (?", ), + ("ip - too many initial characters", "12345:6:789", "::"), + ("ip - too many final characters", "123:4:56789", "::"), ("traceparent - aws", "1-67891233-abcdef012345678912345678", ""), ( "traceparent - aws, but not word boundary", @@ -98,8 +100,15 @@ ("date - kitchen lowercase with space", "12:31 pm", ""), ("date - kitchen 24-hour", "23:21", ""), ("date - kitchen 24-hour with seconds", "23:21:12", ""), + ("date - kitchen 24-hour with leading zero", "09:08", ""), ("date - kitchen 24-hour no leading zero", "9:08", ""), + ("date - kitchen 24-hour midnight with leading zero", "00:31", ""), + ("date - kitchen 24-hour midnight no leading zero", "0:12", ""), ("date - kitchen too many initial digits", "908:31", ":"), + ("date - kitchen too many final digits", "11:2112", ":"), + ("date - kitchen hour too big", "31:21", ":"), + ("date - kitchen minute too big", "12:99", ":"), + ("date - kitchen second too big", "12:31:99", "::"), ("date - time", "15:04:05", ""), ("date - basic", "Mon Jan 02, 1999", ""), ("date - datetime compressed date", "20240220 11:55:33.546593", ""), @@ -232,48 +241,6 @@ def test_experimental_parameterization(name: str, input: str, expected: str) -> # parameterization. (Remember to remove the last item in each tuple for the cases you fix.) incorrect_cases = [ # ("name", "input", "desired", "actual") - ( - "date - kitchen 24-hour with leading zero", - "09:08", - "", - ":", - ), - ( - "date - kitchen 24-hour midnight with leading zero", - "00:31", - "", - ":", - ), - ( - "date - kitchen 24-hour midnight no leading zero", - "0:12", - "", - ":", - ), - ( - "date - kitchen hour too big", - "31:21", - ":", - "", - ), - ( - "date - kitchen minute too big", - "12:99", - ":", - "", - ), - ( - "date - kitchen second too big", - "12:31:99", - "::", - "", - ), - ( - "date - kitchen too many final digits", - "11:2112", - ":", - "12", - ), ( "hex without prefix - no letters, 8+ digits, negative", "-12345678", @@ -310,18 +277,6 @@ def test_experimental_parameterization(name: str, input: str, expected: str) -> "Fee::add() called too early", "() called too early", ), - ( - "ip - too many initial characters", - "12345:6:789", - "::", - ":9", - ), - ( - "ip - too many final characters", - "123:4:56789", - "::", - ":789", - ), ( "ip - v4 mapped to v6", "::ffff:192.168.1.1",