Skip to content

fix(publish): don't 404 on a failed/missing GitHub issue — label streams at creation (#2397) - #2398

Merged
kevinthelago merged 3 commits into
developfrom
2397-github-publish
Jul 6, 2026
Merged

fix(publish): don't 404 on a failed/missing GitHub issue — label streams at creation (#2397)#2398
kevinthelago merged 3 commits into
developfrom
2397-github-publish

Conversation

@kevinthelago

Copy link
Copy Markdown
Owner

Publishing a plan's GitHub structure surfaced a 404 when a planned issue wasn't actually posted.

Root cause

applyStreamLabels (publishSteps.ts) tagged each stream's issues by their plan-time ref numbers (st.issues#12), which don't match the actual GitHub numbers created (and don't exist if a post failed) — and the label POST repos/<r>/issues/<n>/labels had no .catch(), so one bad number 404'd and aborted the stream's labeling.

Fix

  • Label at creation (createIssues): each issue is created already carrying its owning stream:<id> label (a feature IS a stream — iss.stream defaults to the slug), where the real GitHub number is in hand. Ensures the stream:<id> label up front.
  • Resilient re-sync (applyStreamLabels): per-issue .catch() — a plan-ref number that never became a real issue is skipped (counted + noted), never aborting the stream or surfacing the 404. Now a best-effort reconciliation of pre-existing issues.
  • Tests: creation-time stream label + 404-skip resilience. Typecheck clean, lint 0 errors.

Closes #2397

🤖 Generated with Claude Code

…creation (#2397)

Publishing surfaced a 404 when a planned issue wasn't actually posted. `applyStreamLabels`
tagged each stream's issues by their PLAN-TIME ref numbers (`st.issues` → `#12`), which
don't match the real GitHub numbers created (and don't exist if a post failed) — and the
label POST had no `.catch()`, so one bad number 404'd and aborted the stream.

- createIssues: tag each issue with its owning `stream:<id>` label AT CREATION (a feature IS
  a stream; `iss.stream` defaults to the slug), where the real number is in hand — ensures the
  `stream:<id>` label up front. No more number-guessing for the common path.
- applyStreamLabels: now a resilient best-effort reconciliation of PRE-EXISTING issues —
  per-issue `.catch()` skips a ref number that never became a real issue (counted + noted),
  never aborting the stream or surfacing the 404.
- Tests: creation-time stream label + the 404-skip resilience.

Closes #2397
@kevinthelago
kevinthelago merged commit ce569f6 into develop Jul 6, 2026
7 checks passed
@kevinthelago
kevinthelago deleted the 2397-github-publish branch July 6, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant