Skip to content
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

🤖 Refactor AI Autofix Profile Processing Logic #83738

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

sentry-autofix[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Rohan Agarwal

Fixes SENTRY-3MMH

This commit refactors the logic within the group AI autofix endpoint to improve robustness when handling profile data. It adds checks for the existence of 'profile', 'frames', 'stacks', and 'samples' to ensure that the code gracefully handles scenarios where these elements may be missing. Additionally, it modifies the output structure to only generate a profile object if an execution tree is present, consolidating the results better. Overall, these changes aim to enhance the error handling and prevent potential issues when consuming profile data.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 3414.

@roaga roaga requested a review from jennmueng January 21, 2025 15:52
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/api/endpoints/group_ai_autofix.py 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #83738      +/-   ##
==========================================
+ Coverage   86.91%   87.63%   +0.71%     
==========================================
  Files        9494     9495       +1     
  Lines      541739   541753      +14     
  Branches    21235    21235              
==========================================
+ Hits       470870   474760    +3890     
+ Misses      70521    66645    -3876     
  Partials      348      348              

@roaga roaga marked this pull request as ready for review January 21, 2025 16:50
@roaga roaga requested a review from a team as a code owner January 21, 2025 16:50
@roaga roaga added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jan 21, 2025
@roaga roaga merged commit 3a5a82b into master Jan 21, 2025
50 of 51 checks passed
@roaga roaga deleted the autofix/refactor-ai-autofix-profile-processing-logic branch January 21, 2025 17:22
andrewshie-sentry pushed a commit that referenced this pull request Jan 22, 2025
👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Rohan Agarwal

Fixes
[SENTRY-3MMH](https://sentry.io/organizations/sentry/issues/6234451280/)

This commit refactors the logic within the group AI autofix endpoint to
improve robustness when handling profile data. It adds checks for the
existence of 'profile', 'frames', 'stacks', and 'samples' to ensure that
the code gracefully handles scenarios where these elements may be
missing. Additionally, it modifies the output structure to only generate
a profile object if an execution tree is present, consolidating the
results better. Overall, these changes aim to enhance the error handling
and prevent potential issues when consuming profile data.

If you have any questions or feedback for the Sentry team about this
fix, please email [[email protected]](mailto:[email protected]) with the
Run ID: 3414.

---------

Co-authored-by: sentry-autofix[bot] <157164994+sentry-autofix[bot]@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
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 Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants