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

New spdx+json parser! #133

Merged
merged 7 commits into from
Jul 6, 2022
Merged

Conversation

puerco
Copy link
Member

@puerco puerco commented Jul 6, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR implements a full json parser matching our SPDX 2.2.2 type. The spdx.OpenDoc now includes a simple logic to detect which kind of SBOM we are reading and call the appropriate parsing function.

Unit tests for the new parser are included as well as two sample JSON SBOMs to check the parser integrity.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Our json type is missing a few fields, I will implement those into the type (and parser) in a follow-up

/cc @jeremyrickard

Does this PR introduce a user-facing change?

SBOM can now parse `spdx+json` documents which means that they can be outlined and queried just as their tag-value counterparts.

puerco added 5 commits July 5, 2022 14:01
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
This commit implements the first iteration of an SPDX+JSON parser in bom.

Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 6, 2022
This commit adds two json sboms to use in test cases

Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
This commit adds two unit tests to check the SPDX+JSON parser

Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thanks
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, puerco

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 6, 2022
@k8s-ci-robot k8s-ci-robot merged commit cfe8435 into kubernetes-sigs:main Jul 6, 2022
@puerco puerco deleted the ingest-spdx branch July 6, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants