Skip to content

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

Open
adamsaimi wants to merge 1 commit intoecosystem-sync-integration-beforefrom
ecosystem-sync-integration-after
Open

feat(ecosystem): Implement cross-system issue synchronization#4
adamsaimi wants to merge 1 commit intoecosystem-sync-integration-beforefrom
ecosystem-sync-integration-after

Conversation

@adamsaimi
Copy link
Owner

Test 7

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

Choose a reason for hiding this comment

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

[Best Practice] Mutable Default Value in Dataclass

  • Problem: The default value for queued is timezone.now(), which is evaluated once at module load, causing all instances to share the same timestamp.
  • Fix: Use field(default_factory=timezone.now) to ensure a unique timestamp for each instance.

@classmethod
def from_dict(cls, input_dict: dict[str, Any]) -> AssignmentSource | None:
try:
return cls(**input_dict)
Copy link
Owner Author

Choose a reason for hiding this comment

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

[Bug] Incorrect Type for queued Field After Deserialization

  • Problem: JSON serialization converts datetime objects to strings, causing the queued field to be a str instead of a datetime in from_dict, leading to potential AttributeError or TypeError.
  • Fix: Manually parse the queued string back into a datetime object within the from_dict method.

@adamsaimi
Copy link
Owner Author

🔥 Summary done with Reviewate 🎯


📋 Description

  • Introduces an AssignmentSource dataclass to track the origin of assignment changes.
  • Modifies IssueBasicIntegration and IssueSyncIntegration to accept the AssignmentSource.
  • Updates the should_sync method to prevent infinite sync loops by checking the assignment source.
  • Adjusts the sync_assignee_outbound task and utility functions to pass and utilize AssignmentSource information.

🎯 Impact

  • Enables cross-system synchronization of issue assignments and statuses.
  • Prevents infinite sync loops between Sentry systems.
  • Provides an audit trail for assignment changes, improving integration robustness.

✨ Generated with style! ✨

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.

2 participants