Skip to content

fix: repair the per-run log index and the release checkout path - #9

Merged
Iamliuxiaozhen merged 1 commit into
mainfrom
fix/log-index-clobber-and-release-path
Dec 1, 2026
Merged

Iamliuxiaozhen merged 1 commit into
mainfrom
fix/log-index-clobber-and-release-path

Conversation

@Iamliuxiaozhen

Copy link
Copy Markdown
Member

Two independent faults surfaced on the same publish run.

  1. Every run directory listed as "This directory is empty".

The log files were present and served correctly, but /log//index.html claimed the directory was empty. stage-log-index.sh rebuilt the /log/ listing by creating one empty directory per run and running generate-index.sh over that tree. generate-index.sh walks recursively, so it wrote an "empty directory" index inside every run directory, and the workflow then synced that tree over log/ — replacing the real per-run index that publish-repo.sh had generated from the staged files.

The script now builds the listing in a scratch tree and copies out only its root index.html, so rebuilding /log/ can no longer touch the per-run indexes.

  1. No release was ever created.

publish-log-release.sh located the repository with git -C <script dir> rev-parse --show-toplevel, which resolves to the ZGS source checkout rather than the log repository clone, so it failed with "run directory not found: /home/runner/work/ZGS/ZGS/" and never reached the release API. That is why zitzhen/ZGS-build-log had the logs committed but zero releases.

The checkout is now an explicit argument, and the workflow passes $RUNNER_TEMP/logrepo.

Tests in script-checks.yml cover both: the rebuilt /log/ index must not create per-run indexes and the per-run index must still list its files afterwards, and the release script must reject a missing checkout path. Verified the first test fails against the previous script, which reproduces the published symptom exactly (the run index loses its file and gains "This directory is empty").

Also exercised the release script end to end against a stubbed API for both the create path, which uploaded both assets, and the re-run path, which updated the existing release and replaced its asset instead of duplicating it.

Two independent faults surfaced on the same publish run.

1. Every run directory listed as "This directory is empty".

The log files were present and served correctly, but
/log/<run-dir>/index.html claimed the directory was empty. stage-log-index.sh
rebuilt the /log/ listing by creating one empty directory per run and running
generate-index.sh over that tree. generate-index.sh walks recursively, so it
wrote an "empty directory" index inside every run directory, and the workflow
then synced that tree over log/ — replacing the real per-run index that
publish-repo.sh had generated from the staged files.

The script now builds the listing in a scratch tree and copies out only its
root index.html, so rebuilding /log/ can no longer touch the per-run indexes.

2. No release was ever created.

publish-log-release.sh located the repository with
`git -C <script dir> rev-parse --show-toplevel`, which resolves to the ZGS
source checkout rather than the log repository clone, so it failed with
"run directory not found: /home/runner/work/ZGS/ZGS/<run-dir>" and never
reached the release API. That is why zitzhen/ZGS-build-log had the logs
committed but zero releases.

The checkout is now an explicit argument, and the workflow passes
$RUNNER_TEMP/logrepo.

Tests in script-checks.yml cover both: the rebuilt /log/ index must not create
per-run indexes and the per-run index must still list its files afterwards, and
the release script must reject a missing checkout path. Verified the first test
fails against the previous script, which reproduces the published symptom
exactly (the run index loses its file and gains "This directory is empty").

Also exercised the release script end to end against a stubbed API for both the
create path, which uploaded both assets, and the re-run path, which updated the
existing release and replaced its asset instead of duplicating it.

Signed-off-by: Oliver Lin <oliver@liuxiaozhen.dev>
@Iamliuxiaozhen
Iamliuxiaozhen merged commit d47e090 into main Dec 1, 2026
4 checks passed
@Iamliuxiaozhen
Iamliuxiaozhen deleted the fix/log-index-clobber-and-release-path branch December 1, 2026 13:42
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.

1 participant