Repository navigation
fix: repair the per-run log index and the release checkout path - #9
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent faults surfaced on the same publish run.
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.
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.