-
-
Notifications
You must be signed in to change notification settings - Fork 243
use github api to find github releases #555
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
Conversation
064ad7b to
89a4b36
Compare
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.
Thanks! I would rather not remove the SVN approach. Rather we can keep both?
Using svn on GH feels klunky BUT it has benefits: you can get tags with their dates without auth and rate limiting.
So I would rather not drop yet I get your use case too of using an authenticated.
0430d6b to
3bf14fc
Compare
|
@pombredanne thanks for the feedback. I restored the svn approach as a fallback. note that the svn also triggers some error 500 for big repos and we have no garantee github will not rate limit it once vulnerablecode is deployed everywhere. ;-) |
|
even a moderately tagged project (50 tags) creates a 504 error after 2 minutes of github hard working: |
|
I did some more research to see if we can use the graphql api to get the tag's commit date. it is possible: It takes less than a second to get the first 100 tags in linux repo https://docs.github.com/en/graphql/overview/explorer {
repository(name: "linux", owner: "torvalds") {
refs(refPrefix: "refs/tags/", first: 100) {
totalCount
pageInfo {
endCursor
}
nodes {
name
target {
oid
""" in case it is a standard tag"""
... on Commit {
committedDate
}
""" in case it is a signed tag"""
... on Tag {
target {
... on Commit {
committedDate
}
}
}
}
}
}
}
} |
|
Thanks for the research! And yes, |
|
like I said in second comment scancode repo with its 50 tags is also failing. Thats why I think it is quite a dead end. |
|
updated with Graphql version. There is a 0 rate limit when not authenticated with graphql, means I directly hit a rate limit error without GH_TOKEN. |
svn version is kept if no GH_TOKEN is given in environ, but this method has a lot of issues (proxy support, scalability) Signed-off-by: Pierre Tardy <pierre.tardy@renault.com>
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.
Thank you ++
LGTM... merging shortly
previous version with svn uses blocking synchronous api and do not work well with proxies
the tag api do not contain the commit infos and thus we don't have the release date.
I think what we really want in vulnerable code is the list of actual releases, and not really the tags.
Fix #554