Skip to content

feat(grouping): Add Salesforce record ID parameterization#107761

Draft
JoshFerge wants to merge 1 commit intomasterfrom
jferg/salesforce-id-parameterization
Draft

feat(grouping): Add Salesforce record ID parameterization#107761
JoshFerge wants to merge 1 commit intomasterfrom
jferg/salesforce-id-parameterization

Conversation

@JoshFerge
Copy link
Member

Summary

  • Adds a new salesforce_id parameterization regex that matches 15 and 18 character Salesforce record IDs containing both letters and digits
  • Placed before the hex pattern to avoid partial matches on 18-char IDs
  • Uses negative lookahead (?!0[xX]) to avoid matching hex-prefixed values

Test plan

  • Added test cases for 15-char and 18-char Salesforce IDs
  • Added test for Salesforce ID embedded in a message
  • Added negative test for pure alphabetic 15-char words
  • Added negative test for pure numeric 15-digit strings
  • Verified existing hex tests still pass
  • pytest -svv --reuse-db tests/sentry/grouping/test_parameterization.py — 204 passed

Parameterize 15 and 18 character Salesforce record IDs so that
messages differing only by record ID get grouped together.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 6, 2026
Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This in principle looks fine, but what do we think are the chances of false positives here?

Comment on lines +79 to +84
("salesforce_id - 15 char", "006M000002Tks8Z", "<salesforce_id>"),
(
"salesforce_id - in message",
"Failed to update 006M000002Tks8Z record",
"Failed to update <salesforce_id> record",
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as on the previous PR - this test isn't necessary.

Comment on lines +85 to +86
("salesforce_id - not pure alpha", "troubleshooters", "troubleshooters"),
("salesforce_id - not pure digits 15", "123456789012345", "<int>"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummm... am I missing something? In what way are these (respectively) not purely letters and purely numbers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me see, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants