Skip to content

Conversation

@akshayutture-augment
Copy link

@akshayutture-augment akshayutture-augment commented Nov 14, 2025

Test 7


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


Note

Introduces AssignmentSource and threads it through assignee/status sync to prevent cross-integration assignment sync loops.

  • Integrations
    • Add AssignmentSource (src/sentry/integrations/services/assignment_source.py) with from_integration, to_dict, from_dict for tracking assignment origin.
    • Extend IssueBasicIntegration.should_sync(...) and IssueSyncIntegration.should_sync(...) to accept sync_source and short-circuit when source integration matches, preventing sync cycles.
    • Extend IssueSyncIntegration.sync_status_outbound(...) to accept assignment_source.
  • Tasks
    • Update sync_assignee_outbound task to accept assignment_source_dict, parse to AssignmentSource, pass to should_sync and sync_assignee_outbound.
  • Utils
    • In sync_group_assignee_inbound, pass AssignmentSource.from_integration(...) to GroupAssignee.objects.assign/deassign.
    • In sync_group_assignee_outbound, forward assignment_source via assignment_source_dict to the task.
  • Models
    • Update GroupAssigneeManager.assign/deassign to accept assignment_source and propagate to sync_group_assignee_outbound.
  • Tests
    • Add tests for AssignmentSource serialization/parsing.
    • Update/extend GroupAssignee tests to verify outbound sync receives assignment_source and that matching-source integrations do not trigger outbound sync.

Written by Cursor Bugbot for commit f9919d7. Configure here.

@akshayutture-augment
Copy link
Author

cursor review

class AssignmentSource:
source_name: str
integration_id: int
queued: datetime = timezone.now()
Copy link

Choose a reason for hiding this comment

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

Bug: Default Timestamps: One for All

The queued field uses timezone.now() as a default value, which is evaluated once at class definition time rather than at instance creation time. This means all AssignmentSource instances will share the same timestamp instead of getting unique timestamps when created. Use field(default_factory=timezone.now) instead to generate a fresh timestamp for each instance.

Fix in Cursor Fix in Web

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