mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 03:30:10 +00:00
Add bundle key to artifact model (#5092)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f7749e496c
commit
e08ff39a49
3 changed files with 39 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
"""add bundle_key column to artifacts
|
||||
|
||||
Revision ID: d38cca7e13b8
|
||||
Revises: b37f05a2bfbf
|
||||
Create Date: 2026-03-13 19:56:03.116922+00:00
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "d38cca7e13b8"
|
||||
down_revision: Union[str, None] = "b37f05a2bfbf"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column("artifacts", sa.Column("bundle_key", sa.String(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column("artifacts", "bundle_key")
|
||||
# ### end Alembic commands ###
|
||||
|
|
@ -55,6 +55,12 @@ class ArtifactType(StrEnum):
|
|||
# PDF files
|
||||
PDF = "pdf"
|
||||
|
||||
# Step archive: one ZIP per step containing all step artifacts (text + screenshots)
|
||||
STEP_ARCHIVE = "step_archive"
|
||||
|
||||
# Task archive: one ZIP per task containing task-level cleanup artifacts (HAR, console log, trace, final screenshot)
|
||||
TASK_ARCHIVE = "task_archive"
|
||||
|
||||
|
||||
class Artifact(BaseModel):
|
||||
created_at: datetime = Field(
|
||||
|
|
@ -75,6 +81,7 @@ class Artifact(BaseModel):
|
|||
artifact_id: str
|
||||
artifact_type: ArtifactType
|
||||
uri: str
|
||||
bundle_key: str | None = None
|
||||
task_id: str | None = None
|
||||
step_id: str | None = None
|
||||
workflow_run_id: str | None = None
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ class ArtifactModel(Base):
|
|||
step_id = Column(String, index=True)
|
||||
artifact_type = Column(String)
|
||||
uri = Column(String)
|
||||
bundle_key = Column(String, nullable=True)
|
||||
run_id = Column(String, nullable=True, index=True)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
|
||||
modified_at = Column(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue