Conversation
The purl was built inside the release loop but used after it, so every affected package got the last release's distro. Resolved releases also added their current repository version as a fix, and affected versions from all releases were merged into one range. Each release now gets its own package with only its own affected and fixed versions. Releases with fixed_version "0" are skipped since Debian uses that for releases that were never affected. Fixes aboutcode-org#2460 Signed-off-by: Sahil Lenka <sahillenka44@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2460
The Debian importer was building the purl inside the release loop and using it after the loop, so every affected package ended up with the last release's
distro. On top of that, resolved releases added their current repository version as a fix, and affected versions from every release went into one shared range.Now each release gets its own affected package with just its own versions:
resolved: fixed range fromfixed_version, no affected rangeopen/undetermined: affected range from the repository versionfixed_version: "0": skipped, since Debian uses that for releases that were never affectedOne side effect worth pointing out: releases that were
openwith no fix used to produce no package at all, because packages were only created per fixed version. They're now stored as affected.Checked against the live tracker data for
openssl/ CVE-2024-0727. Before, it gave 6 fixed versions all taggeddistro=trixie. Now it gives bookworm fixed in3.0.13-1~deb12u1, and forky, sid and trixie each fixed in3.1.5-1.I updated
test_affected_packages_generationbecause it expected every package to have a fixed range, which was only true because of this bug. Also added a test covering several releases, including a"0"one and an open one.I went with skipping
"0"releases as described in #2460. Happy to change that if you'd prefer to keep them some other way.