feat(ecosystem): Implement cross-system issue synchronization#14
feat(ecosystem): Implement cross-system issue synchronization#14ShashankFC wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements cross-system issue synchronization with cycle prevention for assignment operations between Sentry and external issue tracking systems. The changes ensure that when an assignment originates from an external integration, it won't be synced back to that same integration, preventing infinite synchronization loops.
Changes:
- Added
AssignmentSourcedata structure to track the origin of assignment operations - Updated assignment and deassignment methods to accept and propagate assignment source information
- Modified
should_synclogic to prevent synchronization cycles by checking if the source matches the target integration
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sentry/integrations/services/assignment_source.py | Introduces AssignmentSource dataclass for tracking assignment origins with integration metadata |
| src/sentry/models/groupassignee.py | Adds assignment_source parameter to assign and deassign methods and passes it to sync functions |
| src/sentry/integrations/utils/sync.py | Updates sync functions to create and propagate AssignmentSource objects through the sync pipeline |
| src/sentry/integrations/tasks/sync_assignee_outbound.py | Modifies task to accept and parse assignment source dictionaries for cycle detection |
| src/sentry/integrations/mixins/issues.py | Updates should_sync method to check assignment source and prevent sync cycles |
| tests/sentry/integrations/services/test_assignment_source.py | Adds unit tests for AssignmentSource serialization and deserialization |
| tests/sentry/models/test_groupassignee.py | Adds test for cycle prevention and updates existing tests with new parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| result = AssignmentSource.from_dict(data) | ||
| assert result is None | ||
|
|
||
| def test_from_dict_inalid_data(self): |
There was a problem hiding this comment.
Corrected spelling of 'inalid' to 'invalid'.
| def test_from_dict_inalid_data(self): | |
| def test_from_dict_invalid_data(self): |
| class AssignmentSource: | ||
| source_name: str | ||
| integration_id: int | ||
| queued: datetime = timezone.now() |
There was a problem hiding this comment.
Using a mutable default argument (timezone.now()) in a dataclass field will cause all instances to share the same timestamp value. Use default_factory instead: queued: datetime = field(default_factory=timezone.now)
| external_issue, | ||
| is_resolved, | ||
| project_id, | ||
| assignment_source: AssignmentSource | None = None, |
There was a problem hiding this comment.
The parameter is named assignment_source but this method is for status synchronization, not assignment. Consider renaming to sync_source or status_source for clarity.
| assignment_source: AssignmentSource | None = None, | |
| sync_source: AssignmentSource | None = None, |
Test 7
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.
Replicated from ai-code-review-evaluation/sentry-coderabbit#7