-
Notifications
You must be signed in to change notification settings - Fork 273
Add OPAM to osv.dev #4582
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
base: master
Are you sure you want to change the base?
Add OPAM to osv.dev #4582
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@hannesm : The list of data sources in the documentation could also be updated to add this new source. https://github.com/google/osv.dev/blob/master/docs/data.md This updates this page: https://google.github.io/osv.dev/data/ |
Thanks for your comment. FYI, this is not mentioned in the issue template for a new source (see #4581). |
|
Anything I can do to move this forward? It looks like CI systems await approval (though I can't see the oss-vdb worker output). |
|
/gcbrun |
|
/gcbrun |
another-rex
left a comment
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.
I believe you can run most of the tests locally as well
make lib-tests
make lint
See Makefile for other tests available, but I think lib-tests is the one you need, though it will require you to have the poetry installed. (See CONTRIBUTING.md for full list of prerequisites. )
|
/gcbrun |
|
/gcbrun |
|
LGTM, though please fix the linting issues. Use
|
|
@another-rex thanks for your review and insight. I pushed a commit with the formatted file. A EDIT: Sorry I messed up the git state and did a rebase onto master and a force-push. |
osv/ecosystems/opam.py
Outdated
| if archive_response.status_code == 200: | ||
| responses.extend(archive_response.json()) | ||
|
|
||
| versions = [x["name"] for x in responses] |
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.
looking at the response for opam-repository, the name field is in the form opam-repository.2.0.0, where I presume the version is supposed to be 2.0.0 (judging by the OSV record)
Maybe this should be x['name'].removeprefix(package + '.')?
(Are package names case-sensitive, or are they always lower-case?)
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.
the removeprefix is done in bacbfa7
(Are package names case-sensitive, or are they always lower-case?)
Neither. They are case-sensitive. There are mixed case package names as well in the package repository (such as unionFind wxOCaml CamelCase). The opam-repository git repository is manually maintained (i.e. pull requests are not automatically merged), and care is taken to not have package names that only differ in casing.
No problem, we can do a final format pass on our end to pass the check. |
|
Thanks for your review @michaelkedar and @another-rex. Please let me know if there's anything else that needs to be done to get this merged. |
Co-authored-by: Michael Kedar <michaelkedar@google.com>
For #4581
Please note that I'm not an experienced Python programmer, happy to get feedback on this.