Repository navigation
Pass index_urls when updating uncompiled requirement files - #16961
Open
koenvincent wants to merge 2 commits into
Open
koenvincent wants to merge 2 commits into
koenvincent wants to merge 2 commits into
Conversation
update_uncompiled_files built a RequirementFileUpdater with credentials but without index_urls. RequirementReplacer#package_hashes_for then used [nil], and the hash helper fell back to hashin's default index, pypi.org, even when a python-index registry with replaces-base: true was configured. On a runner that cannot reach pypi.org every update of a hashed requirements file failed with HelperSubprocessFailed in get_dependency_hash. The same omission was in the uv and the python compile file updaters.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Regression coverage is missing for private-only index URL forwarding in both compile updater call sites, leaving default-index fallback and returned-hash persistence unverified.
1 open issue
What changed in this PR
This PR addresses the index-forwarding portion of #16960 so hash lookups for uncompiled requirements use configured registries rather than defaulting to pypi.org.
Changes:
- Passes
index_urlstoRequirementFileUpdaterin both uv and pip-compile. - Leaves hashin’s separate registry-path handling issue outside this PR.
| File | Description |
|---|---|
uv/lib/dependabot/uv/file_updater/compile_file_updater.rb |
Forwards configured indexes when updating uncompiled requirements. |
python/lib/dependabot/python/file_updater/pip_compile_file_updater.rb |
Adds the same index forwarding for pip-compile. |
Review effort: Balanced
| dependency_files: files, | ||
| credentials: credentials | ||
| credentials: credentials, | ||
| index_urls: @index_urls |
Contributor
|
@koenvincent please add some regression test to cover this changes |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the first half of #16960.
What are you trying to accomplish?
update_uncompiled_filesin both compile file updaters builds aRequirementFileUpdaterwithcredentials:but withoutindex_urls:. Hashes for an updated hashed requirements file are then fetched from hashin's default index, pypi.org, even when apython-indexregistry withreplaces-base: trueis configured. On a runner that cannot reach pypi.org, every such update fails withHelperSubprocessFailedinget_dependency_hash.How will you know you've accomplished your goal?
The hash helper receives the configured registry URLs, as it already does from the other
RequirementReplacercall sites in the same updaters.Notes
uv/.../compile_file_updater.rbandpython/.../pip_compile_file_updater.rb. Both call sites resolve toDependabot::Python::FileUpdater::RequirementFileUpdater, whose initializer already acceptsindex_urls:.Checklist