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: expose sbom generation functionality #114

Merged
merged 28 commits into from
Jan 26, 2022
Merged

feat: expose sbom generation functionality #114

merged 28 commits into from
Jan 26, 2022

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Jan 8, 2022

This WIP PR aims to expose the core functionality of cyclonedx-gomod, so it can be used by other applications.
"Core functionality" referring to the three SBOM generation commands app, bin and mod.

Addresses #99, #108.

Tasks

  • Define public API
  • Migrate app logic
  • Migrate bin logic
  • Migrate mod logic
  • Ensure that there's Godoc for everything public
  • Figure out how to deal with internal functionality that uses the global zerolog logger.
    For a clean experience, everything should use the loggers passed to the Generator implementation's constructors,
    but that will require quite a bit of refactoring.
    • Refactored internal functions that log to accept a logger parameter. Feels dirty, but does the job for now.
  • Add a disclaimer somewhere that cyclonedx-gomod will not be investing in staying compatible with older Go versions.
    For example, we may adapt Go 1.18 features shortly after its GA.
  • Ensure tests continue to work across multiple platforms
    I don't want to continue dragging reproducible flags through the code, but it's also quite challenging to emulate static environments (wrt Go version, GOOS, GOARCH etc.). Maybe stripping some fields of the BOM before comparing it to its snapshot is the way to go here...

@nscuro nscuro added the enhancement New feature or request label Jan 8, 2022
@nscuro nscuro added this to the v1.2.0 milestone Jan 8, 2022
@nscuro nscuro changed the title Expose SBOM generation functionality feat: expose sbom generation functionality Jan 9, 2022
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
keep the e2e tests for testing the generation logic for now. we may change this in the future, but for now it'd cause too much refactoring work.

Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
i know, i know... this test should be deterministic.

Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
still need a solution to strip dynamic data from generated boms before comparing them to snapshots though

Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro marked this pull request as ready for review January 26, 2022 13:08
@nscuro nscuro merged commit bc4414e into main Jan 26, 2022
@nscuro nscuro deleted the issue-99 branch January 26, 2022 14:22
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

1 participant