-
Notifications
You must be signed in to change notification settings - Fork 28
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
Report Yarn v3/v4 patches as pedigree rather than components #784
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a WIP, I approached this as a first round of reviews, so not very thorough. That said, it is pretty straight forward and makes sense, so you should flip the Draft switch :) .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this LGTM. I think we can mark it as ready to review, I just need to take a better look at tests before giving the final ack.
011244f
to
d277261
Compare
d277261
to
37b9ef7
Compare
Signed-off-by: Taylor Madore <[email protected]>
In yarn v4, optional, builtin patches are now denoted with the prefix `optional!`. Handle this in addition to the yarn v3 prefix for the same Signed-off-by: Taylor Madore <[email protected]>
Adds an optional Pedigree for the Component model according to: https://cyclonedx.org/docs/1.6/json/#components_items_pedigree_patches For the PatchDiff model, provide a URL but not a text diff in the SBOM since it is not required by the schema. Signed-off-by: Taylor Madore <[email protected]>
Instead of reporting yarn patches as independent Components in the SBOM, report them instead as Pedigree for the parent, non-patch Component. This uses the Pedigree model of SBOM Components, which was implemented in accordance with: https://cyclonedx.org/docs/1.6/json/#components_items_pedigree_patches Yarn has the concept of "builtin" patches that are applied by yarn itself to make certain features of yarn work. These are reported out of the Yarn source repository for currently known patches from the compat plugin. Signed-off-by: Taylor Madore <[email protected]>
37b9ef7
to
f9f4502
Compare
Yarn has a
patch
protocol for the package patching feature. Patches should not be reported as independent Components in the SBOM, but should instead be reported as pedigree for the patched "regular" package Component.Maintainers will complete the following section
Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:
/ok-to-test
(as is the standard for Pipelines as Code)