Skip to content

Commit c781c41

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 80edbd5 commit c781c41

13 files changed

+530
-0
lines changed

tests/_data/models.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,35 @@ def get_bom_with_definitions_and_detailed_standards() -> Bom:
14001400
)
14011401
]))
14021402

1403+
def get_bom_regression_issue540() -> Bom:
1404+
bom = _make_bom()
1405+
bom.metadata.component = root_component = Component(
1406+
name='myApp',
1407+
type=ComponentType.APPLICATION,
1408+
bom_ref="myApp"
1409+
)
1410+
component1 = Component(
1411+
type=ComponentType.LIBRARY,
1412+
name='some-component',
1413+
bom_ref="some-component"
1414+
)
1415+
bom.components.add(component1)
1416+
bom.register_dependency(root_component, [component1])
1417+
component2 = Component(
1418+
type=ComponentType.LIBRARY,
1419+
name='some-library',
1420+
bom_ref="some-library1"
1421+
)
1422+
bom.components.add(component2)
1423+
bom.register_dependency(component1, [component2])
1424+
component3 = Component(
1425+
type=ComponentType.LIBRARY,
1426+
name='some-library',
1427+
bom_ref="some-library2"
1428+
)
1429+
bom.components.add(component3)
1430+
bom.register_dependency(component1, [component3])
1431+
return bom
14031432

14041433
# ---
14051434

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.0" version="1">
3+
<components>
4+
<component type="library">
5+
<name>some-component</name>
6+
<version/>
7+
<modified>false</modified>
8+
</component>
9+
<component type="library">
10+
<name>some-library</name>
11+
<version/>
12+
<modified>false</modified>
13+
</component>
14+
<component type="library">
15+
<name>some-library</name>
16+
<version/>
17+
<modified>false</modified>
18+
</component>
19+
</components>
20+
</bom>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.1" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1">
3+
<components>
4+
<component type="library" bom-ref="some-component">
5+
<name>some-component</name>
6+
<version/>
7+
</component>
8+
<component type="library" bom-ref="some-library1">
9+
<name>some-library</name>
10+
<version/>
11+
</component>
12+
<component type="library" bom-ref="some-library2">
13+
<name>some-library</name>
14+
<version/>
15+
</component>
16+
</components>
17+
</bom>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"components": [
3+
{
4+
"bom-ref": "some-component",
5+
"name": "some-component",
6+
"type": "library",
7+
"version": ""
8+
},
9+
{
10+
"bom-ref": "some-library1",
11+
"name": "some-library",
12+
"type": "library",
13+
"version": ""
14+
},
15+
{
16+
"bom-ref": "some-library2",
17+
"name": "some-library",
18+
"type": "library",
19+
"version": ""
20+
}
21+
],
22+
"dependencies": [
23+
{
24+
"dependsOn": [
25+
"some-component"
26+
],
27+
"ref": "myApp"
28+
},
29+
{
30+
"dependsOn": [
31+
"some-library1",
32+
"some-library2"
33+
],
34+
"ref": "some-component"
35+
},
36+
{
37+
"ref": "some-library1"
38+
},
39+
{
40+
"ref": "some-library2"
41+
}
42+
],
43+
"metadata": {
44+
"component": {
45+
"bom-ref": "myApp",
46+
"name": "myApp",
47+
"type": "application",
48+
"version": ""
49+
},
50+
"timestamp": "2023-01-07T13:44:32.312678+00:00"
51+
},
52+
"serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
53+
"version": 1,
54+
"$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json",
55+
"bomFormat": "CycloneDX",
56+
"specVersion": "1.2"
57+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.2" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1">
3+
<metadata>
4+
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
5+
<component type="application" bom-ref="myApp">
6+
<name>myApp</name>
7+
<version/>
8+
</component>
9+
</metadata>
10+
<components>
11+
<component type="library" bom-ref="some-component">
12+
<name>some-component</name>
13+
<version/>
14+
</component>
15+
<component type="library" bom-ref="some-library1">
16+
<name>some-library</name>
17+
<version/>
18+
</component>
19+
<component type="library" bom-ref="some-library2">
20+
<name>some-library</name>
21+
<version/>
22+
</component>
23+
</components>
24+
<dependencies>
25+
<dependency ref="myApp">
26+
<dependency ref="some-component"/>
27+
</dependency>
28+
<dependency ref="some-component">
29+
<dependency ref="some-library1"/>
30+
<dependency ref="some-library2"/>
31+
</dependency>
32+
<dependency ref="some-library1"/>
33+
<dependency ref="some-library2"/>
34+
</dependencies>
35+
</bom>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"components": [
3+
{
4+
"bom-ref": "some-component",
5+
"name": "some-component",
6+
"type": "library",
7+
"version": ""
8+
},
9+
{
10+
"bom-ref": "some-library1",
11+
"name": "some-library",
12+
"type": "library",
13+
"version": ""
14+
},
15+
{
16+
"bom-ref": "some-library2",
17+
"name": "some-library",
18+
"type": "library",
19+
"version": ""
20+
}
21+
],
22+
"dependencies": [
23+
{
24+
"dependsOn": [
25+
"some-component"
26+
],
27+
"ref": "myApp"
28+
},
29+
{
30+
"dependsOn": [
31+
"some-library1",
32+
"some-library2"
33+
],
34+
"ref": "some-component"
35+
},
36+
{
37+
"ref": "some-library1"
38+
},
39+
{
40+
"ref": "some-library2"
41+
}
42+
],
43+
"metadata": {
44+
"component": {
45+
"bom-ref": "myApp",
46+
"name": "myApp",
47+
"type": "application",
48+
"version": ""
49+
},
50+
"timestamp": "2023-01-07T13:44:32.312678+00:00"
51+
},
52+
"serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
53+
"version": 1,
54+
"$schema": "http://cyclonedx.org/schema/bom-1.3a.schema.json",
55+
"bomFormat": "CycloneDX",
56+
"specVersion": "1.3"
57+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.3" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1">
3+
<metadata>
4+
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
5+
<component type="application" bom-ref="myApp">
6+
<name>myApp</name>
7+
<version/>
8+
</component>
9+
</metadata>
10+
<components>
11+
<component type="library" bom-ref="some-component">
12+
<name>some-component</name>
13+
<version/>
14+
</component>
15+
<component type="library" bom-ref="some-library1">
16+
<name>some-library</name>
17+
<version/>
18+
</component>
19+
<component type="library" bom-ref="some-library2">
20+
<name>some-library</name>
21+
<version/>
22+
</component>
23+
</components>
24+
<dependencies>
25+
<dependency ref="myApp">
26+
<dependency ref="some-component"/>
27+
</dependency>
28+
<dependency ref="some-component">
29+
<dependency ref="some-library1"/>
30+
<dependency ref="some-library2"/>
31+
</dependency>
32+
<dependency ref="some-library1"/>
33+
<dependency ref="some-library2"/>
34+
</dependencies>
35+
</bom>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"components": [
3+
{
4+
"bom-ref": "some-component",
5+
"name": "some-component",
6+
"type": "library"
7+
},
8+
{
9+
"bom-ref": "some-library1",
10+
"name": "some-library",
11+
"type": "library"
12+
},
13+
{
14+
"bom-ref": "some-library2",
15+
"name": "some-library",
16+
"type": "library"
17+
}
18+
],
19+
"dependencies": [
20+
{
21+
"dependsOn": [
22+
"some-component"
23+
],
24+
"ref": "myApp"
25+
},
26+
{
27+
"dependsOn": [
28+
"some-library1",
29+
"some-library2"
30+
],
31+
"ref": "some-component"
32+
},
33+
{
34+
"ref": "some-library1"
35+
},
36+
{
37+
"ref": "some-library2"
38+
}
39+
],
40+
"metadata": {
41+
"component": {
42+
"bom-ref": "myApp",
43+
"name": "myApp",
44+
"type": "application"
45+
},
46+
"timestamp": "2023-01-07T13:44:32.312678+00:00"
47+
},
48+
"serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
49+
"version": 1,
50+
"$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json",
51+
"bomFormat": "CycloneDX",
52+
"specVersion": "1.4"
53+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.4" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1">
3+
<metadata>
4+
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
5+
<component type="application" bom-ref="myApp">
6+
<name>myApp</name>
7+
</component>
8+
</metadata>
9+
<components>
10+
<component type="library" bom-ref="some-component">
11+
<name>some-component</name>
12+
</component>
13+
<component type="library" bom-ref="some-library1">
14+
<name>some-library</name>
15+
</component>
16+
<component type="library" bom-ref="some-library2">
17+
<name>some-library</name>
18+
</component>
19+
</components>
20+
<dependencies>
21+
<dependency ref="myApp">
22+
<dependency ref="some-component"/>
23+
</dependency>
24+
<dependency ref="some-component">
25+
<dependency ref="some-library1"/>
26+
<dependency ref="some-library2"/>
27+
</dependency>
28+
<dependency ref="some-library1"/>
29+
<dependency ref="some-library2"/>
30+
</dependencies>
31+
</bom>

0 commit comments

Comments
 (0)