-
-
Notifications
You must be signed in to change notification settings - Fork 86
Added support for conditional components and associated unit tests #929
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
base: 2.0-dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
| "name": "Transistor Choice", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "operator": "XOR", | ||||||||
| "supplier": { "name": "Should not be allowed on a choice wrapper" }, | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Transistor A" }, | ||||||||
| { "type": "device", "name": "Transistor B" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
| "name": "Transistor Choice", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "operator": "NAND", | ||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Transistor A" }, | ||||||||
| { "type": "device", "name": "Transistor B" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "operator": "XOR", | ||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Transistor A" }, | ||||||||
| { "type": "device", "name": "Transistor B" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
| "name": "Transistor Choice", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Transistor A" }, | ||||||||
| { "type": "device", "name": "Transistor B" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
| "name": "JP2 Debug Header", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "operator": "OPTIONAL", | ||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Debug Header A" }, | ||||||||
| { "type": "device", "name": "Debug Header B" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||
| { | ||||||||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||||||||
| "specFormat": "CycloneDX", | ||||||||
| "specVersion": "2.0", | ||||||||
| "version": 1, | ||||||||
| "metadata": { | ||||||||
| "component": { | ||||||||
| "type": "device", | ||||||||
| "name": "Acme Product" | ||||||||
| } | ||||||||
| }, | ||||||||
| "components": [ | ||||||||
| { | ||||||||
| "type": "component-choice", | ||||||||
| "name": "Transistor Choice", | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a description, so dont need to guess why this data is invalid.
Suggested change
|
||||||||
| "operator": "XOR", | ||||||||
| "components": [ | ||||||||
| { "type": "device", "name": "Lone Transistor" } | ||||||||
| ] | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "metadata": { | ||
| "component": { | ||
| "bom-ref": "rf-board", | ||
| "type": "device", | ||
| "name": "RF Front End Board" | ||
| } | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "component-choice", | ||
| "name": "Transceiver and Matching Balun", | ||
| "description": "The transceiver and its matching balun are installed together. Selecting one without the other yields a non-functional radio.", | ||
| "operator": "AND", | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "2.4GHz RF Transceiver", | ||
| "supplier": { "name": "Acme RF" } | ||
| }, | ||
| { | ||
| "type": "device", | ||
| "name": "Matching Balun for 2.4GHz Transceiver", | ||
| "supplier": { "name": "Acme RF" } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "metadata": { | ||
| "component": { | ||
| "bom-ref": "main-board", | ||
| "type": "device", | ||
| "name": "Main Board" | ||
| } | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "Power Management Sub-board", | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "Input Diode" | ||
| }, | ||
| { | ||
| "type": "component-choice", | ||
| "name": "U1 5V LDO Regulator", | ||
| "operator": "XOR", | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "LD1117S50TR", | ||
| "supplier": { "name": "STMicroelectronics" } | ||
| }, | ||
| { | ||
| "type": "device", | ||
| "name": "AMS1117-5.0", | ||
| "supplier": { "name": "Advanced Monolithic Systems" } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "metadata": { | ||
| "component": { | ||
| "bom-ref": "radio-module", | ||
| "type": "device", | ||
| "name": "Radio Module" | ||
| } | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "component-choice", | ||
| "name": "Radio Subsystem", | ||
| "description": "Choose exactly one radio subsystem. Each option is itself a tightly coupled group of transceiver and matching balun that must be installed together.", | ||
| "operator": "XOR", | ||
| "components": [ | ||
| { | ||
| "type": "component-choice", | ||
| "name": "2.4GHz Radio Group", | ||
| "operator": "AND", | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "2.4GHz Transceiver", | ||
| "supplier": { "name": "Acme RF" } | ||
| }, | ||
| { | ||
| "type": "device", | ||
| "name": "2.4GHz Balun", | ||
| "supplier": { "name": "Acme RF" } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "component-choice", | ||
| "name": "Sub-GHz Radio Group", | ||
| "operator": "AND", | ||
| "components": [ | ||
| { | ||
| "type": "device", | ||
| "name": "915MHz Transceiver", | ||
| "supplier": { "name": "Beta RF" } | ||
| }, | ||
| { | ||
| "type": "device", | ||
| "name": "915MHz Balun", | ||
| "supplier": { "name": "Beta RF" } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it really needed to have
namea required field?we could make it an optional one in a non-breaking change in the future.