Skip to content

Commit 72bc4ea

Browse files
committed
test(pm): issue-transfer's read-back pins that only a 301 is read as the move
Claude-Session: https://claude.ai/code/session_01A22sUB3mUWs6M36VgfijBq Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5d9c568 commit 72bc4ea

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎scripts/pm/issue-transfer.mjs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
383383
"the arguments: one card, a source in the organization, a target from the governed roster that is not the source — judged by the relay's own validator": 11,
384384
'the pre-read: a pull request, a card already moved, or an unreadable card is refused before any write': 5,
385385
"the direct transport: the target's node id, then ONE paced mutation carrying both node ids — the relay row's own query": 7,
386-
'the read-back: the old URL answers 301 to the new card, which answers from the target with the same title': 7,
386+
'the read-back: the old URL answers 301 to the new card, which answers from the target with the same title': 8,
387387
'the relay transport: ONE dispatch carrying ONE transfer, the new number read from the redirect, a failed run names the remedy and is never fallen back from': 8,
388388
'dry-run: no request leaves, and the plan is printed': 3,
389389
'the wiring: both halves around the one write verb, on the roster': 4,
@@ -541,7 +541,11 @@ export async function selfTest() {
541541
t('a mutation that answered while the old URL still serves the card is exit 4', [stuck.exitCode, stuck.text.includes('the card did not move')], [EXIT_BOARD_DISAGREES, true]);
542542
const b404 = board();
543543
const gone = await drive({ answers: { ...b404.answers, [`GET /repos/${SRC}/issues/7`]: (init) => (init.redirect === 'manual' ? { status: 404, json: { message: 'Not Found' } } : b404.answers[`GET /repos/${SRC}/issues/7`](init)) } });
544-
t('an old URL that answers neither 301 nor 200 is UNCONFIRMED (6), never a success', [gone.exitCode, gone.text.includes('UNCONFIRMED')], [EXIT_UNCONFIRMED, true]);
544+
t('an old URL that answers neither 301 nor 200 is UNCONFIRMED (6), never a success', [gone.exitCode, gone.text.includes('UNCONFIRMED') && gone.text.includes('not the 301 a moved card answers')], [EXIT_UNCONFIRMED, true]);
545+
// Only the PERMANENT redirect a moved card answers counts — a temporary one naming the same card is not that fact.
546+
const b307 = board();
547+
const temporary = await drive({ answers: { ...b307.answers, [`GET /repos/${SRC}/issues/7`]: (init) => (init.redirect === 'manual' && b307.state.moved ? { status: 307, json: { url: REDIRECT }, headers: { location: REDIRECT } } : b307.answers[`GET /repos/${SRC}/issues/7`](init)) } });
548+
t('⛔ a 307 naming the new card is UNCONFIRMED too — only the 301 a moved card answers is read as the move', [temporary.exitCode, temporary.text.includes('HTTP 307')], [EXIT_UNCONFIRMED, true], temporary.text);
545549
const bo = board();
546550
bo.answers['POST /graphql'] = () => {
547551
bo.state.moved = true;

0 commit comments

Comments
 (0)