Repository navigation
Fix the doc-drift no-op guard, and fail loudly when the branch's fixes have no PR - #637
Merged
Merged
Conversation
…s have no PR `git status --porcelain` is a whole-worktree predicate and is never empty in the open-pr job — download-artifact drops doc-fix.patch and fixes.txt in the workspace root — so the no-op guard could never fire, and every quiet night fell through to `git commit` and died on "nothing added to commit". Stage first and ask the index instead. A quiet night is also only benign if the fixes already on the branch are visible somewhere. The patch is idempotent, so nothing re-commits them and the create path never fires again for work already pushed. Fail when doc/ differs from main with no open PR — that is how #632-#635 ended up invisible after run 30689709217 hit the createPullRequest policy block. Diffing doc/ rather than counting commits keeps the merge commits this job creates from reading as stranded work, and naming the files rather than negating `git diff --quiet` keeps an unresolvable ref fatal instead of misreported. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019edYt6pHPKFqVcsDpJ7v9x
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.
The nightly doc-accuracy review's
open-prjob failed on run 30689709217 — the first night since the 2026-07-31 redesign that the reviewer actually produced a patch, so this path had never executed. Two independent bugs, one masking the other.The no-op guard could never fire.
git status --porcelainis a whole-worktree predicate, andactions/download-artifactdropsdoc-fix.patchandfixes.txtin the workspace root, so it always reports?? …. Every quiet night therefore fell through togit add -A doc/(staging nothing) andgit commit, which exits 1 underset -euo pipefail— a red run blaming "nothing added to commit". Staging first and testing the index asks the question the step actually means. Thepatchstep twelve lines up documents this exact trap by name.A quiet night was treated as unconditionally benign. The patch is idempotent, so once fixes are pushed nothing re-commits them and
gh pr createnever runs again for work already on the branch. When the PR is missing, those fixes are stranded and no later run recovers them — which is precisely what happened to #632–#635 whencreatePullRequestwas blocked by the repo's Actions policy. The job now fails and names the unmerged files.Two details in the second guard are deliberate:
doc/againstmain, not counting commits. This branch is long-lived and gets squash-merged repeatedly, so it sits permanently ahead ofmain; only the content question stays correct after the first merge.! git diff --quiet.--quietexits non-zero for errors (128, e.g. an unresolvableorigin/main) exactly as for "differs" (1), so the negation would report stranded fixes when the real fault was something else. Capturing the output keeps a genuine git failure fatal with git's own message.Verified against throwaway repos reproducing the CI workspace:
exit 0exit 0exit 0origin/mainunresolvablefatal:Workflow-only change; no engine code touched. The policy toggle has since been enabled and #636 was opened by hand to rescue the stranded fixes.