-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat(integrations): Make sync_status_inbound
a Task
#28906
Conversation
32f9299
to
f0ac860
Compare
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.
👍 looks good
src/sentry/integrations/issues.py
Outdated
def should_sync(self, attribute: str) -> bool: | ||
key = getattr(self, f"{attribute}_key", None) | ||
return self.org_integration.config.get(key, False) |
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.
this is a clever and satisfying refactor 👏
|
||
def get_done_states(self, project: str) -> Sequence[str]: | ||
def _get_done_statuses(self, project: str) -> Set[str]: |
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.
should this be _get_done_states
?
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.
I wanted to match _get_done_statuses()
from src/sentry/integrations/jira/
.
@retry(exclude=(Integration.DoesNotExist,)) | ||
@track_group_async_operation | ||
def sync_status_inbound( | ||
integration_id: int, organization_id: int, issue_key: str, data: Mapping[str, Any] |
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.
I agree that providing a formless blob of data isn't ideal here, but since the task doesn't directly handle or 'expect a shape' from the data, I think it should be fine.
816d052
to
f6dd510
Compare
8bb6b28
to
6be88ff
Compare
6be88ff
to
7301830
Compare
7301830
to
44e9560
Compare
Azure Devops webhooks requests are timing out waiting for statuses to sync. This PR makes syncing async.
Something to note I have to pass an arbitrary JSON blob to the task but I'm not sure if that's kosher.