This repository was archived by the owner on Sep 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 44from dispatch .case import service as case_service
55from dispatch .case import flows as case_flows
66from dispatch .signal import service as signal_service
7+ from dispatch .tag import service as tag_service
78from dispatch .signal .models import SignalInstanceCreate , RawSignal
89
910
@@ -27,6 +28,9 @@ def create_signal_instance(
2728 db_session = db_session , signal_instance_in = signal_instance_in
2829 )
2930
31+ # associate any known tags with the signal
32+ tag = tag_service .get_by_name (db_session = db_session , project_id = project .id , name = "foo" )
33+
3034 signal_instance .signal = signal
3135 db_session .commit ()
3236
Original file line number Diff line number Diff line change @@ -215,14 +215,21 @@ class SignalPagination(DispatchBase):
215215 total : int
216216
217217
218+ class AdditionalMetadata (DispatchBase ):
219+ name : Optional [str ]
220+ value : Optional [str ]
221+ type : Optional [str ]
222+ important : Optional [bool ]
223+
224+
218225class RawSignal (DispatchBase ):
219226 action : Optional [List [Dict ]] = []
220- additional_metadata : Optional [List [Dict ]] = Field ([])
227+ additional_metadata : Optional [List [AdditionalMetadata ]] = Field ([], alias = "additionalMetadata" )
221228 asset : Optional [List [Dict ]] = []
222229 identity : Optional [Dict ] = {}
223- origin_location : Optional [List [Dict ]] = Field ([])
230+ origin_location : Optional [List [Dict ]] = Field ([], alias = "originLocation" )
224231 variant : Optional [str ] = None
225- created_at : Optional [datetime ] = Field (None )
232+ created_at : Optional [datetime ] = Field (None , fields = "createdAt" )
226233 id : Optional [str ]
227234
228235
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ def consume_signals(db_session: SessionLocal, project: Project):
3535 for plugin in plugins :
3636 log .debug (f"Consuming signals. Signal Consumer: { plugin .plugin .slug } " )
3737 signal_instances = plugin .instance .consume ()
38-
3938 for signal_instance_data in signal_instances :
4039 try :
4140 signal_flows .create_signal_instance (
You can’t perform that action at this time.
0 commit comments