-
-
Notifications
You must be signed in to change notification settings - Fork 74
feat: support for external components with version-ranges #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4aef005
draft: JSON - extraneous comp and version range
jkowalleck a6941df
docs
jkowalleck 7ede07a
xml
jkowalleck 84a9783
docs
jkowalleck 7a52828
docs
jkowalleck d3e0ed5
Update schema/bom-1.7.schema.json
jkowalleck 045a6de
wip
jkowalleck 0971f02
wip
jkowalleck b12bd49
wip
jkowalleck 2c00374
wip
jkowalleck db0b3b8
wip
jkowalleck d2e3053
wip
jkowalleck 401b245
wip
jkowalleck 65ec962
wip
jkowalleck 959a82c
wip
jkowalleck e7d714f
wip
jkowalleck 03f20f0
Merge branch '1.7-dev' into feat/extraneous-component
jkowalleck a4622ea
spec: isExtraneous only for runtime-components
jkowalleck c34176d
rename `isExtranous `-> `isExternal` + wording
jkowalleck 919e49f
docs for JSON schema requirements
jkowalleck 21f8f42
component's version and versionRange exclusively
jkowalleck 22c6e75
tests
jkowalleck 19e7c21
Merge branch '1.7-dev' into feat/extraneous-component
jkowalleck 7f73c1d
tests: revisit examples
jkowalleck ebe66bc
dev-docs
jkowalleck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
.../src/test/resources/1.7/informal-invalid-component-versionRange-non-external-explicit.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0"?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.7" | ||
| serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" | ||
| > | ||
| <!-- | ||
| this would be formal, if the support for XSD1.1's `assert` was properly implemented | ||
| in validators and tools digesting XML. | ||
| --> | ||
| <components> | ||
| <component type="library" isExternal="false"> | ||
| <name>InvalidVersions</name> | ||
| <versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange> | ||
| <description>versionRange may only exist on extraneous components, set `isExternal` explicit</description> | ||
| </component> | ||
| </components> | ||
| </bom> |
17 changes: 17 additions & 0 deletions
17
.../src/test/resources/1.7/informal-invalid-component-versionRange-non-external-implicit.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?xml version="1.0"?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.7" | ||
| serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" | ||
| > | ||
| <!-- | ||
| this would be formal, if the support for XSD1.1's `assert` was properly implemented | ||
| in validators and tools digesting XML. | ||
| --> | ||
| <components> | ||
| <component type="library"> | ||
| <!-- @isExternal defaults to `false` --> | ||
| <name>InvalidVersions</name> | ||
| <versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange> | ||
| <description>versionRange may only exist on extraneous components, set `isExternal` implicit by default value</description> | ||
| </component> | ||
| </components> | ||
| </bom> |
17 changes: 17 additions & 0 deletions
17
tools/src/test/resources/1.7/invalid-component-external-version-and-range.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", | ||
| "serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
| "version": 1, | ||
| "components": [ | ||
| { | ||
| "type": "library", | ||
| "name": "InvalidVersions", | ||
| "description": "may have `version` or `versionRange`, not both. This one does - it is invalid", | ||
| "version": "9.0.14", | ||
| "versionRange": "vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1", | ||
| "isExternal": true | ||
| } | ||
| ] | ||
| } |
13 changes: 13 additions & 0 deletions
13
tools/src/test/resources/1.7/invalid-component-external-version-and-range.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?xml version="1.0"?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.7" | ||
| serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" | ||
| > | ||
| <components> | ||
| <component type="library" isExternal="true"> | ||
| <name>InvalidVersions</name> | ||
| <version>9.0.14</version> | ||
| <versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange> | ||
| <description>may have `version` or `versionRange`, not both. This one does - it is invalid</description> | ||
| </component> | ||
| </components> | ||
| </bom> |
16 changes: 16 additions & 0 deletions
16
tools/src/test/resources/1.7/invalid-component-versionRange-non-external-explicit.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", | ||
| "serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
| "version": 1, | ||
| "components": [ | ||
| { | ||
| "type": "library", | ||
| "name": "InvalidVersions", | ||
| "description": "versionRange may only exist on extraneous components; set `.isExternal` explicit", | ||
| "isExternal": false, | ||
| "versionRange": "vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1" | ||
| } | ||
| ] | ||
| } |
15 changes: 15 additions & 0 deletions
15
tools/src/test/resources/1.7/invalid-component-versionRange-non-external-implicit.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", | ||
| "serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
| "version": 1, | ||
| "components": [ | ||
| { | ||
| "type": "library", | ||
| "name": "InvalidVersions", | ||
| "description": "versionRange may only exist on extraneous components; set `.isExternal` implicit by default value", | ||
| "versionRange": "vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1" | ||
| } | ||
| ] | ||
| } |
35 changes: 35 additions & 0 deletions
35
tools/src/test/resources/1.7/valid-component-external-with-version.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", | ||
| "serialNumber": "urn:uuid:7dc07ac8-7fb8-4782-bf89-4762394e189d", | ||
| "version": 1, | ||
| "metadata": { | ||
| "component": { | ||
| "bom-ref": "my-app", | ||
| "type": "application", | ||
| "name": "My Application" | ||
| } | ||
| }, | ||
| "components": [ | ||
| { | ||
| "bom-ref": "os", | ||
| "type": "operating-system", | ||
| "name": "Ubuntu", | ||
| "version": "24.04", | ||
| "description": "Ubuntu 24.04", | ||
| "isExternal": true | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "my-app", | ||
| "dependsOn": [ | ||
| "os" | ||
| ] | ||
| }, | ||
| { | ||
| "ref": "os" | ||
| } | ||
| ] | ||
| } |
30 changes: 30 additions & 0 deletions
30
tools/src/test/resources/1.7/valid-component-external-with-version.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # proto-file: schema/bom-1.7.proto | ||
| # proto-message: Bom | ||
|
|
||
| spec_version: "1.7" | ||
| version: 1 | ||
| serial_number: "urn:uuid:7dc07ac8-7fb8-4782-bf89-4762394e189d" | ||
| metadata { | ||
| component { | ||
| bom_ref: "my-app" | ||
| type: CLASSIFICATION_APPLICATION | ||
| name: "My Application" | ||
| } | ||
| } | ||
| components { | ||
| bom_ref: "os" | ||
| type: CLASSIFICATION_OPERATING_SYSTEM | ||
| name: "Ubuntu" | ||
| version: "24.04" | ||
| description: "Ubuntu 24.04" | ||
| isExternal: true | ||
| } | ||
| dependencies { | ||
| ref: "my-app" | ||
| dependencies { | ||
| ref: "os" | ||
| } | ||
| } | ||
| dependencies { | ||
| ref: "os" | ||
| } |
25 changes: 25 additions & 0 deletions
25
tools/src/test/resources/1.7/valid-component-external-with-version.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <?xml version="1.0"?> | ||
| <bom xmlns="http://cyclonedx.org/schema/bom/1.7" | ||
| serialNumber="urn:uuid:7dc07ac8-7fb8-4782-bf89-4762394e189d" version="1" | ||
| > | ||
| <metadata> | ||
| <component bom-ref="my-app" | ||
| type="application"> | ||
| <name>My Application</name> | ||
| </component> | ||
| </metadata> | ||
| <components> | ||
| <component bom-ref="os" | ||
| type="operating-system" isExternal="true"> | ||
| <name>Ubuntu</name> | ||
| <version>24H2</version> | ||
| <description>Windows 11 version 21H2</description> | ||
| </component> | ||
| </components> | ||
| <dependencies> | ||
| <dependency ref="my-app"> | ||
| <dependency ref="os"/> | ||
| </dependency> | ||
| <dependency ref="os"/> | ||
| </dependencies> | ||
| </bom> |
35 changes: 35 additions & 0 deletions
35
tools/src/test/resources/1.7/valid-component-external-with-versionRange.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", | ||
| "serialNumber": "urn:uuid:bdd25550-f1c1-4cb4-b406-0c8d05ad6382", | ||
| "version": 1, | ||
| "metadata": { | ||
| "component": { | ||
| "bom-ref": "my-app", | ||
| "type": "application", | ||
| "name": "My Application" | ||
| } | ||
| }, | ||
| "components": [ | ||
| { | ||
| "bom-ref": "libcurl", | ||
| "type": "library", | ||
| "name": "libcurl", | ||
| "versionRange": "vers:generic/>=8.7.1|<9.0.0", | ||
| "description": "libcurl ^8.7.1", | ||
| "isExternal": true | ||
| } | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "ref": "my-app", | ||
| "dependsOn": [ | ||
| "libcurl" | ||
| ] | ||
| }, | ||
| { | ||
| "ref": "libcurl" | ||
| } | ||
| ] | ||
| } |
30 changes: 30 additions & 0 deletions
30
tools/src/test/resources/1.7/valid-component-external-with-versionRange.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # proto-file: schema/bom-1.7.proto | ||
| # proto-message: Bom | ||
|
|
||
| spec_version: "1.7" | ||
| version: 1 | ||
| serial_number: "urn:uuid:bdd25550-f1c1-4cb4-b406-0c8d05ad6382" | ||
| metadata { | ||
| component { | ||
| bom_ref: "my-app" | ||
| type: CLASSIFICATION_APPLICATION | ||
| name: "My Application" | ||
| } | ||
| } | ||
| components { | ||
| bom_ref: "libcurl" | ||
| type: CLASSIFICATION_LIBRARY | ||
| name: "libcurl" | ||
| versionRange: "vers:generic/>=8.7.1|<9.0.0" | ||
| description: "libcurl ^8.7.1" | ||
| isExternal: true | ||
| } | ||
| dependencies { | ||
| ref: "my-app" | ||
| dependencies { | ||
| ref: "libcurl" | ||
| } | ||
| } | ||
| dependencies { | ||
| ref: "libcurl" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.