Skip to content

Commit 0dbd545

Browse files
committed
Add config to run pipeline once
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 05b26dd commit 0dbd545

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.2.22 on 2026-01-08 13:41
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("vulnerabilities", "0109_alter_advisoryseverity_scoring_elements_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="pipelineschedule",
15+
name="is_run_once",
16+
field=models.BooleanField(
17+
db_index=True,
18+
default=False,
19+
help_text="When set to True, this Pipeline will run only once.",
20+
),
21+
),
22+
]

vulnerabilities/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,13 @@ class PipelineSchedule(models.Model):
22732273
),
22742274
)
22752275

2276+
is_run_once = models.BooleanField(
2277+
null=False,
2278+
db_index=True,
2279+
default=False,
2280+
help_text=("When set to True, this Pipeline will run only once."),
2281+
)
2282+
22762283
live_logging = models.BooleanField(
22772284
null=False,
22782285
db_index=True,

vulnerabilities/pipelines/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ class VulnerableCodeBaseImporterPipeline(VulnerableCodePipeline):
169169
importer_name = None
170170
advisory_confidence = MAX_CONFIDENCE
171171

172+
# When set to true pipeline is run only once.
173+
# To rerun onetime pipeline reset is_active field to True via migration.
174+
run_once = False
175+
172176
@classmethod
173177
def steps(cls):
174178
return (
@@ -262,6 +266,10 @@ class VulnerableCodeBaseImporterPipelineV2(VulnerableCodePipeline):
262266
repo_url = None
263267
ignorable_versions = []
264268

269+
# When set to true pipeline is run only once.
270+
# To rerun onetime pipeline reset is_active field to True via migration.
271+
run_once = False
272+
265273
@classmethod
266274
def steps(cls):
267275
return (

0 commit comments

Comments
 (0)