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

Order components and dependencies by purl and ref to have reproducible output #457

Merged

Conversation

emirmx
Copy link
Contributor

@emirmx emirmx commented Jun 19, 2024

As the components and dependencies are stored in HashSet and HashMap, when converted to lists, the order is not well defined and seems to change from time to time, especially when run on different computers.

In this PR, components and dependencies are sorted before the BOM is written to have the same order, given same dependencies.

This should fix part of this issue: #292

@skhokhlov
Copy link
Contributor

skhokhlov commented Jun 19, 2024

You can just use TreeSet instead of HashSet https://docs.oracle.com/javase/8/docs/api/java/util/TreeSet.html

@emirmx emirmx force-pushed the order-components-dependencies-in-the-output branch from fbdb878 to f15d4d5 Compare June 20, 2024 07:57
@emirmx
Copy link
Contributor Author

emirmx commented Jun 20, 2024

You can just use TreeSet instead of HashSet https://docs.oracle.com/javase/8/docs/api/java/util/TreeSet.html

Thanks, way better. Changed.

@emirmx
Copy link
Contributor Author

emirmx commented Jul 3, 2024

Hi. Is there a time-frame for PR's to be reviewed/merged? Also, for the releases?

@jkowalleck jkowalleck requested a review from a team July 19, 2024 13:48
Copy link
Contributor

@skhokhlov skhokhlov left a comment

Choose a reason for hiding this comment

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

@emirmx
Copy link
Contributor Author

emirmx commented Jul 31, 2024

I think this https://github.com/CycloneDX/cyclonedx-gradle-plugin/blob/master/src/main/java/org/cyclonedx/gradle/CycloneDxTask.java#L398 can be removed now

Sorry, could not tie your comment to the changes in the PR. Can you elaborate?

…e output.

Signed-off-by: Emir Uner <emir.uner@mendix.com>
Signed-off-by: Emir Uner <emir.uner@mendix.com>
Signed-off-by: Emir Uner <emir.uner@mendix.com>
@emirmx emirmx force-pushed the order-components-dependencies-in-the-output branch from 46dabde to 45fa062 Compare August 1, 2024 08:46
@emirmx
Copy link
Contributor Author

emirmx commented Aug 1, 2024

I think this https://github.com/CycloneDX/cyclonedx-gradle-plugin/blob/master/src/main/java/org/cyclonedx/gradle/CycloneDxTask.java#L398 can be removed now

Though I still do not see the connection, I simplified the code in createBom a bit more within two additional commits.

Copy link
Contributor

@skhokhlov skhokhlov left a comment

Choose a reason for hiding this comment

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

@skhokhlov skhokhlov merged commit 895107e into CycloneDX:master Aug 1, 2024
7 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants