ci: prune noise-only files from deploy PRs#15286
Merged
Merged
Conversation
The scheduled deploy workflow rebuilds every documentation version nightly. Each rebuild changes files even when their content is identical, because of Sphinx build-time timestamps and mermaid diagram zoom ids (random UUIDs regenerated on every build). The old gate only decided whether to open a PR at all: as soon as a single real change existed anywhere, every noise-only file was committed alongside it (e.g. PR #15278: 1337 files, most of them timestamp-only). Prune per file before opening the PR: - revert HTML whose entire diff is noise (timestamps, mermaid zoom ids) - revert pdf/epub for version folders left with no real HTML change - recompute has_changes from the pruned tree Files with genuine content changes are kept untouched. The result is a deploy PR that carries only real content updates. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Contributor
📖 Documentation PreviewNo RST documentation pages changed in this PR. Last updated: Tue, 07 Jul 2026 09:04:23 GMT |
The prune step piped 'git diff --name-only' into a while loop that ran 'git checkout' per file. The streaming diff refreshes the index and holds .git/index.lock while the loop's checkout tries to write it, racing and failing with 'Unable to create index.lock: File exists' (exit 128). Materialise each file list fully before any checkout, set GIT_OPTIONAL_LOCKS=0 so read-only diffs never take the lock, and batch the reverts into a single xargs git checkout call. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
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.
☑️ Resolves
Cuts build noise from the nightly deploy PRs. No linked issue — follow-up on the deploy workflow after observing #15278 (1337 files changed, the vast majority timestamp-only).
🧩 What & why
The scheduled
deploy-docs.ymlworkflow rebuilds every documentation version every night. A rebuilt page differs even when its content is identical, because of:lastupdated/Last updated on)data-zoom-id— a random UUID regenerated on every build)The previous logic was a single global gate: it only decided whether to open a PR at all. As soon as one real change existed anywhere in the tree, every noise-only file was committed alongside it. In #15278 that meant 1337 files, where
32/33/34/stablewere almost entirely timestamp + mermaid-id churn plus one genuine link-anchor fix.This changes the "Apply staged artifacts" step to prune per file before opening the PR:
pdf/epubbinaries for a version folder that has no real HTML change left after step 1 (they regenerate every build with no content change).has_changesfrom the pruned tree (git status --porcelain), so a run that produced only noise still opens no PR.Result: deploy PRs carry only files with genuine content changes.
🖼️ Screenshots
N/A — CI workflow change, no rendered documentation output.
🧪 Testing notes
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/deploy-docs.yml'))").Last updatedlines and mermaiddata-zoom-idlines are the only noise categories; the one real change there (a swapped troubleshooting link anchor) would be preserved, everything else dropped.data-zoom-idtoken matches both mermaid lines (the<pre data-zoom-id=…>and thed3.selectAll(".mermaid[data-zoom-id=…]")selector), so a file's diagram id churn reverts as a pair and stays internally consistent.gh-pages.✅ Checklist
codespellor similar and addressed any spelling issuesThis change was AI-assisted (drafted with Claude Code); the author reviewed and owns it.