Skip to content

feat(ecosystem): Implement cross-system issue synchronization#14

Open
ShashankFC wants to merge 1 commit into
ecosystem-sync-integration-beforefrom
ecosystem-sync-integration-after
Open

feat(ecosystem): Implement cross-system issue synchronization#14
ShashankFC wants to merge 1 commit into
ecosystem-sync-integration-beforefrom
ecosystem-sync-integration-after

Conversation

@ShashankFC

Copy link
Copy Markdown
Contributor

Test 7

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced assignment synchronization with cycle prevention to ensure reliable bidirectional syncing between Sentry and integrated external issue tracking systems without infinite loops.

✏️ Tip: You can customize this high-level summary in your review settings.


Replicated from ai-code-review-evaluation/sentry-coderabbit#7

@ShashankFC ShashankFC requested a review from Copilot January 30, 2026 10:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AssignmentSource data structure to track the origin of assignment operations
  • Updated assignment and deassignment methods to accept and propagate assignment source information
  • Modified should_sync logic 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):

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'inalid' to 'invalid'.

Suggested change
def test_from_dict_inalid_data(self):
def test_from_dict_invalid_data(self):

Copilot uses AI. Check for mistakes.
class AssignmentSource:
source_name: str
integration_id: int
queued: datetime = timezone.now()

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copilot uses AI. Check for mistakes.
external_issue,
is_resolved,
project_id,
assignment_source: AssignmentSource | None = None,

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
assignment_source: AssignmentSource | None = None,
sync_source: AssignmentSource | None = None,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants