Skip to content

Commit 82cc5bb

Browse files
authored
Merge branch 'aboutcode-org:main' into gentoo-migration
2 parents b5c6b46 + 485f3e2 commit 82cc5bb

File tree

21 files changed

+1006
-12
lines changed

21 files changed

+1006
-12
lines changed

aboutcode/federated/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ def large_size_configs(cls):
10281028
"mlflow": 16,
10291029
"pub": 16,
10301030
"rpm": 16,
1031-
# Small Ecosystem all use the defaul
1031+
# Small Ecosystem all use the default
10321032
"default": 1,
10331033
}
10341034
return [
@@ -1069,7 +1069,7 @@ def medium_size_configs(cls):
10691069
"mlflow": 8,
10701070
"pub": 8,
10711071
"rpm": 8,
1072-
# Small Ecosystem all use the defaul
1072+
# Small Ecosystem all use the default
10731073
"default": 1,
10741074
}
10751075
return [
@@ -1110,7 +1110,7 @@ def small_size_configs(cls):
11101110
"mlflow": 4,
11111111
"pub": 4,
11121112
"rpm": 4,
1113-
# Small Ecosystem all use the defaul
1113+
# Small Ecosystem all use the default
11141114
"default": 1,
11151115
}
11161116
return [
@@ -1181,7 +1181,7 @@ def cluster_preset():
11811181
DataCluster(
11821182
data_kind="security_advisories",
11831183
description="VulnerableCode security advisories for each package version.",
1184-
datafile_path_template="{/namespace}/{name}/{version}/advisories.json",
1184+
datafile_path_template="{/namespace}/{name}/{version}/advisories.yml",
11851185
purl_type_configs=[PurlTypeConfig.default_config()],
11861186
data_schema_url="",
11871187
documentation_url="",

aboutcode/federated/tests/test_data/all-presets/foo/aboutcode-federated-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ data_clusters:
933933
data_license: CC-BY-4.0
934934
data_maintainers: []
935935
- data_kind: security_advisories
936-
datafile_path_template: '{/namespace}/{name}/{version}/advisories.json'
936+
datafile_path_template: '{/namespace}/{name}/{version}/advisories.yml'
937937
purl_type_configs:
938938
- purl_type: default
939939
number_of_repos: 1

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"https://nvd.nist.gov/products/cpe",
4141
"https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml",
4242
"http://ftp.suse.com/pub/projects/security/yaml/",
43+
r"https://nixos\.wiki/", # NixOS wiki blocks CI bots with 403
4344
]
4445

4546
# Add any Sphinx extension module names here, as strings. They can be

vulnerabilities/improvers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
enhance_with_metasploit as enhance_with_metasploit_v2,
3232
)
3333
from vulnerabilities.pipelines.v2_improvers import flag_ghost_packages as flag_ghost_packages_v2
34+
from vulnerabilities.pipelines.v2_improvers import relate_severities
3435
from vulnerabilities.pipelines.v2_improvers import unfurl_version_range as unfurl_version_range_v2
3536
from vulnerabilities.utils import create_registry
3637

@@ -72,5 +73,6 @@
7273
unfurl_version_range_v2.UnfurlVersionRangePipeline,
7374
compute_advisory_todo.ComputeToDo,
7475
collect_ssvc_trees.CollectSSVCPipeline,
76+
relate_severities.RelateSeveritiesPipeline,
7577
]
7678
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 5.2.11 on 2026-02-17 13:27
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("vulnerabilities", "0113_advisoryv2_precedence"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="advisoryv2",
15+
name="related_advisory_severities",
16+
field=models.ManyToManyField(
17+
help_text="Related advisories that are used to calculate the severity of this advisory.",
18+
related_name="related_to_advisory_severities",
19+
to="vulnerabilities.advisoryv2",
20+
),
21+
),
22+
]

vulnerabilities/models.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,13 +2344,14 @@ def save(self, *args, **kwargs):
23442344
@property
23452345
def pipeline_class(self):
23462346
"""Return the pipeline class."""
2347+
23472348
from vulnerabilities.importers import IMPORTERS_REGISTRY
23482349
from vulnerabilities.improvers import IMPROVERS_REGISTRY
2350+
from vulnerabilities.pipelines.exporters import EXPORTERS_REGISTRY
2351+
2352+
pipeline_registry = IMPORTERS_REGISTRY | IMPROVERS_REGISTRY | EXPORTERS_REGISTRY
23492353

2350-
if self.pipeline_id in IMPROVERS_REGISTRY:
2351-
return IMPROVERS_REGISTRY.get(self.pipeline_id)
2352-
if self.pipeline_id in IMPORTERS_REGISTRY:
2353-
return IMPORTERS_REGISTRY.get(self.pipeline_id)
2354+
return pipeline_registry[self.pipeline_id]
23542355

23552356
@property
23562357
def description(self):
@@ -2997,6 +2998,12 @@ class AdvisoryV2(models.Model):
29972998
help_text="Precedence indicates the priority of advisory from different datasources. It is determined based on the reliability of the datasource and how close it is to the source.",
29982999
)
29993000

3001+
related_advisory_severities = models.ManyToManyField(
3002+
"AdvisoryV2",
3003+
related_name="related_to_advisory_severities",
3004+
help_text="Related advisories that are used to calculate the severity of this advisory.",
3005+
)
3006+
30003007
@property
30013008
def risk_score(self):
30023009
"""

vulnerabilities/pipelines/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def log(self, message, level=logging.INFO):
141141
class VulnerableCodePipeline(PipelineDefinition, BasePipelineRun):
142142
pipeline_id = None # Unique Pipeline ID
143143

144+
# When set to true pipeline is run only once.
145+
# To rerun onetime pipeline reset is_active field to True via migration.
146+
run_once = False
147+
144148
def on_failure(self):
145149
"""
146150
Tasks to run in the event that pipeline execution fails.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) nexB Inc. and others. All rights reserved.
2+
# VulnerableCode is a trademark of nexB Inc.
3+
# SPDX-License-Identifier: Apache-2.0
4+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5+
# See https://github.com/aboutcode-org/vulnerablecode for support or download.
6+
# See https://aboutcode.org for more information about nexB OSS projects.
7+
#
8+
9+
from vulnerabilities.pipelines.exporters import federate_vulnerabilities
10+
from vulnerabilities.utils import create_registry
11+
12+
EXPORTERS_REGISTRY = create_registry(
13+
[
14+
federate_vulnerabilities.FederatePackageVulnerabilities,
15+
]
16+
)

0 commit comments

Comments
 (0)