Fix docs gh-pages push hanging until job timeout#9548
Open
atalman wants to merge 1 commit into
Open
Conversation
The upload job's git push runs inside the build container, where the repo is mounted at /pytorch/vision. The credentials persisted by actions/checkout are scoped via includeIf.gitdir to the runner-host checkout path (and /github/workspace), neither of which matches the container mount, so the bare git push is unauthenticated. With a TTY attached and no credential helper, git blocks on an interactive prompt and the job is cancelled at the 60-minute timeout. This has silently broken the automated docs upload since ~2026-01-21 (0.27 and 0.28 tag uploads both timed out; docs were pushed manually after). Push with an explicit token (SECRET_GITHUB_TOKEN is available in the container) and set GIT_TERMINAL_PROMPT=0 so auth failures fail fast. Co-authored-by: Claude
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9548
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 Pending, 2 Unrelated Failures, 1 Unclassified FailureAs of commit b9cd225 with merge base 66089cf ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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
uploadjob's docs push togh-pageshas been hanging until the 60-minute job timeout on tag/main pushes (deterministic, not a flake): both thev0.27.0andv0.28.0runs showbuildsucceeding anduploadcancelled ~59 min into a silentgit push. Automatedpytorchbot"auto-generating sphinx docs" commits ongh-pagesstop at 2026-01-21; every release since was pushed manually.Root cause
The
git pushruns inside the build container (repo mounted at/pytorch/vision).actions/checkoutstores the auth header in a temp file wired via path-scopedincludeIf.gitdirfor the runner-host path and/github/workspace/...— neither matches/pytorch/vision/.git. So the push is unauthenticated; with a TTY and no credential helper, git blocks on an interactive credential prompt until the timeout.Fix — this authenticates the push so it succeeds
The real fix is giving the push valid credentials.
SECRET_GITHUB_TOKENis already present in the container and the job hascontents: write, so we push with an explicit token:GIT_TERMINAL_PROMPT=0is only a safety net (turns any future auth problem into an immediate error instead of a 60-min hang); the authenticated URL is what makes the push actually complete.Verification that the push succeeds (not just fails fast)
pytorch/vision:git ls-remote https://x-access-token:<token>@github.com/pytorch/vision gh-pagesreturns the ref, no prompt.gh-pagesis not a protected branch, and the token has push/contents: write, so the push is authorized to write.SECRET_GITHUB_TOKENis confirmed populated in the container (the failing 0.28 run loggedALL_SECRETS: {"github_token":"***"}), andrun_with_env_secrets.pyexports it asSECRET_GITHUB_TOKEN.mainwill exercise this path and should land a freshauto-generating sphinx docscommit ongh-pageswithin minutes (instead of timing out) — the authoritative end-to-end confirmation.AI assistance (Claude) was used for this change.