Skip to content
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

feat: support Bom.compositions #607

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

madpah
Copy link
Collaborator

@madpah madpah commented Apr 29, 2024

Adds support for bom.compositions as part of fulfilling #581.

@madpah madpah added the enhancement New feature or request label Apr 29, 2024
@madpah madpah self-assigned this Apr 29, 2024
Signed-off-by: Paul Horton <paul.horton@owasp.org>
Signed-off-by: Paul Horton <paul.horton@owasp.org>
@madpah madpah marked this pull request as ready for review April 29, 2024 10:14
@madpah madpah requested a review from a team as a code owner April 29, 2024 10:14
Copy link

codacy-production bot commented Apr 29, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.14% 87.16% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6d1bc5b) 4472 4153 92.87%
Head commit (eda7e7b) 4580 (+108) 4247 (+94) 92.73% (-0.14%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#607) 109 95 87.16%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

cyclonedx/model/bom.py Show resolved Hide resolved
cyclonedx/model/composition.py Show resolved Hide resolved


@serializable.serializable_class
class CompositionReference:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


what is the purpose of this class?
why not use simple BomRef instances instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think there was a structural reason - let me check @jkowalleck

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - it was added for structural reasons - happy to leave as is @jkowalleck ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not understand. what were these structural reasons?
I mean everybody ysing the library would ask the same question I did.

from the schema it looks like all these compositions.assembies and compositions.dependencies are simple sets of BomRef.
see https://github.com/CycloneDX/specification/blob/8e131b1688ccfe41e1bfdd4b3280f33dcc06d04c/schema/bom-1.6.schema.json#L2235-L2252

cyclonedx/model/composition.py Outdated Show resolved Hide resolved
Signed-off-by: Paul Horton <paul.horton@owasp.org>
Signed-off-by: Paul Horton <paul.horton@owasp.org>
Signed-off-by: Paul Horton <paul.horton@owasp.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants