Repository navigation
fix(build): default PIP_INDEX_URL to https://pypi.org/simple - #23227
Merged
Merged
Conversation
PR goharbor#23205 added PIP_INDEX_URL plumbing but did not set a default, so when the variable is unset the top-level Makefile forwarded an empty value to the photon sub-make. The sub-make in turn passed `--build-arg pip_index_url=` to `docker build`, which overrides the Dockerfile.base ARG default with an empty string and breaks `pip3 install pipenv ... --index-url ` (the option requires an argument). This caused the BUILD_PACKAGE jobs on main to fail. Mirror the existing NPM_REGISTRY pattern by providing a default value for PIP_INDEX_URL in the top-level Makefile. Signed-off-by: Vadim Bauer <vb@container-registry.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23227 +/- ##
==========================================
- Coverage 66.03% 66.03% -0.01%
==========================================
Files 1074 1074
Lines 116854 116854
Branches 2955 2955
==========================================
- Hits 77170 77167 -3
- Misses 35399 35401 +2
- Partials 4285 4286 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
OrlinVasilev
approved these changes
May 13, 2026
5 tasks done
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CI build failures in the photon “prepare” image build by ensuring PIP_INDEX_URL is non-empty when it is plumbed through the root Makefile into the photon sub-make and then into Docker --build-arg pip_index_url=....
Changes:
- Add a default value for
PIP_INDEX_URL(https://pypi.org/simple) in the rootMakefilealongside the existingNPM_REGISTRYdefault.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mauraza
pushed a commit
to Mauraza/harbor
that referenced
this pull request
May 14, 2026
…r#23227) PR goharbor#23205 added PIP_INDEX_URL plumbing but did not set a default, so when the variable is unset the top-level Makefile forwarded an empty value to the photon sub-make. The sub-make in turn passed `--build-arg pip_index_url=` to `docker build`, which overrides the Dockerfile.base ARG default with an empty string and breaks `pip3 install pipenv ... --index-url ` (the option requires an argument). This caused the BUILD_PACKAGE jobs on main to fail. Mirror the existing NPM_REGISTRY pattern by providing a default value for PIP_INDEX_URL in the top-level Makefile. Signed-off-by: Vadim Bauer <vb@container-registry.com> Co-authored-by: Orlix <7236111+OrlinVasilev@users.noreply.github.com>
7 of 8 tasks
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.
The
BUILD_PACKAGE (amd64)andBUILD_PACKAGE (arm64)jobs onmainare failing with:Failing run: https://github.com/goharbor/harbor/actions/runs/25718978392/job/75515291769
Root cause
PR #23205 (
Support custom PyPI index URL for prepare image builds) addedPIP_INDEX_URLplumbing through the make/Docker build chain but did not add a default value forPIP_INDEX_URLat the top of the rootMakefile— unlike theNPM_REGISTRY=https://registry.npmjs.orgpattern it was modeled on.When
PIP_INDEX_URLis not set in the environment (the default CI case), the build chain expands as:Makefileinvokes the photon sub-make with-e PIP_INDEX_URL=(empty).make/photon/Makefilerunsdocker build ... --build-arg pip_index_url=$(PIP_INDEX_URL), which becomes--build-arg pip_index_url=(empty value).ARG pip_index_url=https://pypi.org/simpledefault inmake/photon/prepare/Dockerfile.basewith an empty string.RUN pip3 install pipenv==2025.0.3 --index-url ${pip_index_url}then expands topip3 install pipenv==2025.0.3 --index-url(no value), and pip exits with--index-url option requires 1 argument.Fix
Provide a default value for
PIP_INDEX_URLin the rootMakefile, mirroring the existingNPM_REGISTRYdefault:This restores the behavior that existed before PR #23205 while preserving the override capability (users can still pass
make build PIP_INDEX_URL=https://my-mirror/simple).Verification
Reproduced and verified locally with Docker:
docker build -f make/photon/prepare/Dockerfile.base --build-arg pip_index_url= .→ reproduces the CI failure exactly (--index-url option requires 1 argument).docker build -f make/photon/prepare/Dockerfile.base --build-arg pip_index_url=https://pypi.org/simple .→ builds successfully.make -n buildafter the fix shows-e PIP_INDEX_URL=https://pypi.org/simpleflowing into the photon sub-make.Test plan
BUILD_PACKAGE (amd64)passesBUILD_PACKAGE (arm64)passesmake build PIP_INDEX_URL=https://example.invalid/simplestill honors the override