-
Notifications
You must be signed in to change notification settings - Fork 2k
chore(devex): Migrate Error Tracking Models to Products Structure #38775
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: master
Are you sure you want to change the base?
Conversation
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.
27 files reviewed, 3 comments
null=True, on_delete=django.db.models.deletion.CASCADE, to="error_tracking.errortrackingrelease" | ||
), | ||
), |
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.
syntax: Foreign key reference uses incorrect app name. Should be "products.error_tracking.backend.errortrackingrelease"
or just "error_tracking.errortrackingrelease"
for consistency with other references in the migration.
null=True, on_delete=django.db.models.deletion.CASCADE, to="error_tracking.errortrackingrelease" | |
), | |
), | |
models.ForeignKey( | |
null=True, on_delete=django.db.models.deletion.CASCADE, to="error_tracking.errortrackingrelease" | |
), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/error_tracking/backend/migrations/0001_initial_migration.py
Line: 138:140
Comment:
syntax: Foreign key reference uses incorrect app name. Should be `"products.error_tracking.backend.errortrackingrelease"` or just `"error_tracking.errortrackingrelease"` for consistency with other references in the migration.
```suggestion
models.ForeignKey(
null=True, on_delete=django.db.models.deletion.CASCADE, to="error_tracking.errortrackingrelease"
),
```
How can I resolve this? If you propose a fix, please make it concise.
on_delete=django.db.models.deletion.SET_NULL, | ||
to="error_tracking.errortrackingsymbolset", | ||
), |
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.
syntax: Foreign key reference uses incorrect app name. Should be "error_tracking.errortrackingsymbolset"
for consistency with other references in the migration.
on_delete=django.db.models.deletion.SET_NULL, | |
to="error_tracking.errortrackingsymbolset", | |
), | |
models.ForeignKey( | |
null=True, | |
on_delete=django.db.models.deletion.SET_NULL, | |
to="error_tracking.errortrackingsymbolset", | |
), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/error_tracking/backend/migrations/0001_initial_migration.py
Line: 184:186
Comment:
syntax: Foreign key reference uses incorrect app name. Should be `"error_tracking.errortrackingsymbolset"` for consistency with other references in the migration.
```suggestion
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="error_tracking.errortrackingsymbolset",
),
```
How can I resolve this? If you propose a fix, please make it concise.
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
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.
Ok for ClickHouse.
Migrated error tracking models from
posthog/models/error_tracking/
toproducts/error_tracking/backend/
as part of the modularization effort to better organize PostHog's codebase into product-focused directories.What Changed
📁 File Structure Migration
From:
To:
🔄 Import Updates Across Codebase
All imports were automatically updated:
from posthog.models.error_tracking import ErrorTrackingIssue
→from products.error_tracking.backend.models import ErrorTrackingIssue
from posthog.models.error_tracking.sql import ...
→from products.error_tracking.backend.sql import ...
from posthog.models.error_tracking.hogvm_stl import ...
→from products.error_tracking.backend.hogvm_stl import ...
🔗 Foreign Key References
Converted direct class references to string-based references for better app separation:
ForeignKey(Team, ...)
→ForeignKey("posthog.Team", ...)
ForeignKey(User, ...)
→ForeignKey("posthog.User", ...)
ForeignKey(Role, ...)
→ForeignKey("ee.Role", ...)
(Role is in the ee app)💾 Database Compatibility
db_table
settings⚙️ Django Configuration
products.error_tracking.backend
instead ofposthog.models.error_tracking
Models Moved
ErrorTrackingIssue
ErrorTrackingIssueFingerprintV2
ErrorTrackingStackFrame
ErrorTrackingSymbolSet
ErrorTrackingIssueAssignment
ErrorTrackingAssignmentRule
ErrorTrackingGroupingRule
ErrorTrackingSuppressionRule
ErrorTrackingRelease
ErrorTrackingExternalReference
ErrorTrackingIssueFingerprint
Impact
Files Affected
posthog/models/error_tracking/
posthog/api/error_tracking.py
)posthog/management/commands/sync_exceptions_to_clickhouse.py
)posthog/hogql_queries/error_tracking_query_runner.py
)dags/symbol_set_cleanup.py
)This migration establishes error tracking as a proper product module while maintaining full backward compatibility and requiring no database changes.