fix(grouping): Remove redundant salt wrapper components in legacy grouping #80682
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.
In our grouping algorithm, we sometimes include in the hash a constant value (a "salt") alongside the dynamic values generated from the event. (For example, when grouping ExpectCT and Expect-Staple security reports, we include
expect-ct
orexpect-staple
alongside the hostname of the server which violated the rule, so that the two types of violations hash into separate groups even when the hostname is the same.)However, in two places in the legacy grouping algorithm, we're using a salt grouping component not to add an extra value into the hashing but just as an extra wrapper around either an anonymous module name or an anonymous function name. This doesn't change the eventual hash value, but it does violate the thus far unenforced (but soon to be enforced) type signature of both the module and function grouping components, which are meant only to hold actual values, not wrapper components. This fixes the type mismatch by removing the salt component wrappers and placing the module and function name values directly in the module and function grouping components.
Notes:
ignored module
hint used to live. I was going to incorporate it into the remaining hint until I realized that in fact it's been a lie all along - we don't ignore the module! So instead I just got rid of it. (You can see that the module is used because it has a*
next to it in the snapshots, meaning it contributes to grouping.)