Skip to content

ci: prune noise-only files from deploy PRs#15286

Merged
skjnldsv merged 2 commits into
masterfrom
fix/deploy-prune-noise-only-changes
Jul 7, 2026
Merged

ci: prune noise-only files from deploy PRs#15286
skjnldsv merged 2 commits into
masterfrom
fix/deploy-prune-noise-only-changes

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jul 7, 2026

Copy link
Copy Markdown
Member

☑️ 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.yml workflow rebuilds every documentation version every night. A rebuilt page differs even when its content is identical, because of:

  • Sphinx build-time timestamps (lastupdated / Last updated on)
  • mermaid diagram zoom ids (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 / stable were 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:

  1. Revert any HTML file whose entire diff is noise (timestamps, mermaid zoom ids). Files with a real change are kept untouched — noise lines just ride along.
  2. Revert pdf/epub binaries for a version folder that has no real HTML change left after step 1 (they regenerate every build with no content change).
  3. Recompute has_changes from 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

  • YAML validates (python3 -c "import yaml; yaml.safe_load(open('.github/workflows/deploy-docs.yml'))").
  • Prune logic reviewed against Documentation update #15278's diff: the ~1888 Last updated lines and mermaid data-zoom-id lines are the only noise categories; the one real change there (a swapped troubleshooting link anchor) would be preserved, everything else dropped.
  • The data-zoom-id token matches both mermaid lines (the <pre data-zoom-id=…> and the d3.selectAll(".mermaid[data-zoom-id=…]") selector), so a file's diagram id churn reverts as a pair and stays internally consistent.
  • Full behavioural verification happens on the next scheduled run against gh-pages.

✅ Checklist

  • I have built the documentation locally and reviewed the output — N/A, CI-only change
  • Screenshots are included for visual changes — N/A
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

This change was AI-assisted (drafted with Claude Code); the author reviewed and owns it.

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>
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

No 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>
@skjnldsv skjnldsv merged commit 8231332 into master Jul 7, 2026
39 checks passed
@skjnldsv skjnldsv deleted the fix/deploy-prune-noise-only-changes branch July 7, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant