Skip to content
Snippets Groups Projects

WS-290: Fix QA

Merged Nathan Hertz requested to merge WS-290-fix-qa into main
1 file
+ 51
0
Compare changes
  • Side-by-side
  • Inline
"""change SendMessage qa_ready action to AnnounceQa action
Revision ID: ced8e001d262
Revises: acfdeb6777cb
Create Date: 2021-11-10 10:16:09.070171
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "ced8e001d262"
down_revision = "acfdeb6777cb"
branch_labels = None
depends_on = None
def upgrade():
"""
Modify action that gets triggered on QA workflow complete;
Change it to perform the AnnounceQa action instead of attempting to SendMessage with arguments qa_ready
"""
op.execute(
"""
UPDATE capability_state_actions SET action_type = 'AnnounceQa', arguments = null
WHERE action_type = 'SendMessage'
AND arguments = 'qa_ready'
AND transition_id = (
SELECT transition_id FROM capability_state_transitions
WHERE pattern = 'type == workflow-complete'
AND capability_name = 'std_calibration'
)
"""
)
def downgrade():
"""
Undo above change
"""
op.execute(
"""
UPDATE capability_state_actions SET action_type = 'SendMessage', arguments = 'qa_ready'
WHERE action_type = 'AnnounceQa'
AND arguments IS null
AND transition_id = (
SELECT transition_id FROM capability_state_transitions
WHERE pattern = 'type == workflow-complete'
AND capability_name = 'std_calibration'
)
"""
)
Loading