-
Notifications
You must be signed in to change notification settings - Fork 66
Fix OSV schema for PyPI ecosystem: use proper case "PyPI" and ECOSYSTEM range type #570
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
Fix OSV schema for PyPI ecosystem: use proper case "PyPI" and ECOSYSTEM range type #570
Conversation
…ge type Co-authored-by: KunalSin9h <82411321+KunalSin9h@users.noreply.github.com>
SEMVER
ranges
hence use "ECOSYSTEM" as valu...
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #570 +/- ##
=====================================
Coverage 8.21% 8.22%
=====================================
Files 284 284
Lines 47466 47476 +10
=====================================
+ Hits 3901 3905 +4
- Misses 43292 43298 +6
Partials 273 273 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhisek
ecosystem for file path is correct like pypi
for osv json schema require PyPI
, thats why new map for those.
…tter intention revealing Co-authored-by: abhisek <31844+abhisek@users.noreply.github.com>
Problem
The OSV reporting schema for PyPI packages had two issues that caused validation failures:
This resulted in OSV schema validation errors like:
Solution
1. Added proper ecosystem mapping for OSV schema
Created a separate
osvEcosystemMap
that provides the correct case-sensitive ecosystem names:2. Added conditional range type logic
PyPI packages now use
ECOSYSTEM
range type while other ecosystems continue usingSEMVER
:3. Preserved file path generation
The existing
maliciousPackagesEcosystemMap
remains unchanged to ensure file paths continue using lowercase (e.g.,osv/malicious/pypi/package/...
).Result
PyPI packages now generate valid OSV schema:
Testing
Fixes the OSV schema validation issues for PyPI packages while maintaining backward compatibility for file generation and other ecosystems.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.npmjs.org
/tmp/go-build756587219/b1304/registry.test -test.testlogfile=/tmp/go-build756587219/b1304/testlog.txt -test.paniconexit0 -test.timeout=1m0s
(dns block)/tmp/go-build756587219/b1340/readers.test -test.testlogfile=/tmp/go-build756587219/b1340/testlog.txt -test.paniconexit0 -test.timeout=1m0s
(dns block)https://api.github.com/repos/safedep/vet/contents/README.md
/tmp/go-build756587219/b1340/readers.test -test.testlogfile=/tmp/go-build756587219/b1340/testlog.txt -test.paniconexit0 -test.timeout=1m0s
(http block)https://api.github.com/repos/safedep/vet/contents/docs
/tmp/go-build756587219/b1340/readers.test -test.testlogfile=/tmp/go-build756587219/b1340/testlog.txt -test.paniconexit0 -test.timeout=1m0s
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.