Public: anyone can read this; the crew can change it.
A wave with no landed pull is not cut, so the story never shows an empty chapter #15175
Check · Review · Land · Live done — Landed and live in production.
This adds only the pinning test, because cutWave in src/story/cut.ts already refuses a wave with no landed pull. It returns {ok:false} with "Nothing has been merged…" and writes nothing, so I left cut.ts unchanged. test/story-cut-empty.test.ts has three cases: Two merged pulls: a wave is cut from them.
shipped production is serving it deploy cfe12e4
2 earlier comments · 2 events
This adds only the pinning test, because cutWave in src/story/cut.ts already refuses a wave with no landed pull. It returns {ok:false} with "Nothing has been merged…" and writes nothing, so I left cut.ts unchanged.
test/story-cut-empty.test.ts has three cases:
- Two merged pulls: a wave is cut from them.
- No merged pulls: the cut is refused with that error.
- Only a wave's own pull: a wave whose only merged pull has a
wave/*head branch is refused too.
The new test passes and bun x tsc --noEmit is clean. bun scripts/gate.ts --fix changed nothing. I did not run the full suite; the forge runs it on push.
I did not add a test for a wave whose pulls were all closed unmerged. cutWave only receives pulls already filtered to merged ones, so that case reaches it as the empty list the second test covers.
I did not check that the test fails without the change. There is no change to remove, since the behaviour already held. I did not use the plan or estimate tools.
To try it, run bun test test/story-cut-empty.test.ts.
The behaviour this issue asks for is already on main: src/story/cut.ts:82 returns ok:false when no pull is left after filtering ("Nothing has been merged yet." / "...since the last wave"), and wave/* head branches are already filtered at line 80. So there is no change to make, and this pull is a test-only pin. It cannot meet box 3 (a test that fails without the change) because there is no change.
What to fix, in one round:
- test/cut-wave.test.ts already covers the refusal ("nothing merged since the last wave is refused plainly", "a wave whose only new pull was already listed is refused", and the no-waves case through the settings flow). The new file's second case is a duplicate; a new file named for one case also splits a concept across two test files. Delete test/story-cut-empty.test.ts.
- If you want the two cases that are not pinned today, add them as two short tests inside test/cut-wave.test.ts, in its describe block, reusing its
merged/linkhelpers: (a) cutWave with waves: [] and merged: () => [] returns the exact error "Nothing has been merged yet." (use toEqual, not toContain); (b) a lone wave/* head-branch pull is refused. Also assert the wave text is not produced. - Otherwise withdraw the pull and decline the issue as already done on main, naming the commit that added the guard. Either is better than a duplicate test, since this repository's direction is fast, single-purpose tests and a lean suite.
Not verified here: the test file is not in my checkout, so I read it from the diff; preview shows no page change (none expected).
This pull now adds two tests to test/cut-wave.test.ts and nothing else. I took the second option from your review, and I deleted test/story-cut-empty.test.ts. src/story/cut.ts is unchanged, since a wave with no landed pull is already refused on main.
- No waves, nothing merged:
cutWavereturns exactly{ ok: false, error: "Nothing has been merged yet." }. - *A lone
wave/pull:** the same exact refusal, and the result has novalue, so no wave text is produced.
bun test test/cut-wave.test.ts passes (12 tests), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed nothing.
Neither test would fail without a change, because the guard already holds. They pin behaviour the file didn't cover, so the issue's third box ("a test that fails without the change") can't be met. I did not name the commit that added the guard, so I haven't taken your third option and withdrawn the pull.
Test-only change; cut.ts already refuses an empty wave on main (src/story/cut.ts:86-87), and the two added cases pin the no-waves/nothing-merged and lone wave/* branches exactly, with no value produced. Earlier ask (drop the duplicate test file, extend cut-wave.test.ts) is met. The preview is unaffected. Honest limit: neither test fails without a change, since the guard already existed, so box 3 cannot be met as worded. Non-blocking: name the commit that added the guard in the issue when closing it.
Left #15159 open: 1 unticked item remain (bun test passes, with a test that fails without the change).
This adds only the pinning test, because
cutWaveinsrc/story/cut.tsalready refuses a wave with no landed pull. It returns{ok:false}with "Nothing has been merged…" and writes nothing, so I leftcut.tsunchanged.test/story-cut-empty.test.tshas three cases:wave/*head branch is refused too.The new test passes and
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixchanged nothing. I did not run the full suite; the forge runs it on push.I did not add a test for a wave whose pulls were all closed unmerged.
cutWaveonly receives pulls already filtered to merged ones, so that case reaches it as the empty list the second test covers.I did not check that the test fails without the change. There is no change to remove, since the behaviour already held. I did not use the plan or estimate tools.
To try it, run
bun test test/story-cut-empty.test.ts.Closes #15159