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] emit tools as metadata.tools.components #1233

Open
hakandilek opened this issue Nov 5, 2024 · 4 comments · May be fixed by #1235
Open

[FEAT] emit tools as metadata.tools.components #1233

hakandilek opened this issue Nov 5, 2024 · 4 comments · May be fixed by #1235
Assignees
Labels
breaking-change breacking change. causes a new major version. enhancement New feature or request schema 1.5
Milestone

Comments

@hakandilek
Copy link

hakandilek commented Nov 5, 2024

Describe the feature

Own tools (@cyclonedx/cyclonedx-npm and @cyclonedx/cyclonedx-library) are listed under medatada.tools which is deprecated. They should be listed under medatada.tools.components as suggested since CycloneDX v1.5.

To Reproduce

Any generated JSON document contains the same output. I've tried the following command on an npm project:

npx @cyclonedx/cyclonedx-npm --flatten-components --short-PURLs --spec-version 1.6 --output-format JSON --output-file - --omit dev --omit optional

Expected behavior

Entries under metadata.tools should be listed under medatada.tools.components according to the "component" data structure.

Screenshots or output-paste

{
  "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
  "bomFormat": "CycloneDX",
  "specVersion": "1.6",
  "version": 1,
  "serialNumber": "urn:uuid:5a388864-adb9-4e91-abf1-3331545c6fc0",
  "metadata": {
    "timestamp": "2024-11-05T12:10:06.815Z",
    "tools": [
      {
        "name": "npm",
        "version": "10.9.0"
      },
      {
        "vendor": "@cyclonedx",
        "name": "cyclonedx-npm",
        "version": "1.19.3",
       ...
      },
      {
        "vendor": "@cyclonedx",
        "name": "cyclonedx-library",
        "version": "6.11.0",
     ...

Environment

  • @cyclonedx/cyclonedx-npm version: 1.19.3
  • NPM version: 10.9.0
  • Node version: v23.1.0
  • OS: MacOS 14.7 (23H124)

Additional context

This is the part of the code where metadata.tools are being populated:

bom.metadata.tools.add(new Models.Tool({
name: 'npm',
version: npmVersion // use the self-proclaimed `version`
// omit `vendor` and `externalReferences`, because we cannot be sure about the used tool's actual origin
// omit `hashes`, because unfortunately there is no agreed process of generating them
}))
for (const tool of this.makeTools()) {
bom.metadata.tools.add(tool)
}

@hakandilek hakandilek added the bug Something isn't working label Nov 5, 2024
@jkowalleck
Copy link
Member

depends on CycloneDX/cyclonedx-javascript-library#1152

@hakandilek
Copy link
Author

depends on CycloneDX/cyclonedx-javascript-library#1152

I've missed that one. You're right. It's probably better to wait on this one and adopt here accordingly.

@jkowalleck jkowalleck added enhancement New feature or request and removed bug Something isn't working labels Nov 5, 2024
@jkowalleck jkowalleck changed the title [BUG] tools should be under metadata.tools.components [FEAT] tools should be under metadata.tools.components Nov 5, 2024
@jkowalleck jkowalleck changed the title [FEAT] tools should be under metadata.tools.components [FEAT] tools as metadata.tools.components Nov 5, 2024
@jkowalleck jkowalleck changed the title [FEAT] tools as metadata.tools.components [FEAT] emit tools as metadata.tools.components Nov 5, 2024
@jkowalleck
Copy link
Member

required feature preview available via https://github.com/CycloneDX/cyclonedx-javascript-library/releases/tag/v7.0.0-beta.1

@jkowalleck jkowalleck added the breaking-change breacking change. causes a new major version. label Nov 19, 2024
@jkowalleck
Copy link
Member

this is a breaking change.
not a blocker, just a remark.

@jkowalleck jkowalleck self-assigned this Nov 19, 2024
@jkowalleck jkowalleck added this to the 2.0.0 milestone Nov 19, 2024
@jkowalleck jkowalleck linked a pull request Nov 19, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change breacking change. causes a new major version. enhancement New feature or request schema 1.5
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants