-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve handling for hashing unknown packages #9556
Conversation
a38e561
to
4052a33
Compare
…o jurre/hash-private-packages
python/lib/dependabot/python/file_updater/requirement_replacer.rb
Outdated
Show resolved
Hide resolved
@jurre Since this change, in our dependabot-script implementation, I've been getting this error. Any idea what this change actually depends on or expects as far as configuration, in order to successfully setup the python updater?
|
Ok, I'm guessing that since #8967, the Array of Hash for credentials is no longer valid, but still used by dependabot-script. Investigating how to setup the credential using the class... |
Yep, that was it. Fixed it, #8967 (comment) |
|
||
index_urls.each do |index_url| | ||
args = [name, version, algorithm] | ||
args << index_url if index_url |
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.
@jurre: I think there is a problem with this 4th arg that is causing the issues seen in:
In some cases, that arg ends up being "/pypi/<package-name>/json"
(e.g. "/pypi/zope-interface/json"
) which is not a full URL and causes an error when passed as is to hashin.get_package_hashes
in python/helpers/lib/hasher.py
.
https://pypi.org/pypi/zope-interface/json is a valid URL, so either the caller should provide the full URL, or some function down the line should concatenate that path to the domain to form a full URL before calling hashin.get_package_hashes
.
Original issue: #7907
Dependabot attempts to resolve package hashes from PyPI, but some packages are hosted on private registries. To address this, we iterate though the index URLs set in
dependaboy.yml
and pass them to the native helper until a match is found.