Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/saving-state-last-updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon authored Nov 30, 2023
2 parents 26ed5ed + 9dae7b8 commit ecf3f91
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 79 deletions.
9 changes: 5 additions & 4 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ attrs==22.1.0
# jsonschema
backoff==2.2.1
# via schemathesis
bcrypt==4.0.1
bcrypt==4.1.1
# via -r requirements-base.in
blis==0.7.10
# via thinc
Expand Down Expand Up @@ -246,7 +246,7 @@ oauthlib[signedtoken]==3.2.2
# atlassian-python-api
# jira
# requests-oauthlib
openai==1.3.5
openai==1.3.6
# via -r requirements-base.in
packaging==23.1
# via
Expand Down Expand Up @@ -375,13 +375,13 @@ s3transfer==0.7.0
# via boto3
schedule==1.2.1
# via -r requirements-base.in
schemathesis==3.21.1
schemathesis==3.21.2
# via -r requirements-base.in
scipy==1.11.2
# via statsmodels
sentry-asgi==0.2.0
# via -r requirements-base.in
sentry-sdk==1.37.1
sentry-sdk==1.38.0
# via
# -r requirements-base.in
# sentry-asgi
Expand Down Expand Up @@ -418,6 +418,7 @@ sniffio==1.3.0
# anyio
# httpcore
# httpx
# openai
sortedcontainers==2.4.0
# via hypothesis
spacy==3.7.2
Expand Down
7 changes: 3 additions & 4 deletions src/dispatch/case/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,11 @@ class SignalRead(DispatchBase):


class SignalInstanceRead(DispatchBase):
signal: SignalRead
created_at: datetime
entities: Optional[List[EntityRead]] = []
tags: Optional[List[TagRead]] = []
raw: Any
fingerprint: Optional[str]
created_at: datetime
signal: SignalRead
tags: Optional[List[TagRead]] = []


class ProjectRead(DispatchBase):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Removes unused fingerprint column from signal instance model
Revision ID: 580a18ec4c39
Revises: bdaeabba3e53
Create Date: 2023-11-29 15:40:12.524085
"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "580a18ec4c39"
down_revision = "bdaeabba3e53"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("signal_instance", "fingerprint")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"signal_instance",
sa.Column("fingerprint", sa.VARCHAR(), autoincrement=False, nullable=True),
)
# ### end Alembic commands ###
2 changes: 0 additions & 2 deletions src/dispatch/signal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class SignalInstance(Base, TimeStampMixin, ProjectMixin):
case_type = relationship("CaseType", backref="signal_instances")
case_priority_id = Column(Integer, ForeignKey(CasePriority.id))
case_priority = relationship("CasePriority", backref="signal_instances")
fingerprint = Column(String)
filter_action = Column(String)
canary = Column(Boolean, default=False)
raw = Column(JSONB)
Expand Down Expand Up @@ -381,7 +380,6 @@ class SignalInstanceCreate(SignalInstanceBase):

class SignalInstanceRead(SignalInstanceBase):
id: uuid.UUID
fingerprint: Optional[str]
signal: SignalRead


Expand Down
173 changes: 105 additions & 68 deletions src/dispatch/static/dispatch/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ class SignalInstanceFactory(BaseFactory):
id = LazyFunction(uuid.uuid4)
project = SubFactory(ProjectFactory)
case = SubFactory(CaseFactory)
fingerprint = fake.md5()
signal = SubFactory(SignalFactory)
raw = {
"action": [{"type": "AWS_API_CALL", "value": {"Api": "assumerole", "ServiceName": "sts"}}],
Expand Down

0 comments on commit ecf3f91

Please sign in to comment.