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

[feature] Unionize parsing for cdx SBOM and VEX data #1247

Merged
merged 9 commits into from
Oct 5, 2023

Conversation

stevemenezes
Copy link
Contributor

@stevemenezes stevemenezes commented Sep 11, 2023

Description of the PR

Followup to #1181

  • Unionize parser for SBOM and VEX BOM
  • Yet to add tests

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
@jeffmendoza
Copy link
Collaborator

In general, it might make sense to move the parsing up to the Parse() function, and bubble up all errors there, then save the calculated ingestPredicates as a part of the struct, then GetPredicates() can just return them.

It'll be nice to see the example json input and expected ingestPredicates outputs in the tests.

Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
@stevemenezes stevemenezes marked this pull request as ready for review September 28, 2023 17:22
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go Outdated Show resolved Hide resolved
@jeffmendoza
Copy link
Collaborator

For the "unknown time" where we want to put "zero time", use time.Unix(0, 0) and not time.Time{}, the latter is considered empty by graphql and doesn't work in any schema where the time value is a required field.

Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @stevemenezes

Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
@jeffmendoza
Copy link
Collaborator

LGTM!

@pxp928
Copy link
Collaborator

pxp928 commented Oct 5, 2023

@stevemenezes just need to fix the CI errors and should be ready to merge

Signed-off-by: stevemenezes <steve.menezes@yahooinc.com>
@stevemenezes stevemenezes force-pushed the smenezes/cdx-vex-followup branch from 8387861 to 5a365ad Compare October 5, 2023 20:54
@kodiakhq kodiakhq bot merged commit a9dc7af into guacsec:main Oct 5, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants