-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(grouping): Small fingerprinting simplification #80935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lobsterkatie
merged 5 commits into
master
from
kmclb-clean-up-fingerprint-info-related-code
Nov 20, 2024
Merged
fix(grouping): Small fingerprinting simplification #80935
lobsterkatie
merged 5 commits into
master
from
kmclb-clean-up-fingerprint-info-related-code
Nov 20, 2024
Conversation
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
b1ae545 to
820ded0
Compare
armenzg
approved these changes
Nov 19, 2024
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
lobsterkatie
added a commit
that referenced
this pull request
Nov 20, 2024
In #80935, we switched from calculating fingerprinting rule text in the `expose_fingerprint_dict` helper to reading it from the fingerprint info, since as of #79231 we store it there. This works fine for new events, but this code also runs when someone opens the grouping info section of the issue details page, and if they do that on an event from before we started storing the rule text, it results in a key error. This fixes that by partially undoing the change made in #80935 - it doesn't switch back to always re-calculating the the rule text, but does fall back to doing so when it's not found in the stored data.
harshithadurai
pushed a commit
that referenced
this pull request
Nov 25, 2024
This makes four small simplifying changes to our fingerprinting code:
- In `get_grouping_variants_for_event`, default `fingerprint_info` to `{}`, thus ensuring it always has a value. This in turn means that it doesn't have to be defaulted to `None` in the `CustomFingerprintVariant` and `SaltedComponentVariant` constructors.
- Remove the default `None` value for `fingerprint_info` in `expose_fingerprint_dict` as well. (This in fact never needed the default, even before the above change, since it's called on the above classes' `.info` attribute, to which the constructors have always given a value.)
- In `expose_fingerprint_dict`, remove the `if not info:` check, since
a) the above changes mean `info` is never `None`, and
b) in fact, it's never even empty, because `expose_fingerprint_dict` is only called by the aforementioned classes, and said classes are only ever used in the presence of either a client fingerprint or a matched server fingerprint rule (the two pieces of data which `info` can contain).
- Also in `expose_fingerprint_dict`, stop creating an instance of `FingerprintRule` just to get the rule's textual form, since as of #79231 that data is included straight in the `matched_rule` dictionary.
harshithadurai
pushed a commit
that referenced
this pull request
Nov 25, 2024
In #80935, we switched from calculating fingerprinting rule text in the `expose_fingerprint_dict` helper to reading it from the fingerprint info, since as of #79231 we store it there. This works fine for new events, but this code also runs when someone opens the grouping info section of the issue details page, and if they do that on an event from before we started storing the rule text, it results in a key error. This fixes that by partially undoing the change made in #80935 - it doesn't switch back to always re-calculating the the rule text, but does fall back to doing so when it's not found in the stored data.
evanh
pushed a commit
that referenced
this pull request
Nov 25, 2024
In #80935, we switched from calculating fingerprinting rule text in the `expose_fingerprint_dict` helper to reading it from the fingerprint info, since as of #79231 we store it there. This works fine for new events, but this code also runs when someone opens the grouping info section of the issue details page, and if they do that on an event from before we started storing the rule text, it results in a key error. This fixes that by partially undoing the change made in #80935 - it doesn't switch back to always re-calculating the the rule text, but does fall back to doing so when it's not found in the stored data.
andrewshie-sentry
pushed a commit
that referenced
this pull request
Dec 2, 2024
This makes four small simplifying changes to our fingerprinting code:
- In `get_grouping_variants_for_event`, default `fingerprint_info` to `{}`, thus ensuring it always has a value. This in turn means that it doesn't have to be defaulted to `None` in the `CustomFingerprintVariant` and `SaltedComponentVariant` constructors.
- Remove the default `None` value for `fingerprint_info` in `expose_fingerprint_dict` as well. (This in fact never needed the default, even before the above change, since it's called on the above classes' `.info` attribute, to which the constructors have always given a value.)
- In `expose_fingerprint_dict`, remove the `if not info:` check, since
a) the above changes mean `info` is never `None`, and
b) in fact, it's never even empty, because `expose_fingerprint_dict` is only called by the aforementioned classes, and said classes are only ever used in the presence of either a client fingerprint or a matched server fingerprint rule (the two pieces of data which `info` can contain).
- Also in `expose_fingerprint_dict`, stop creating an instance of `FingerprintRule` just to get the rule's textual form, since as of #79231 that data is included straight in the `matched_rule` dictionary.
andrewshie-sentry
pushed a commit
that referenced
this pull request
Dec 2, 2024
In #80935, we switched from calculating fingerprinting rule text in the `expose_fingerprint_dict` helper to reading it from the fingerprint info, since as of #79231 we store it there. This works fine for new events, but this code also runs when someone opens the grouping info section of the issue details page, and if they do that on an event from before we started storing the rule text, it results in a key error. This fixes that by partially undoing the change made in #80935 - it doesn't switch back to always re-calculating the the rule text, but does fall back to doing so when it's not found in the stored data.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This makes four small simplifying changes to our fingerprinting code:
In
get_grouping_variants_for_event, defaultfingerprint_infoto{}, thus ensuring it always has a value. This in turn means that it doesn't have to be defaulted toNonein theCustomFingerprintVariantandSaltedComponentVariantconstructors.Remove the default
Nonevalue forfingerprint_infoinexpose_fingerprint_dictas well. (This in fact never needed the default, even before the above change, since it's called on the above classes'.infoattribute, to which the constructors have always given a value.)In
expose_fingerprint_dict, remove theif not info:check, sincea) the above changes mean
infois neverNone, andb) in fact, it's never even empty, because
expose_fingerprint_dictis only called by the aforementioned classes, and said classes are only ever used in the presence of either a client fingerprint or a matched server fingerprint rule (the two pieces of data whichinfocan contain).Also in
expose_fingerprint_dict, stop creating an instance ofFingerprintRulejust to get the rule's textual form, since as of ref(grouping): Improve representation of grouping objects #79231 that data is included straight in thematched_ruledictionary.