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

ref(feedback): extract utils and shim code from create_feedback #89458

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Apr 12, 2025

This PR moves code from create_feedback.py to new files in the feedback module. This makes the file more manageable, and also allows imports between create_feedback (feedback consumer code) and ingest/userreport.py (the entrypoint for ingesting UR's/legacy feedback). See https://develop.sentry.dev/application-architecture/feedback-architecture/ for the full ingest pipeline.

Right now importing save_userreport from create_feedback.py leads to a circular import. We need this for incoming work to link new feedbacks from issue details. Extracting shim_to_feedback and making a shared lib/ will fix this problem, and help w/future maintenance. We shouldn't have as much dependence on create_feedback.py as we do now.

Details of changes:
Moved from feedback.usecases.create_feedback to feedback.lib.utils:

  • FeedbackCreationSource enum
  • UNREAL_FEEDBACK_UNATTENDED_MESSAGE constant
  • is_in_feedback_denylist util

Moved from feedback.usecases.create_feedback to feedback.usecases.shim_to_feedback:

  • shim_to_feedback, helper for porting legacy format to the new one

Corresponding tests are also moved.

@aliu39 aliu39 requested review from a team as code owners April 12, 2025 02:07
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 12, 2025
Copy link

codecov bot commented Apr 12, 2025

Codecov Report

Attention: Patch coverage is 97.29730% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/feedback/usecases/shim_to_feedback.py 92.30% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #89458      +/-   ##
==========================================
- Coverage   85.44%   85.38%   -0.06%     
==========================================
  Files       10164    10162       -2     
  Lines      575564   573629    -1935     
  Branches    22566    22566              
==========================================
- Hits       491802   489815    -1987     
- Misses      83019    83071      +52     
  Partials      743      743              

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