Skip to content

workflows: Restore the dependency cache before creating the virtual environment in "Release" - #1063

Merged
jtrobles-cdd merged 1 commit into
developfrom
bugfix/release-virtualenv-cache-restore-order
Sep 10, 2026
Merged

jtrobles-cdd merged 1 commit into
developfrom
bugfix/release-virtualenv-cache-restore-order

Conversation

@jtrobles-cdd

Copy link
Copy Markdown
Member

The Release job of the Release workflow has the step order that #1062 fixed in the CI workflow. That pull request changed only .github/workflows/ci.yaml, so .github/workflows/release.yaml was left with it.

The failure has not been observed here yet, unlike in lib-cl-sii-api-python, only because ci-cd.yaml gates the Release job on refs/heads/master: it is skipped on develop, and it would have surfaced during the next publication instead.

Cause

  • Same as workflows: Restore the dependency cache before creating the virtual environment #1062: the job creates the virtual environment and only then restores the cache into it, and actions/cache restores by extracting an archive over the workspace, so the cached Pip installation gets merged with the one python -m venv bootstraps instead of replacing it.
  • The interpreters actions/setup-python currently installs bootstrap Pip 26.2.1, while this project pins 26.0.1. Pip 26.2 turned module pip/_internal/build_env.py into a package of the same name, so the build_env/ package of 26.2.1 survives the merge and shadows the build_env.py module of 26.0.1, and Pip fails with ImportError: cannot import name 'get_runnable_pip' from 'pip._internal.utils.misc'.

Changes

Remaining Occurrences

  • None. deploy.yaml restores the same cache but creates no virtual environment, which is the safe case, and ci-cd.yaml, task-release-and-publish.yaml, git-commit-lint.yaml and dependency-review.yaml touch neither.

Verification

  • The cause and the fix were verified in workflows: Restore the dependency cache before creating the virtual environment #1062 and in cordada/lib-cl-sii-api-python#1131; only the workflow they are applied to is new here.
  • The Release job runs on a push to master, not on a pull request, so no check on this pull request exercises the changed job, and neither will the develop run after the merge. Somebody has to confirm it during the next publication to master.

- Apply to workflow `release.yaml` the fix that PR #1062 applied to workflow `ci.yaml`: restore the
  cache before creating the Python virtual environment, and create the environment only when the
  cache was not restored.
- The `Release` job restores the same cache over a virtual environment it has just created, which
  merges the Pip installation that `python -m venv` bootstraps with the cached one instead of
  replacing it, and fails with `ImportError: cannot import name 'get_runnable_pip' from
  'pip._internal.utils.misc'` since Pip 26.2 turned module `pip/_internal/build_env.py` into a
  package of the same name.
- The job was not covered by PR #1062 because only `ci.yaml` was inspected. It runs only on
  `master`, so the failure has not been observed yet and would have surfaced during the next
  publication.

Ref: cordada/lib-cl-sii-api-python#1131
@jtrobles-cdd
jtrobles-cdd requested a review from a team as a code owner September 10, 2026 18:32
@jtrobles-cdd jtrobles-cdd added bug Something isn't working component: config config, setup, etc labels Sep 10, 2026
@jtrobles-cdd jtrobles-cdd self-assigned this Sep 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jtrobles-cdd
jtrobles-cdd merged commit 7bddc9f into develop Sep 10, 2026
28 checks passed
@jtrobles-cdd
jtrobles-cdd deleted the bugfix/release-virtualenv-cache-restore-order branch September 10, 2026 18:35
@svillegas-cdd svillegas-cdd mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component: config config, setup, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant