Skip to content

ci: pin docs that a failed run left behind, and never older ones - #307

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/411-this-seems-rare-i-ve-only-seen-it-twice
Oct 28, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/411-this-seems-rare-i-ve-only-seen-it-twice

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

fctl.sh kept old docs whenever the push that changed them failed its checks. The pin job compared docs/ with the commit before the push, so the next push, which changed no docs, skipped the pin. The job now reads the pin from fctl-site's main, in a clone that needs no key since fctl-site is public, and pins the run's commit when its docs/ differ from the pinned commit's. It never pins a commit older than the pinned one (git merge-base --is-ancestor), so a re-run of an old commit, or checks that finish after a newer push's, leave the pin alone. The new pin is committed on that same clone, so if someone else pins in between, the rebase conflicts and nothing is overwritten.

I ran the job's two steps, taken from this ci.yml, against local stand-ins for fctl and fctl-site in 15 cases, under bash -e and bash -eo pipefail: the issue's sequence, runs finishing out of order, pins of main or of unknown or abbreviated hashes, a pin on another branch, and fctl-site's main moving before the push. On the same history the old step skipped the issue's pin and re-pinned an older commit. The decision step also ran read-only against the real fctl-site, and actionlint (with shellcheck) passes. This pull request changes docs/development.md, so the first run on main after the merge should pin through the new steps.

Worth confirming

  • Decision: The job no longer needs the push's before, so it now also runs when CI is started by hand on main, as the deploy does. Session 283 needed exactly that when GitHub started no CI for feat(cli): add secrets, members, sharing, archiving and agent settings #270's merge: a hand-started run deployed app.fctl.sh but couldn't pin the docs. Starting CI on main now brings fctl.sh's docs up to date too, whereas re-running an old run would also redeploy that run's old build.
  • Decision: A fctl-docs.ref that isn't the full hash of a fctl commit (main, a tag, an abbreviated hash) is replaced with the run's commit by the next run that passes its checks. Before, only the next push that changed docs/ replaced it.

Fixes #105

fctl session

The job that pins fctl.sh to fctl's docs compared docs/ with the commit
before the push. When the push that changed them failed its checks, the
next push saw no change in docs/ and skipped the pin, so fctl.sh kept the
old docs until another push changed docs/ (v0.8.0's two-factor sign-in
and passkeys, on 2026-10-19). A run that finished after a newer one, such
as an old commit's run started again, pinned its older commit.

It now reads the pin from fctl-site's main, in a clone that needs no key
(fctl-site is public), and pins this commit when its docs/ differ from the
pinned commit's, unless the pin already has this commit
(git merge-base --is-ancestor). A pin that isn't the full hash of a commit
here, such as main, is replaced. The new pin is committed on the same
clone, so a pin someone pushes meanwhile makes the rebase conflict rather
than being overwritten. Since it no longer needs the push's before, the
job also runs when CI is started by hand on main, as the deploy does.

Refs #105
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 28, 2026 14:13
@kalaspuff
kalaspuff merged commit eb9a037 into main Oct 28, 2026
11 checks passed
@kalaspuff
kalaspuff deleted the fctl/411-this-seems-rare-i-ve-only-seen-it-twice branch October 28, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

fctl.sh keeps old docs when CI fails on the push that changed them

1 participant