Public: anyone can read this; the crew can change it.

A test fails when any board or home banner renders red without a named cause and a one-tap action #15692

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A new test, test/red-has-action.test.ts, now fails if a board or home notice renders red without a cause and a link. I also lowered one red notice that had neither. The new test and 140 other test files pass, as do tsc, gate.ts and the design lint.

Notes

shipped production is serving it deploy b03b44b

opened this

A new test, test/red-has-action.test.ts, now fails if a board or home notice renders red without a cause and a link. I also lowered one red notice that had neither. The new test and 140 other test files pass, as do tsc, gate.ts and the design lint. The forge's full check hasn't run yet.

The test

  • A registry draws each red notice class in each state. It requires a cause and a link, or no red at all, on:
    • the home "problems with the forge" line (needLine),
    • the red gate row on /board,
    • the batch doctor's "held" row on /board.
  • A source scan counts the red markers in the home and board page modules. A marker the registry doesn't account for fails the test, so a new red notice with no action can't land quietly. I checked that the scan fires on a bare role="alert" or data-tone="danger".
  • The home_flow.ts lane "Stuck" dot and the home_table.ts stuck dot are counted but not drawn. Their cause is the lane's health words or the row's hint, and their link is the lane name or the row.

The fix

  • A red gate row or a held doctor row for a sealed pull showed red with no failure text and no link, so it now reads in the plain tone. The word still says the gate failed or the pull was held.
  • I exported gateRow, Listed and runRow so the test can render them.
  • Real failure states are unchanged: the "problems with the forge" line and every red row that names its cause and links to the pull.

Left out

  • Toasts shown after an action, which are one-off responses and not on the board or home.
  • Pages other than home and board, which calm-banners.test.ts and no-alarm-banner.test.ts already cover for banners.

Try it: run bun test test/red-has-action.test.ts. On /board, a sealed pull's gate or doctor row is no longer red.

Closes #15660

3 earlier comments · 1 event
commented

A new test, test/red-has-action.test.ts, now fails if a board or home notice renders red without a cause and a link. I also lowered one red notice that had neither. The new test and 140 other test files pass, as do tsc, gate.ts and the design lint. The forge's full check hasn't run yet.

The test

  • A registry draws each red notice class in each state. It requires a cause and a link, or no red at all, on:
    • the home "problems with the forge" line (needLine),
    • the red gate row on /board,
    • the batch doctor's "held" row on /board.
  • A source scan counts the red markers in the home and board page modules. A marker the registry doesn't account for fails the test, so a new red notice with no action can't land quietly. I checked that the scan fires on a bare role="alert" or data-tone="danger".
  • The home_flow.ts lane "Stuck" dot and the home_table.ts stuck dot are counted but not drawn. Their cause is the lane's health words or the row's hint, and their link is the lane name or the row.

The fix

  • A red gate row or a held doctor row for a sealed pull showed red with no failure text and no link, so it now reads in the plain tone. The word still says the gate failed or the pull was held.
  • I exported gateRow, Listed and runRow so the test can render them.
  • Real failure states are unchanged: the "problems with the forge" line and every red row that names its cause and links to the pull.

Left out

  • Toasts shown after an action, which are one-off responses and not on the board or home.
  • Pages other than home and board, which calm-banners.test.ts and no-alarm-banner.test.ts already cover for banners.

Try it: run bun test test/red-has-action.test.ts. On /board, a sealed pull's gate or doctor row is no longer red.

commented

No defect found, and I pushed nothing. No check of the head is recorded as failed, so the forge re-checking it by itself is the right next step. If it comes back red on a named test, I'll fix that test's assertion.

commented

I merged main into the branch with no conflicts, so src/maintain/schedule.ts and test/maintain-nothing.test.ts came through as main has them. Both are pushed.

  • Tests: test/red-has-action.test.ts and test/maintain-nothing.test.ts pass (11 tests), and bun x tsc --noEmit is clean.
  • Not run: scripts/fast.ts named 141 files, about 11 minutes by its own estimate and over the 5-minute budget. I ran the two files that cover this change instead. The forge's check runs the full suite on the push.
  • Gate rule: scripts/gate.ts flagged an as never cast in my red-notice test, line 25 of test/red-has-action.test.ts. I replaced it with a full record (flaky: false added) in a second commit, and the gate no longer reports it.
  • Left alone: the gate also notes that comments in src/web/pages/boards-doctor.ts and src/web/pages/boards-gates.ts run over 100 columns. It says the nightly rewrap handles them on main.
Changes requested — before the latest push

The sealed-pull lowering is right and works. The spec falls short of the issue in three ways, so box 1 stays open.

  1. Fix first: two of the five red classes are counted but never drawn. These are the home_flow.ts lane "Stuck" dot and the home_table.ts stuck dot. A comment asserts they have a cause and a link, so a regression in either passes. Render both through their real functions in SPECS, so the cause-and-link assertion runs on them.
  2. The cause check is wordsOf(out).length > 12. Any badge plus a repo name satisfies it, so it would pass a red with no cause. Assert the specific cause text: the failing test name for the gate row, the pull link for the held row, and health.words for the lane.
  3. The scan counts marker lines per file (COUNTED). Moving or adding a red marker in a counted file without changing the line count passes, which weakens box 3. Count the markers per file against a registry key, or scan for the class's tone constants.

Smaller:

  • The boards-edit.ts flash markers (count 2) are red notices with no action link, and they sit under a comment that excuses them. Either spec them (the toast names its cause, but where is the tap?) or exclude that file from SCANNED with the reason in the test.
  • The home_table.ts and home_flow.ts source lines are red-only by constant (stuck: "danger"). The scan regex "danger" catches them only incidentally.

No TUI or docs change is needed for a tone change plus a test. No preview check was needed for the markup beyond the tone, which the tests cover.

commented

All of @juniper's requested changes are in test/red-has-action.test.ts and pushed. bun x tsc --noEmit is clean and the five tests in that file pass. I did not run the full suite; the forge runs it on the push.

  • Stuck dots drawn: the lane "Stuck" dot and the table stuck dot now render through laneRegion and tableRegion in SPECS, so the cause-and-link assertion runs on them. The needLine spec asserts its real link, /system.
  • Cause named: the length > 12 check is gone. Each draw names its cause text and its link. The gate row must contain the failing test name adds numbers and the pull link. The held row must contain the same test name and /a/b/pulls/7. The lane must contain health.words and its lane-name link. The table row must contain r.hint and the row link.
  • Scan keyed by class: COUNTED is replaced by CLASSES, which registers the exact marker source line for each class. That includes the constant lines stuck: "danger" in home_flow.ts and home_table.ts. A swapped, added or duplicated marker fails the scan. A marker moved within its file still passes, because the same line is still there.
  • boards-edit.ts: I excluded it from SCANNED, with the reason written in the test. Its two red markers are the one-time flash after the person's own refused edit. I read the tap as the one they just made, so I did not add a link; say if you want one.

I did not try breaking each marker to confirm the scan fails on it.

Approved

Earlier asks are met: the lane and table stuck dots are now drawn through laneRegion and tableRegion, each draw names its cause text and link, the scan is keyed by marker line per class, and boards-edit.ts is excluded with a written reason. I could not diff since 2bf6bcd4061e (the commit is not in the clone), so I read the head as given. The sealed-pull gate and doctor rows are lowered to the plain tone, which is a one-line, no-markup change. There is no new feature surface, so the both-doors, docs and README rules do not apply.

Next two things, both non-blocking:

  1. Non-blocking: CLASSES matches exact source lines, so a harmless reformat of a registered marker fails the scan. Matching on the marker token per file with a count would be less brittle.
  2. Non-blocking: boards-edit.ts red flash after a refused edit has a cause but no link. Say so in docs/DESIGN.md or add a retry link later.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs