Conversation
Every PR preview, the main docs deploy and the coverage deploy commit to the shared gh-pages branch. The deploy action force-pushes by default, so when two jobs overlap the second push is not a fast-forward. The "Protect gh-pages" ruleset rejects such pushes, and the second job fails; before the ruleset the force-push silently discarded the other job's commit. Each deploy touches only its own folder, so with force: false the action fetches, rebases its commit onto the new tip and retries, up to three attempts, without overwriting anything. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
See #2878 for an alternate approach (filed less than an hour ago). I'm not sure this is a 100% solution since it could still result in merge conflicts that won't resolve. Serializing the work is guaranteed to always work. |
Contributor
|
Contributor
Author
|
@leofang What do you think of the approach? |
2 tasks
brandon-b-miller
approved these changes
Sep 18, 2026
brandon-b-miller
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Just one suggestion, it looks like
cuda-python/ci/cleanup-pr-previews
Line 270 in 4716189
for attempt in 1 2 3; do
if git push origin gh-pages; then break; fi
if [[ $attempt -eq 3 ]]; then
echo "[ERROR] push to gh-pages rejected after ${attempt} attempts" >&2
exit 1
fi
git fetch origin gh-pages
git rebase FETCH_HEAD
done
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.
Summary
The docs job fails on PRs whose doc-preview deploy overlaps with another deploy to
gh-pages, most recently #2870 and #2871 within the same minute, and #2873 and #2875 today. Every PR preview, the main docs deploy, and the coverage deploy commit to that shared branch. The deploy action force-pushes by default, so when two jobs overlap the second push is not a fast-forward, and the "Protect gh-pages" ruleset (non-fast-forward pushes blocked since 2025-10) rejects it. Before the ruleset, the second force-push silently discarded the other job's commit, which could drop another PR's preview or a live docs update.Changes
.github/actions/doc_preview/action.yml,.github/workflows/build-docs.yml,.github/workflows/coverage.yml: setforce: falseon the fourgithub-pages-deploy-actionsteps. With force off the action pushes normally and, if the push is rejected, fetches the branch, rebases its single commit onto the new tip, and retries (up to three attempts, the action'sattempt-limitdefault). Each deploy commit touches only its own folder, so the rebase never conflicts with another PR's or main's deploy; same-PR runs are already serialized by the workflow concurrency group. Nothing is ever overwritten, and the ruleset stays as is. The upstream preview action this one reimplements (rossjrw/pr-preview-action) runs withforce: falsefor the same reason.Related Work
Docs / Build docsfailures on cuda.core: anchor _extension_depends() on build_hooks.py's location #2870, cuda.core: fix the peer-access cleanup before pool destroy #2871, Regenerate bindings: !548 Fix rst formatting of all docstrings #2873, Regenerate bindings: !568 Fix readonly correctness in __setitem__ #2875.🤖 Generated with Claude Code