Skip to content

fix(build): default PIP_INDEX_URL to https://pypi.org/simple - #23227

Merged
wy65701436 merged 3 commits into
goharbor:mainfrom
Vad1mo:fix-pip-index-url-default
May 13, 2026
Merged

wy65701436 merged 3 commits into
goharbor:mainfrom
Vad1mo:fix-pip-index-url-default

Conversation

@Vad1mo

@Vad1mo Vad1mo commented May 12, 2026 •

Copy link
Copy Markdown
Member

The BUILD_PACKAGE (amd64) and BUILD_PACKAGE (arm64) jobs on main are failing with:

#7 [3/5] RUN pip3 install pipenv==2025.0.3 --index-url
#7 0.926 --index-url option requires 1 argument
ERROR: failed to build: failed to solve: process "/bin/sh -c pip3 install pipenv==2025.0.3 --index-url ${pip_index_url}" did not complete successfully: exit code: 2
make[1]: *** [.../make/photon/Makefile:121: _build_prepare] Error 1
make: *** [Makefile:418: build] Error 2

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) added PIP_INDEX_URL plumbing through the make/Docker build chain but did not add a default value for PIP_INDEX_URL at the top of the root Makefile — unlike the NPM_REGISTRY=https://registry.npmjs.org pattern it was modeled on.

When PIP_INDEX_URL is not set in the environment (the default CI case), the build chain expands as:

  • Root Makefile invokes the photon sub-make with -e PIP_INDEX_URL= (empty).
  • make/photon/Makefile runs docker build ... --build-arg pip_index_url=$(PIP_INDEX_URL), which becomes --build-arg pip_index_url= (empty value).
  • This overrides the ARG pip_index_url=https://pypi.org/simple default in make/photon/prepare/Dockerfile.base with an empty string.
  • RUN pip3 install pipenv==2025.0.3 --index-url ${pip_index_url} then expands to pip3 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_URL in the root Makefile, mirroring the existing NPM_REGISTRY default:

NPM_REGISTRY=https://registry.npmjs.org
PIP_INDEX_URL=https://pypi.org/simple

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 build after the fix shows -e PIP_INDEX_URL=https://pypi.org/simple flowing into the photon sub-make.

Test plan

  • CI BUILD_PACKAGE (amd64) passes
  • CI BUILD_PACKAGE (arm64) passes
  • make build PIP_INDEX_URL=https://example.invalid/simple still honors the override

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>
@Vad1mo
Vad1mo requested a review from a team as a code owner May 12, 2026 10:04
@codecov

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.03%. Comparing base (90ea09f) to head (5e7d94a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 66.03% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Vad1mo Vad1mo added the release-note/update Update or Fix label May 12, 2026

@wy65701436 wy65701436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wy65701436
wy65701436 enabled auto-merge (squash) May 13, 2026 09:03
@stonezdj
stonezdj requested a review from Copilot May 13, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 root Makefile alongside the existing NPM_REGISTRY default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wy65701436
wy65701436 merged commit 1019610 into goharbor:main May 13, 2026
11 of 12 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/update Update or Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants