Emit single SEMVER range with multiple events per affected#49
Open
PushkarJ wants to merge 2 commits intokubernetes-sigs:mainfrom
Open
Emit single SEMVER range with multiple events per affected#49PushkarJ wants to merge 2 commits intokubernetes-sigs:mainfrom
PushkarJ wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PushkarJ The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1c2a8ec to
c01f703
Compare
c01f703 to
309965f
Compare
Ensure each affected entry emits one SEMVER range whose events form a non-overlapping introduced/fixed timeline. collector/k8s.go: - Rewrite getAffectedEvents to filter versions with Introduced set, sort intervals by closing version, and build the events slice in a single pass. - Adjust overlapping intervals that start at 0 to begin at the next minor when needed so ranges do not overlap. - Add versionEnd, nextMinorStart and minorOf helpers to centralize version arithmetic and comparisons. - Return a single SEMVER range per affected entry and omit ranges when no valid intervals exist. - Fix typo in olderCve comment (collcted -> collected). collector/k8s_test.go: - Add testdataDir helper so fixtures are found regardless of working directory. - Update Test_ParseVulneDB and Test_cveIDToModifiedMap to use testdataDir and compare unmarshalled JSON structures instead of raw strings. - Add tests for getAffectedEvents, overlapping "introduced 0" intervals, nextMinorStart, versionEnd and minorOf. collector/testdata/expected-vulndb.json: - Regenerate expected OSV output for updated ranges and new CVEs. vulns/CVE-2025-15566.json: - Fix second interval: introduced 0 -> 1.13.0 to avoid overlap with the first interval.
309965f to
7d46d78
Compare
PushkarJ
commented
Mar 3, 2026
Member
Author
|
/label tide/merge-method-squash |
Member
Author
|
/cc @mtardy |
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.
Ensure each affected entry emits one SEMVER range whose events form a non-overlapping introduced/fixed timeline.
collector/k8s.go:
Rewrite getAffectedEvents to filter versions with Introduced set, sort intervals by closing version, and build the events slice in a single pass.
Adjust overlapping intervals that start at 0 to begin at the next minor when needed so ranges do not overlap.
Add versionEnd, nextMinorStart and minorOf helpers to centralize version arithmetic and comparisons.
Return a single SEMVER range per affected entry and omit ranges when no valid intervals exist.
Fix typo in olderCve comment (collcted -> collected).
collector/k8s_test.go:
Add testdataDir helper so fixtures are found regardless of working directory.
Update Test_ParseVulneDB and Test_cveIDToModifiedMap to use testdataDir and compare unmarshalled JSON structures instead of raw strings.
Add tests for getAffectedEvents, overlapping "introduced 0" intervals, nextMinorStart, versionEnd and minorOf.
collector/testdata/expected-vulndb.json:
vulns/CVE-2025-15566.json:
overlap with the first interval.
Follow up to #46
/sig security