Skip to content

ref(grouping): Add split enhancements to enhancement bases #90557

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

Draft
wants to merge 3 commits into
base: kmclb-add-ability-to-split-enhancements
Choose a base branch
from

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Apr 28, 2025

Note: This is currently blocked by getsentry/ophio#73, which in turn is blocked by getsentry/ophio#72. Once those are merged, it will fix the failing test.


This is a follow-up to #90505, which enabled enhancements (stacktrace rules) to be split up into classifier and contribtues types. In this PR, such split enhancements are added the default enhancements objects (the "bases," the ones representing the rules from each grouping config), to live alongside the regular enhancements, by forcing them to be created using version 3, rather than version 2.

This means that now if non-default enhancements were to be instantiated with version 3, their split rust enhancements would actually pull in the real default rules, rather than the empty rules provided by the classifier_rust_enhancements and contributes_rust_enhancements class variables. Nothing is actually doing that right now, but this means that once we turn it on, it'll have the right data.

This PR also adds some magic methods to the EnhancementRule class, to make testing easier.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 28, 2025
Copy link

codecov bot commented Apr 28, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
25299 1 25298 307
View the top 1 failed test(s) by shortest run time
tests.sentry.grouping.test_enhancer::test_basic_parsing[3]
Stack Traces | 0.103s run time
#x1B[1m#x1B[.../grouping/enhancer/__init__.py#x1B[0m:92: in get_rust_enhancements
    return RustEnhancements.from_config_structure(input, RUST_CACHE)
#x1B[1m#x1B[31mE   RuntimeError: Invalid syntax Rust Enhancements only supports config_structure version `2`#x1B[0m

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m
#x1B[1m#x1B[.../sentry/grouping/test_enhancer.py#x1B[0m:126: in test_basic_parsing
    assert Enhancements.from_base64_string(enhancements_str).base64_string == enhancements_str
#x1B[1m#x1B[.../grouping/enhancer/__init__.py#x1B[0m:457: in from_base64_string
    rust_enhancements = get_rust_enhancements("config_structure", pickled)
#x1B[1m#x1B[.../grouping/enhancer/__init__.py#x1B[0m:97: in get_rust_enhancements
    raise InvalidEnhancerConfig(str(e))
#x1B[1m#x1B[31mE   sentry.grouping.enhancer.exceptions.InvalidEnhancerConfig: Invalid syntax Rust Enhancements only supports config_structure version `2`#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

1 participant