-
Notifications
You must be signed in to change notification settings - Fork 462
fix(Segments): Improve data model around live segments #6275
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| ] | ||
| # Note: project.segments is prefetched with Segment.live_objects which already | ||
| # filters by version_of__isnull=True, so no need to filter again here. | ||
| project_segments = list(project.segments.all()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Unfiltered Segment Versions Create Duplicates
The comment claims project.segments is prefetched with Segment.live_objects which filters by version_of__isnull=True, but the segments related_name uses the default Segment.objects manager. Without explicit filtering, this will include all segment versions (both canonical and revisions), causing duplicate segments to be mapped to the engine environment model.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
106ec2e to
fbcf1b3
Compare
fbcf1b3 to
d2729ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor/segment-change-requests-cleanup #6275 +/- ##
=========================================================================
Coverage 98.02% 98.02%
=========================================================================
Files 1280 1281 +1
Lines 45399 45401 +2
=========================================================================
+ Hits 44501 44503 +2
Misses 898 898 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
d2729ac to
15948bd
Compare
Closes #5825
Changes
Segment.version_of = nullthe indication for a live segmentImplementation Notes
Warning
Migration
0031_set_version_of_to_null_for_canonical_segments:version_of=selftoversion_of=NULL0023which originally setversion_of=id