-
Notifications
You must be signed in to change notification settings - Fork 504
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
Enhancement/case management workflows #2550
Conversation
…tflix/dispatch into enhancement/case-management-workflows
…tflix/dispatch into enhancement/case-management-workflows
This pull request introduces 1 alert and fixes 1 when merging 785452c into 0e78509 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request fixes 1 alert when merging 5a8a25f into 0e78509 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 5d67144 into 6ec0876 - view on LGTM.com fixed alerts:
|
from .workflow.scheduled import ( | ||
daily_sync_workflow, # noqa | ||
sync_active_stable_workflows, # noqa | ||
sync_workflow, # noqa | ||
) |
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.
Nit: this could be a one-liner
@@ -25,110 +23,84 @@ | |||
WORKFLOW_SYNC_INTERVAL = 30 # seconds | |||
|
|||
|
|||
def sync_workflows(db_session, project, workflow_plugin, incidents, notify: bool = False): | |||
def sync_workflow(db_session, project, workflow_plugin, instance, notify: bool = 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.
Nit: add typing
creator = participant_service.get_by_incident_id_and_email( | ||
db_session=db_session, | ||
incident_id=incident.id, | ||
email=instance_in.creator.individual.email, | ||
) |
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.
How's this going to work for cases where we don't have participants (yet)?
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.
We don't pass a creator for cases. This is only here to support the existing incident use case (where we do have participants). When/if we add participants to cases we can pass a creator when creating workflows from cases.
This change allows for workflows to be associated with cases. Additionally, it provides UI to allow workflows to be executed from the web UI (previously it was exclusive to Slack) for both cases and incidents.
As part of the consolidation, I've simplified the syncing of workflows to find any outstanding or uncompleted workflow (as opposed for just open incidents).
It also adds a new endpoint
/run
to the workflows endpoint.