ci: retry the generated-docs push through a rebase on rejection #171

Merged
rootiest merged 1 commits from ci/retry-docs-commit-push into main 2026-09-23 02:59:54 +00:00
Owner

Summary

CI run 976 (build-docs, triggered by #168's merge) failed at the last step, "Commit generated docs" — every real step before it (tests, verify-manual.py, man page compile, Astro site build, Cloudflare Pages deploy) succeeded.

Root cause: npm ci + astro build + the Cloudflare deploy took ~8 minutes. In that window I merged #169, advancing main. The bot's local clone was still based on the older commit, so its git push was rejected as non-fast-forward — a plain race between two PRs landing close together, not a defect in either PR's content.

Fix

This step only ever touches three generated files (docs/fish-config.md, docs/fish-config.1, conf.d/__fish_config_op_registry.fish), so a rebase onto whatever landed in the meantime is always mechanical. Retry the push up to 3 times, rebasing onto origin/main between attempts. Ends on an explicit test "$pushed" -eq 1 rather than trailing off the for loop, so exhausting all three retries still fails the job loudly instead of silently reporting success.

Verification

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" — valid YAML.
  • bash -n on the extracted step script — valid syntax.
  • python3 docs/verify-manual.py — 84/84 passed (unaffected, no docs/functions content touched).
## Summary CI run [976](https://git.rootiest.dev/rootiest/fish-config/actions/runs/976) (`build-docs`, triggered by #168's merge) failed at the last step, "Commit generated docs" — every real step before it (tests, `verify-manual.py`, man page compile, Astro site build, Cloudflare Pages deploy) succeeded. Root cause: `npm ci` + `astro build` + the Cloudflare deploy took ~8 minutes. In that window I merged #169, advancing `main`. The bot's local clone was still based on the older commit, so its `git push` was rejected as non-fast-forward — a plain race between two PRs landing close together, not a defect in either PR's content. ## Fix This step only ever touches three generated files (`docs/fish-config.md`, `docs/fish-config.1`, `conf.d/__fish_config_op_registry.fish`), so a rebase onto whatever landed in the meantime is always mechanical. Retry the push up to 3 times, rebasing onto `origin/main` between attempts. Ends on an explicit `test "$pushed" -eq 1` rather than trailing off the `for` loop, so exhausting all three retries still fails the job loudly instead of silently reporting success. ## Verification - [x] `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` — valid YAML. - [x] `bash -n` on the extracted step script — valid syntax. - [x] `python3 docs/verify-manual.py` — 84/84 passed (unaffected, no docs/functions content touched).
rootiest added 1 commit 2026-09-23 02:55:06 +00:00
build-docs's auto-commit step was seen rejected as non-fast-forward
(run 976, sha 3bbda31): npm ci + astro build + the Cloudflare Pages
deploy ahead of it can take several minutes, long enough for another
PR to merge into main first. A bare `git push` has no way to recover
from that -- the whole job just fails, even though every real step
(tests, manual verification, man page, site build, deploy) already
succeeded.

This commit only ever touches three generated files
(fish-config.md/.1, the component registry), so a rebase onto
whatever landed is always mechanical -- retry push up to 3 times,
rebasing onto origin/main between attempts. Ends on an explicit
`test "$pushed" -eq 1` rather than trailing off the for loop, so a
run that exhausts all three retries still fails loudly instead of
reporting success.
rootiest added the Kind/BugArea/CI labels 2026-09-23 02:55:12 +00:00
rootiest merged commit af65092102 into main 2026-09-23 02:59:54 +00:00
rootiest deleted branch ci/retry-docs-commit-push 2026-09-23 02:59:55 +00:00
Sign in to join this conversation.
No Reviewers
No labels Area/CI Kind/Bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#171