feat: show fixed version for vulnerabilities#967
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughAdds UI rendering of a vulnerability's fixed version next to each vulnerability line in the Package component, with a localized tooltip and link to the package route for that version. Backend logic parses OSV affected ranges, evaluates semver intervals to compute an optional fixedIn value per vulnerability, and includes it in VulnerabilitySummary. New OSV-related types (range, event, affected) and VulnerabilitySummary.fixedIn were exported. Locale keys for the tooltip were added and unit tests cover fixedIn extraction, including prerelease and multiple-interval cases. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shared/types/dependency-analysis.ts (1)
39-83:⚠️ Potential issue | 🟠 MajorType definitions do not enforce OSV schema constraints; strict type-safety required.
The
OsvRangeEventinterface allows zero or multiple fields simultaneously, but the official OSV schema mandates exactly one of:introduced,fixed,last_affected, orlimit. Additionally,OsvRangeis missing the requiredrepofield (mandatory whentypeis'GIT'), and theeventsarray constraint—at least oneintroducedevent must be present—is not enforced. Use a discriminated union or more precise typing to reflect these constraints and ensure strict type-safety at the API boundary per coding guidelines.
danielroe
left a comment
There was a problem hiding this comment.
in general I think we should avoid creating ai translations as we currently don't have a way of asking for them to be reviewed by native speakers
So I should let translations empty? Or is there a "team" to help? My last request got lost because there was too much information in Discord i18n. |
|
yes, just leave the translations empty 🙏 |
2faf996 to
0571e1d
Compare
|
@danielroe now it picks the current next fixed version of a vulnerability. Additional I added some tests. |
|
Native speaker here, for this one we could keep the German translation as is, it's correct 👍 |
| const introduced = range.events.find(e => e.introduced)?.introduced | ||
| const fixed = range.events.find(e => e.fixed)?.fixed |
There was a problem hiding this comment.
could there be multiple of the same kind of event for a given package?
There was a problem hiding this comment.
Normally not from what I've read
There was a problem hiding this comment.
😁
I gotchu:
https://npmx-j14rd1m0y-poetry.vercel.app/package/next/v/15.5.8
Check out GHSA-5f7q-jpqc-wp7h
|
^ this still seems to not quite behave as one would expect. I think the minimal repro is something like:
In this case if you're looking at e.g. vulnerable |
|
in practice it was the same - it returned the 'first' fix which would have been 3.4.8 in your example (and in the sample OSV data I looked at). but I've pushed a fix to make that explicit |

Fixes: #954
Get OSV-fixed version(s) for vulnerabilities if available and shoe it inside vulnerabilities banner.