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

Full suite red: test/unreached.test.ts #9309

Parked opened this in answer to
Closed without merging

test/unreached.test.ts was red because src/actions/pindemos.ts came in with #9284 and only its own test imported it. I added API routes that call it, so the app now reaches it. The new file is src/http/api/pindemos.ts, registered in src/http/api.ts next to the cart routes.

Notes

stopped parked by the crew deploy ed3a392

opened this

test/unreached.test.ts was red because src/actions/pin_demos.ts came in with #9284 and only its own test imported it. I added API routes that call it, so the app now reaches it.

The new file is src/http/api/pin_demos.ts, registered in src/http/api.ts next to the cart routes. All four routes need the rw scope and a person who can write the repository:

  • PUT /api/v1/repos/:owner/:name/builds/:label/demo saves the demo (saveDemo).
  • DELETE …/demo clears it (deleteDemo).
  • POST …/showcase with {on} puts it in or takes it out of the showcase (setShowcase).
  • POST …/capture builds the pin's page (captureBuild) and answers 202 while the capture runs.

test/pin-demos-api.test.ts covers the refusals (no token gets 401, a non-writer is refused), saving, showcase on and off, an invalid demo (422), capture on a pin that doesn't open as a file (409), and clearing (404 the second time). test/unreached.test.ts, test/pin-demos.test.ts and the new test pass, and tsc --noEmit and scripts/gate.ts are clean. I did not run the full suite; the forge runs it on the push.

I did not add a page or button on the Iterations page for any of this. The doc comments in pin_demos.ts mention a Showcased chip and a "Build and play" action, and those are a separate UI issue. I also left scripts/unreached-allow.json alone, since that list should only shrink.

To try it, create a pin, then curl -X PUT -H "authorization: Bearer $TOKEN" -d '{"name":"Karts","version":"1","page":"/","showcase":true}' $FORGE_URL/api/v1/repos/alice/karts/builds/v1/demo.

🤖 Generated with Claude Code

Closes #9306

3 earlier comments
commented

test/unreached.test.ts was red because src/actions/pin_demos.ts came in with #9284 and only its own test imported it. I added API routes that call it, so the app now reaches it.

The new file is src/http/api/pin_demos.ts, registered in src/http/api.ts next to the cart routes. All four routes need the rw scope and a person who can write the repository:

  • PUT /api/v1/repos/:owner/:name/builds/:label/demo saves the demo (saveDemo).
  • DELETE …/demo clears it (deleteDemo).
  • POST …/showcase with {on} puts it in or takes it out of the showcase (setShowcase).
  • POST …/capture builds the pin's page (captureBuild) and answers 202 while the capture runs.

test/pin-demos-api.test.ts covers the refusals (no token gets 401, a non-writer is refused), saving, showcase on and off, an invalid demo (422), capture on a pin that doesn't open as a file (409), and clearing (404 the second time). test/unreached.test.ts, test/pin-demos.test.ts and the new test pass, and tsc --noEmit and scripts/gate.ts are clean. I did not run the full suite; the forge runs it on the push.

I did not add a page or button on the Iterations page for any of this. The doc comments in pin_demos.ts mention a Showcased chip and a "Build and play" action, and those are a separate UI issue. I also left scripts/unreached-allow.json alone, since that list should only shrink.

To try it, create a pin, then curl -X PUT -H "authorization: Bearer $TOKEN" -d '{"name":"Karts","version":"1","page":"/","showcase":true}' $FORGE_URL/api/v1/repos/alice/karts/builds/v1/demo.

🤖 Generated with Claude Code

commented

test/unreached.test.ts was red because nothing under src/ imported src/actions/pin_demos.ts. This pull adds API routes in src/http/api/pin_demos.ts that call it, so the app now reaches it.

The check had failed on the gate's commit-message rules, not on code. The gate now passes locally, and I added an empty commit with the missing "Why now:" and "Try:" lines. I did not re-run the tests this round, and the forge's check on this push is what will confirm it.

The routes need an rw token and a person who can write the repository:

  • PUT /api/v1/repos/:owner/:name/builds/:label/demo saves the demo.
  • DELETE …/demo clears it.
  • POST …/showcase with {on} puts it in or takes it out of the showcase.
  • POST …/capture builds the pin's page and answers 202 while the capture runs.

test/pin-demos-api.test.ts covers the refusals, saving, showcase on and off, an invalid demo, capture on a pin that doesn't open as a file, and clearing.

I did not add any page or button for demos; that would be a separate UI issue. I also left scripts/unreached-allow.json alone, since that list should only shrink.

Try: on the preview, send PUT /api/v1/repos/<owner>/<repo>/builds/<label>/demo with an rw token and the body {"name":"Karts","version":"1","page":"/","showcase":true}.

🤖 Generated with Claude Code

commented

The two OpenAPI coverage failures are fixed and pushed. I couldn't reproduce the three shard-27 failures, so I made no change for them.

What was wrong. The new pin demo routes in src/http/api/pin_demos.ts built their paths from a lowercase base template constant. The two OpenAPI coverage tests (test/openapi-coverage.test.ts and test/openapi.test.ts) read paths with a regex and couldn't resolve that. The four routes also had no OpenAPI description.

What I changed.

  • src/http/api/pin_demos.ts now spells each path out as a literal string. Behaviour is the same.
  • I added four route descriptions under src/contract/openapi/routes/ and regenerated index.ts:
    • PUT /repos/{owner}/{name}/builds/{label}/demo
    • DELETE /repos/{owner}/{name}/builds/{label}/demo
    • POST /repos/{owner}/{name}/builds/{label}/showcase
    • POST /repos/{owner}/{name}/builds/{label}/capture

What I ran. bun test test/openapi test/pin-demos-api passes (435 tests), and bun x tsc --noEmit is clean. I did not run bun scripts/gate.ts.

The three shard-27 failures. They were "home waiting line > three asks show one line linking to /review", the MCP feed card test, and the agent-spend row test. They sit in test/home-kpi-row.test.ts, test/mcp.test.ts and test/tui-scorecard-spend.test.ts, which pass together here (88 tests). This change only touches API route registration and OpenAPI rows, so I think they are order-dependent or flaky in the shard. If they fail again on this push, the log should show what they depend on.

What I chose not to do. I left the other routes and tests alone.

To try it. bun test test/openapi test/pin-demos-api.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs