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

Add nested workspace traversal #36

Draft
wants to merge 2 commits into
base: 1.0-dev
Choose a base branch
from

Conversation

MLSTRM
Copy link

@MLSTRM MLSTRM commented Mar 18, 2024

fixes #35

@MLSTRM MLSTRM requested a review from a team as a code owner March 18, 2024 10:36
@jkowalleck
Copy link
Member

@MLSTRM before I review your work, I need to ask:
Please sign off your commits, to show that you agree to publish your changes under the current terms and licenses of the project , and to indicate agreement with Developer Certificate of Origin (DCO).
See how this can be achieved after pushing already: https://github.com/CycloneDX/cyclonedx-node-yarn/pull/36/checks?check_run_id=22778101015

@MLSTRM MLSTRM force-pushed the feature/nested-workspace-traversal branch from 357e083 to c645fa2 Compare March 18, 2024 11:00
…ecursive flag

Signed-off-by: MLSTRM <chris_nitro@hotmail.co.uk>
Signed-off-by: MLSTRM <chris_nitro@hotmail.co.uk>
@MLSTRM MLSTRM force-pushed the feature/nested-workspace-traversal branch from c645fa2 to ec2ffcf Compare March 18, 2024 11:02
@MLSTRM
Copy link
Author

MLSTRM commented Mar 18, 2024

@jkowalleck apologies, that should be resolved now.

Copy link
Member

Choose a reason for hiding this comment

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

why is this file needed?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, it's not - I forgot to setup a proper gitignore in this new testbed

@@ -56,7 +57,8 @@ suite('integration', () => {
'--reproducible',
// no intention to test all the spec-versions nor all the output-formats - this would be not our scope.
'--spec-version', latestCdxSpecVersion,
'--output-format', 'JSON'
'--output-format', 'JSON',
'--recursive'
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather have an own suite for make SBOM recursive, that only runs on "nested-workspaces", instead of modifying the existing suite make SBOM

pleas create a new suite called make SBOM recursive that runs with the new CLI switch and targets the test bed "nested-workspaces" only

@@ -70,6 +70,7 @@ $ yarn CycloneDX make-sbom
(choices: "application", "framework", "library", "container", "platform", "device-driver", default: "application")
--reproducible Whether to go the extra mile and make the output reproducible.
This might result in loss of time- and random-based values.
--recursive Scan all nested workspaces within the current project, rather than just the one in the current working directory.
Copy link
Member

Choose a reason for hiding this comment

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

Scan all nested workspaces within the current project, rather than just the one in the current working directory.

my questions:

  • Could you explain how this is a use case?
  • If the current workspace had no dependency to any other workspace, why would you want the other workspaces be part of the BOM?
  • If the current workspace had a dependency on any other workspace, is this not already in the SBOM?

Copy link
Author

Choose a reason for hiding this comment

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

My use case comes from a multi-application project, specifically multiple serverless aws lambda functions, which work together to perform a single task.
As they cannot be deployed separately, it is more useful/accurate to me to have a single SBOM for the overall project, rather than one per function.
Currently the dependencies declared within each sub-workspace are not included at the top level, and without generating multiple separate SBOMs and somehow merging them, I cannot currently represent the full usage state of my application.

Copy link
Member

Choose a reason for hiding this comment

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

Understood. I do not see this as being a feature of the MVP.
So this will probably be not merged for some time.

Workspaces are a way of organizing work, not some architectural or design decision.
Therefore, they actually have no representation in an SBOM.

If you had a product containing of several components, each being an independent application, then you should be using either BOM-Links connecting your product's components/services with eachother, or use a merge-tool to combine individual SBOMs into one.

Copy link
Member

Choose a reason for hiding this comment

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

why are the licenses gone?
✖️ you might have broken something.

see test results: https://github.com/CycloneDX/cyclonedx-node-yarn/actions/runs/8325442279/job/22780468675?pr=36#step:8:38

Copy link
Author

Choose a reason for hiding this comment

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

I get the same resulting update when running the command CYARN_TEST_UPDATE_SNAPSHOTS=1 yarn test on 1.0-dev as of commit a70f74e
Not sure if there's something wrong in my local setup around this so I'll dig deeper

@jkowalleck jkowalleck marked this pull request as draft March 18, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Support for projects with multiple/nested workspaces
2 participants