Skip to content

Do not delete the caller's directory in pipeline mode - #425

Open
ibrahim halatci (ihalatci) wants to merge 2 commits into
developfrom
ihalatci-fix-update-docker-pipeline-cleanup
Open

Do not delete the caller's directory in pipeline mode#425
ibrahim halatci (ihalatci) wants to merge 2 commits into
developfrom
ihalatci-fix-update-docker-pipeline-cleanup

Conversation

@ihalatci

Copy link
Copy Markdown
Contributor

Problem

update_docker.py called remove_cloned_code(execution_path) unconditionally at the end of its __main__ block.

In --pipeline mode, execution_path is supplied by the caller — and in CI that is $GITHUB_WORKSPACE. So the cleanup step deleted the runner's own workspace, immediately after the PR had already been created.

The Python process itself exits 0, so the failure surfaces one step later, when the next action in the job cannot start:

An error occurred trying to start process
'/home/runner/actions-runner/cached/externals/node20/bin/node'
with working directory '/home/runner/work/docker/docker'. No such file or directory

Impact

This is why every recorded run of the Update Version on Docker Files workflow in citusdata/docker has failed — 13 runs going back to Sep 2025 — despite the bump PR being opened successfully each time.

Evidence: the PRs those runs created (citusdata/docker#364, #371, #375) were each created 2–3 seconds before their run died, and the check-run annotation on each is the No such file or directory error above.

Because the workflow always went red, nobody trusted it, and version bumps drifted to being done by hand. That is the root cause of Citus 14.2.0 never getting a Docker image until it was noticed and published manually four weeks after the upstream release.

Fix

remove_cloned_code is only meaningful for the clone the script creates itself in non-pipeline mode (via initialize_env). In pipeline mode the caller owns the directory and is responsible for it.

Guarded exactly the way the two sibling scripts already do:

  • update_pgxn.py:78if not args.is_test and not args.pipeline:
  • update_package_properties.py:451if not arguments.is_test and not arguments.pipeline:

update_docker.py was the only one missing the guard.

Validation

  • black --check clean; prospector-relevant formatting unchanged
  • pytest packaging_automation/tests/test_update_docker.py — 9 passed
  • Pipeline mode, end-to-end (real __main__, local bare origin, stubbed create_pr): branch created → 6 files changed → commit → push → exit 0 → workspace intact
  • Non-pipeline mode, end-to-end: still clones into docker_temp and still deletes it afterwards — no regression to the existing cleanup behaviour

Follow-up

Once this is merged and tagged, citusdata/docker will repin .github/workflows/update_version.yml from v0.8.36 to the new tag.

update_docker.py called remove_cloned_code(execution_path) unconditionally.
In --pipeline mode execution_path is supplied by the caller (in CI it is
$GITHUB_WORKSPACE), so the cleanup deleted the runner's own workspace after
the PR had already been created. The Python process exited 0, but the next
action in the job could not start:

  An error occurred trying to start process '.../node20/bin/node' with
  working directory '/home/runner/work/docker/docker'. No such file or
  directory

This is why every citusdata/docker "Update Version on Docker Files" run has
failed even though it successfully opened its PR.

remove_cloned_code is only meaningful for the clone the script creates
itself in non-pipeline mode. Guard it the same way update_pgxn.py and
update_package_properties.py already do.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bb18c8e4-f4c5-43b7-92cf-30d6b03deb87
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants