Skip to content

Commit bf04b6d

Browse files
ci(docs): pin the Pages actions back to the pair that works (#23)
* ci(docs): pin the Pages actions back to the pair that works deploy-pages@v5 aborts this repo's deploy with "Timeout reached" after about a minute of polling — twice in a row, including a clean re-run. The artifact uploads fine and Build MkDocs passes; only the deploy step fails, and the published site is therefore stuck on the previous commit's build. The same workflow on upload-pages-artifact@v3 + deploy-pages@v4 succeeded on a217c63, the commit immediately before the bump, and CI and the vulnerability scan were green on the bumped commit too. The action pair is the variable. Only these two are reverted. The rest of the Actions sweep stays: checkout 7, setup-go 7, setup-node 7, setup-python 7 and action-gh-release 3 are all in use and green — the last is only a Node 20→24 runtime move with no input changes, which matters because it is the step that publishes releases. * test(cli): remove a start-then-configure race in the hotkey test StartInputPump launches its read loop immediately; SetHotkeys installs the filter afterwards. With the input already buffered in a strings.Reader, the pump can read and classify 'y' before the filter lands, and the test then sees a plain rune event where it asserted a hotkey: --- FAIL: TestInputPumpHotkeyFilter keys_test.go:177: got {Kind:1 Line: Key:y} The race is in the test's setup, not in the pump — the filter is mutex-guarded either way. A pipe written only after SetHotkeys returns makes the ordering the test means to assert the one it actually gets. Passes 40 consecutive -race runs. Surfaced on a loaded CI runner while merging the dependency backlog; unrelated to those bumps, and it would have kept flaking the release gate.
1 parent ff347b2 commit bf04b6d

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jobs:
5656

5757
- name: Upload Pages artifact
5858
if: github.event_name != 'pull_request'
59-
uses: actions/upload-pages-artifact@v5
59+
# Pinned to the v3+v4 PAIR on purpose — see the deploy step below.
60+
uses: actions/upload-pages-artifact@v3
6061
with:
6162
path: site
6263

@@ -71,4 +72,14 @@ jobs:
7172
steps:
7273
- name: Deploy to GitHub Pages
7374
id: deployment
74-
uses: actions/deploy-pages@v5
75+
# v4, NOT v5. The bump to upload-pages-artifact@v5 + deploy-pages@v5 in
76+
# ff347b2 broke this deploy twice in a row: the artifact uploads and
77+
# "Build MkDocs" passes, then v5 polls the Pages API, sees
78+
# `updating_pages` for about a minute, reads one empty status and aborts
79+
# with "Timeout reached". The same commit's CI and Vulnerability scan
80+
# were green, and the identical workflow on v3+v4 succeeded on the
81+
# commit immediately before (a217c63), so the pair is the variable.
82+
#
83+
# Re-open the bump when v5 has a fix; nothing else about the Actions
84+
# sweep is reverted.
85+
uses: actions/deploy-pages@v4

‎pkg/cli/keys_test.go‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,27 @@ func TestInputPumpEscapeAndInterrupt(t *testing.T) {
167167

168168
func TestInputPumpHotkeyFilter(t *testing.T) {
169169
ed := NewLineEditor(nil)
170-
p := StartInputPump(strings.NewReader("y"), ed)
170+
171+
// A PIPE, not strings.NewReader: StartInputPump launches its read loop
172+
// immediately, and SetHotkeys installs the filter afterwards. With input
173+
// already buffered, the pump can read and classify 'y' before the filter
174+
// lands, and the test then sees a plain rune event instead of a hotkey.
175+
// That is a race in the TEST's setup, not in the pump — the filter itself
176+
// is mutex-guarded — and it failed exactly this way on a loaded CI runner:
177+
//
178+
// --- FAIL: TestInputPumpHotkeyFilter
179+
// keys_test.go:177: got {Kind:1 Line: Key:y}
180+
//
181+
// Writing only after SetHotkeys returns makes the ordering the test means
182+
// to assert the one it actually gets.
183+
pr, pw := io.Pipe()
184+
p := StartInputPump(pr, ed)
171185
defer p.Stop()
172186
p.SetHotkeys(func(k Key) bool { return k.Type == KeyRune && k.Rune == 'y' })
187+
go func() {
188+
_, _ = pw.Write([]byte("y"))
189+
_ = pw.Close()
190+
}()
173191

174192
select {
175193
case ev := <-p.Events():

0 commit comments

Comments
 (0)