Skip to content

feat: add cdx:reproducible property to bom metadata#59

Draft
SachinAditya wants to merge 6 commits intoCycloneDX:mainfrom
SachinAditya:add-cdx-reproducible-property
Draft

feat: add cdx:reproducible property to bom metadata#59
SachinAditya wants to merge 6 commits intoCycloneDX:mainfrom
SachinAditya:add-cdx-reproducible-property

Conversation

@SachinAditya
Copy link

Issue #16 highlights that when an SBOM is generated in reproducible mode, this information is not explicitly visible in the resulting CycloneDX BOM. Although the tool already adjusts fields such as the serial number, timestamp, and sorting behavior to support reproducible output, there is currently no clear, machine-readable indicator in the BOM metadata to signal that reproducible mode was used.

This PR addresses that gap by adding a CycloneDX property named cdx:reproducible under metadata.properties. The property is set to "true" when the SBOM is generated with the outputReproducible option enabled, and "false" otherwise.

The property is added after the BOM is created, keeping the existing builder logic unchanged and preserving separation of concerns. This approach aligns with the CycloneDX property taxonomy and follows patterns used in other CycloneDX tooling.

With this change, consumers of the SBOM can easily determine whether the document was generated in reproducible mode, improving transparency and auditability without altering existing behavior.

Description

A clear and concise summary of the change and which issue (if any) it fixes. Should also include relevant motivation and context.

Resolves or fixes issue:

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

Issue CycloneDX#16 highlights that when an SBOM is generated in reproducible mode, this information is not explicitly visible in the resulting CycloneDX BOM. Although the tool already adjusts fields such as the serial number, timestamp, and sorting behavior to support reproducible output, there is currently no clear, machine-readable indicator in the BOM metadata to signal that reproducible mode was used.

This PR addresses that gap by adding a CycloneDX property named cdx:reproducible under metadata.properties. The property is set to "true" when the SBOM is generated with the outputReproducible option enabled, and "false" otherwise.

The property is added after the BOM is created, keeping the existing builder logic unchanged and preserving separation of concerns. This approach aligns with the CycloneDX property taxonomy and follows patterns used in other CycloneDX tooling.

With this change, consumers of the SBOM can easily determine whether the document was generated in reproducible mode, improving transparency and auditability without altering existing behavior.

Signed-off-by: Sachin Vishwakarma <[email protected]>
@SachinAditya SachinAditya requested a review from a team as a code owner February 2, 2026 17:29
@jkowalleck
Copy link
Member

some checkboxes were not ticked.

src/plugin.ts Outdated
options.gatherLicenseTexts,
logger)
// ensure metadata.properties exists
if (!bom.metadata.properties) {
Copy link
Member

Choose a reason for hiding this comment

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

when shall this condition be false?

src/plugin.ts Outdated

// add cdx:reproducible property
bom.metadata.properties.add(
new CDX.Models.Property(
Copy link
Member

Choose a reason for hiding this comment

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

please use const enums for well-known strings like these. similar to https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/src/properties.ts

@jkowalleck
Copy link
Member

tests are failing.

Signed-off-by: Sachin Vishwakarma <[email protected]>
Signed-off-by: Sachin Vishwakarma <[email protected]>
Signed-off-by: Sachin Vishwakarma <[email protected]>
Signed-off-by: Sachin Vishwakarma <[email protected]>
@jkowalleck
Copy link
Member

jkowalleck commented Feb 3, 2026

your changes in https://github.com/CycloneDX/cyclonedx-esbuild/pull/59/changes/45665f542c9bf17fe921228208660ca2efcca47blook look like your AI agents are completely broken? :-P

instead of fixing yourt broken tests, youbroke the test runner, and remove some docs, and changed a lot unexpectedly.

@jkowalleck jkowalleck marked this pull request as draft February 3, 2026 17:57
@jkowalleck
Copy link
Member

current PR is changing a lot of code unintentionally, therefore I'll put it as a draft .

Signed-off-by: Sachin Vishwakarma <[email protected]>
@SachinAditya
Copy link
Author

Thanks for pointing that out — you’re absolutely right.

I went too far trying to fix CI issues and unintentionally changed more than required for this PR. That was my mistake.

I’ll clean this up by:

  • reverting unrelated changes (workflows/docs)
  • keeping the PR strictly scoped to adding the cdx:reproducible metadata property
  • fixing only the minimal ESLint issues required

Sorry for the noise, and thanks for the patience.

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.

2 participants