Skip to content

fix(hpc/sync): pull exits 1 after the first extracted archive - #190

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/hpc-sync-zip-count-set-e
Nov 25, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/hpc-sync-zip-count-set-e

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

hpc/sync runs under set -euo pipefail and unpacked pulled archives with unzip ... && (( zip_count++ )). Post-increment from 0 evaluates to 0, so the arithmetic returned exit status 1 and set -e killed the script after the first extracted archive. pull and pull-full then exited 1 without "extracted N archive(s)" or "Done.", and any later PULL_DIRS roots were never pulled.

Both unzip sites (pull, pull_full) now branch explicitly, as autolens_profiling (0dcc528f) does: if unzip ...; then zip_count=$(( zip_count + 1 )); else echo "WARNING: could not unzip <zip>"; fi. A failed unzip is now reported and the pull carries on. Before, it was skipped silently. Nothing else in the script uses (( var++ )) / (( var-- )) as a statement.

Fixes #189. Same fix for the siblings: PyAutoLabs/autogalaxy_assistant and PyAutoLabs/autofit_assistant, branch feature/hpc-sync-zip-count-set-e.

Scripts Changed

  • hpc/sync: the pull and pull_full unzip loops
  • autoassistant/tests/test_hpc_sync.py: two offline regression tests (fake ssh/rsync):
    • pull over output + results (via PYAUTO_PULL_DIRS) with three unextracted zips: exit 0, all three extracted, "extracted 3 archive(s)" and "Done."
    • pull-full with two zips on the fake remote: exit 0, "extracted 2 archive(s)"

Test Plan

  • Both new tests fail on main (exit 1, exactly one archive extracted, results/ never reached) and pass on this branch
  • python -m pytest autoassistant/tests/test_hpc_sync.py: 51 passed
  • Corrupt zip by hand: WARNING printed, the other archive extracted, exit 0

Merge mode: human /prm (Consequence: judge).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

`unzip ... && (( zip_count++ ))` returns 1 when zip_count is 0, so under
`set -euo pipefail` pull and pull-full exited 1 after the first archive,
skipping the rest and any later PULL_DIRS roots. Branch on unzip explicitly
and increment with zip_count=$(( zip_count + 1 )), as autolens_profiling
(0dcc528f) does; a failed unzip now prints a WARNING and the pull goes on.

Adds two offline tests to autoassistant/tests/test_hpc_sync.py: pull over two
roots with three zips, and pull-full with two zips. Both fail on main.

Fixes #189

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 5a0d8e5 into main Nov 25, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/hpc-sync-zip-count-set-e branch November 25, 2026 11:33
Jammy2211 added a commit to Jammy2211/ic50_workspace that referenced this pull request Nov 25, 2026
`unzip ... && (( zip_count++ ))` returns 1 when zip_count is 0, so under
`set -euo pipefail` pull and pull-full exited 1 after the first archive,
skipping the rest and any later PULL_DIRS roots. Branch on unzip explicitly
and increment with zip_count=$(( zip_count + 1 )), as the assistants now do
(PyAutoLabs/autolens_assistant#190); a failed unzip prints a WARNING and the
pull goes on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

fix(hpc/sync): pull exits 1 after the first extracted archive

1 participant