Skip to content
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

Merged
merged 25 commits into from
Oct 31, 2022

Conversation

kevgliss
Copy link
Contributor

@kevgliss kevgliss commented Sep 23, 2022

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.

Screen Shot 2022-09-23 at 3 44 26 PM
Screen Shot 2022-10-03 at 3 01 34 PM
Screen Shot 2022-10-03 at 3 01 57 PM

@kevgliss kevgliss added the enhancement New feature or request label Sep 23, 2022
@kevgliss kevgliss marked this pull request as draft September 26, 2022 17:03
@kevgliss kevgliss marked this pull request as ready for review October 3, 2022 22:04
@kevgliss kevgliss changed the title [WIP] Enhancement/case management workflows Enhancement/case management workflows Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@Netflix Netflix deleted a comment from lgtm-com bot Oct 3, 2022
@lgtm-com
Copy link

lgtm-com bot commented Oct 3, 2022

This pull request introduces 1 alert and fixes 1 when merging 785452c into 0e78509 - view on LGTM.com

new alerts:

  • 1 for Variable defined multiple times

fixed alerts:

  • 1 for Use of the return value of a procedure

@lgtm-com
Copy link

lgtm-com bot commented Oct 4, 2022

This pull request fixes 1 alert when merging 5a8a25f into 0e78509 - view on LGTM.com

fixed alerts:

  • 1 for Use of the return value of a procedure

@lgtm-com
Copy link

lgtm-com bot commented Oct 4, 2022

This pull request fixes 1 alert when merging 5d67144 into 6ec0876 - view on LGTM.com

fixed alerts:

  • 1 for Use of the return value of a procedure

Comment on lines 609 to 611
from .workflow.scheduled import (
daily_sync_workflow, # noqa
sync_active_stable_workflows, # noqa
sync_workflow, # noqa
)
Copy link
Contributor

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):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add typing

Comment on lines +125 to +129
creator = participant_service.get_by_incident_id_and_email(
db_session=db_session,
incident_id=incident.id,
email=instance_in.creator.individual.email,
)
Copy link
Contributor

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)?

Copy link
Contributor Author

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.

@kevgliss kevgliss merged commit 0b75d5d into master Oct 31, 2022
@kevgliss kevgliss deleted the enhancement/case-management-workflows branch October 31, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants