-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: move database.enums to shared.django_apps.enums #701
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #701 +/- ##
==========================================
- Coverage 92.34% 92.23% -0.11%
==========================================
Files 1302 1303 +1
Lines 47805 47831 +26
Branches 1619 1619
==========================================
- Hits 44146 44119 -27
- Misses 3350 3403 +53
Partials 309 309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Extract StatusNotifier.notify() (98 lines) into focused methods under 50 lines each. - _check_notify_preconditions(): validates branches/builds requirements - _build_payload_with_behavior(): builds payload applying flag coverage rules - _set_payload_url(): sets URL based on PR or commit context Co-authored-by: Cursor <cursoragent@cursor.com>
Extract ChecksNotifier.notify() (176 lines) into focused methods under 50 lines each. - _validate_pull_request(): validates PR exists, is in provider, is open - _check_preexisting_status(): checks if commit status already exists - _build_payload_with_behavior(): overrides parent with checks-specific logic - Removed unused nullcontext and get_commit_url imports Co-authored-by: Cursor <cursoragent@cursor.com>
…fier - Fix 'comparison.pull is None or ()' to 'comparison.pull is None' in _validate_pull_request — the 'or ()' was a no-op since () is falsy, so the expression was equivalent to just 'is None' - Fix typo "where chnaged" -> "were changed" in get_line_diff docstring Co-authored-by: Cursor <cursoragent@cursor.com>
Move all plain Python enums from apps/worker/database/enums.py to libs/shared/shared/django_apps/enums.py, decoupling them from the SQLAlchemy database package. Update all ~60 consumer files in the worker to import from the new shared location. The old database/enums.py is kept as a re-export shim for backward compatibility. Part of the SQLAlchemy removal migration (Phase 0). Co-authored-by: Cursor <cursoragent@cursor.com>
7549d0c to
443fc35
Compare
Summary
libs/shared/shared/django_apps/enums.pywith all plain Python enums previously inapps/worker/database/enums.pydatabase/enums.pyas a re-export shim for backward compatibilityPart 1/3 of Phase 0 (SQLAlchemy removal migration).
Test plan
ruff checkpassesMade with Cursor