fix(grouping): Stop parameterizing message variable in custom titles#109893
Merged
lobsterkatie merged 3 commits intomasterfrom Mar 4, 2026
Merged
Conversation
scttcper
approved these changes
Mar 4, 2026
JonasBa
pushed a commit
that referenced
this pull request
Mar 5, 2026
…109893) Fingerprint rules can be used not only to affect grouping but also to set custom titles for events, using the same variables as are used for fingerprinting. When the `{{ message }}` variable appears in a fingerprint, we parameterize the value, as we do in other places where we use the message for grouping. This parameterization is currently over-applied, though, in that it's also happening when the `{{ message }}` variable is used in custom titles. (We don't parameterize error messages in non-custom titles, so we shouldn't be doing it in custom titles, either.) This fixes that by adding a new optional `parameterize_message` parameter to our `resolve_fingerprint_variable` helper. It defaults to `True`, so in most places there's no change in behavior, but it allows us to prevent the parameterization when we're calling it from `expand_title_template`. As can be seen in the snapshot, neither the fingerprint nor the hash changes, but the title now uses the original values from the message. This is the other half of the fix for #109301. (The first half was done in #109713.)
lobsterkatie
added a commit
that referenced
this pull request
Mar 11, 2026
This is a small refactor to the code used for variable resolution in custom fingerprints. Recently, we began parameterizing the `{{ message }}` variable using `normalize_message_for_grouping` inside of `resolve_fingerprint_variable`[1], but subsequently realized we needed to prevent parameterization when the variable is used for a custom title. Thus we introduced a `parameterize_message` parameter to `resolve_fingerprint_variable`[2], to control whether or not parameterization runs.
This PR is a different (better) solution to the same problem, done in order to both simplify the code and decrease the blast radius of an upcoming change to `normalize_message_for_grouping`. Instead of having `parameterize_message: True` at one of the two `resolve_fingerprint_variable` call sites and `parameterize_message: False` at the other, it just moves the parameterization to the one place where `parameterize_message` is currently true. This lets us get rid of the new parameter, and prevents the `parameterize_message: False` code from having to compensate for the `normalize_message_for_grouping` changes.
[1] #107808
[2] #109893
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fingerprint rules can be used not only to affect grouping but also to set custom titles for events, using the same variables as are used for fingerprinting. When the
{{ message }}variable appears in a fingerprint, we parameterize the value, as we do in other places where we use the message for grouping. This parameterization is currently over-applied, though, in that it's also happening when the{{ message }}variable is used in custom titles. (We don't parameterize error messages in non-custom titles, so we shouldn't be doing it in custom titles, either.)This fixes that by adding a new optional
parameterize_messageparameter to ourresolve_fingerprint_variablehelper. It defaults toTrue, so in most places there's no change in behavior, but it allows us to prevent the parameterization when we're calling it fromexpand_title_template. As can be seen in the snapshot, neither the fingerprint nor the hash changes, but the title now uses the original values from the message.This is the other half of the fix for #109301. (The first half was done in #109713.)