Skip to content

fix: Add missing comparator for VulnerabilityAnalysis #812

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

Merged
merged 2 commits into from
May 10, 2025

Conversation

haklir
Copy link
Contributor

@haklir haklir commented May 9, 2025

When trying to generate a CycloneDX BOM that has two vulnerabilities that only differ in their analysis, you get

TypeError: '<' not supported between instances of 'VulnerabilityAnalysis' and 'VulnerabilityAnalysis'

This PR adds the __lt__ method for the VulnerabilityAnalysis model to fix sorting and also includes a test case to verify the fix.

Riku Häkli added 2 commits May 9, 2025 12:28
Signed-off-by: Riku Häkli <hakli.riku@gmail.com>
Signed-off-by: Riku Häkli <hakli.riku@gmail.com>
@haklir haklir requested a review from a team as a code owner May 9, 2025 10:49
@jkowalleck jkowalleck added the bug Something isn't working label May 10, 2025
@jkowalleck jkowalleck merged commit 0df2982 into CycloneDX:main May 10, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants