Skip to content

Commit

Permalink
Spawn sample tag tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
nazywam committed Jan 12, 2024
1 parent 77e3229 commit a25b5a2
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion karton/config_extractor/config_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ def report_config(
return

dhash = config_dhash(legacy_config)
family = config["family"]
task = Task(
{
"type": "config",
"kind": "static",
"family": config["family"],
"family": family,
"quality": task.headers.get("quality", "high"),
},
payload={
Expand All @@ -163,6 +164,24 @@ def report_config(
},
)
self.send_task(task)
if parent:
self.send_sample_tag_task(sample, [family])
self.send_sample_tag_task(parent, [f"ripped: {family}"])
else:
self.send_sample_tag_task(sample, [f"ripped: {family}", family])

def send_sample_tag_task(self, sample: Resource, tags: List[str]) -> None:
task = Task(
{
"type": "sample",
"stage": "analyzed",
},
payload={
"sample": sample,
"tags": tags,
}
)
self.send_task(task)

# analyze a standard, non-dump sample
def analyze_sample(self, task: Task, sample: ResourceBase) -> None:
Expand Down

0 comments on commit a25b5a2

Please sign in to comment.