Skip to content

Fix: CLI flags for pip builder are ignored

Fabien Catteau requested to merge fix-pip-builder-flags-ignored into master

What does this MR do?

Bug visible by creating a pipeline for the python-pip test project, and where DS_PIP_VERSION is set. See https://gitlab.com/gitlab-org/security-products/tests/python-pip/-/jobs/1765259085 for instance; it does not install the requested version of pip.

Link to create such pipelines: https://gitlab.com/gitlab-org/security-products/tests/python-pip/-/pipelines/new?var[DS_PIP_VERSION]=20.0.1&var[SECURE_LOG_LEVEL]=debug

As a comparison, here's corresponding job when running the Docker image built in this MR: https://gitlab.com/gitlab-org/security-products/tests/python-pip/-/jobs/1765260797#L26. This job starts with the installation of the request version of pip:

[DEBU] [gemnasium-python] [2021-11-09T17:44:14Z] ▶ /usr/local/bin/python /get-pip.py --disable-pip-version-check --no-cache-dir pip==20.0.1
Collecting pip==20.0.1
  Downloading https://files.pythonhosted.org/packages/57/36/67f809c135c17ec9b8276466cc57f35b98c240f55c780689ea29fa32f512/pip-20.0.1-py2.py3-none-any.whl (1.5MB)

This was surfaced when copying main.go to gemnasium-maven. See gemnasium-maven!132 (comment 728295344)

CI variables not processed by the pip builder prior to that change:

  • DS_PIP_VERSION
  • DS_PIP_DEPENDENCY_PATH
  • PIP_CERT (not documented but possibly used; see pip documentation)
  • DS_GET_PIP_PATH (not documented, implementation detail)

See https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/v2.29.11/builder/pip/pip.go#L34

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Edited by Fabien Catteau

Merge request reports