Skip to content
Snippets Groups Projects

Update the product validation task

All threads resolved!
10 files
+ 268
17
Compare changes
  • Side-by-side
  • Inline
Files
10
  • c675b274
    Split off task_validate_products · c675b274
    Karel van Klink authored
    The built-in task_validate_products is now replaced by task_validate_geant_products such that it removes the step that requires us to add modify_note to all products. This workflow is not used by us, and therefore doesn't need to be tested for.
"""Add task_validate_geant_products.
Revision ID: 31fd1ae8d5bb
Revises: a1a69e7554c4
Create Date: 2024-07-15 15:34:00.00000
"""
from uuid import uuid4
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "31fd1ae8d5bb"
down_revision = "a1a69e7554c4"
branch_labels = None
depends_on = None
workflows = [
{"name": "task_validate_geant_products", "description": "Validate GEANT products", "workflow_id": uuid4(), "target": "SYSTEM"},
]
def upgrade() -> None:
conn = op.get_bind()
for workflow in workflows:
conn.execute(
sa.text(
"INSERT INTO workflows VALUES (:workflow_id, :name, :target, :description, now()) ON CONFLICT DO NOTHING"
),
workflow,
)
def downgrade() -> None:
conn = op.get_bind()
for workflow in workflows:
conn.execute(sa.text("DELETE FROM workflows WHERE name = :name"), {"name": workflow["name"]})
Loading