refactor: move database.enums to shared.django_apps.enums#701
Draft
thomasrockhu-codecov wants to merge 4 commits intomainfrom
Draft
refactor: move database.enums to shared.django_apps.enums#701thomasrockhu-codecov wants to merge 4 commits intomainfrom
thomasrockhu-codecov wants to merge 4 commits intomainfrom
Conversation
2 tasks
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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