fix(publish): don't 404 on a failed/missing GitHub issue — label streams at creation (#2397) - #2398
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 POSTrepos/<r>/issues/<n>/labelshad no.catch(), so one bad number 404'd and aborted the stream's labeling.Fix
createIssues): each issue is created already carrying its owningstream:<id>label (a feature IS a stream —iss.streamdefaults to the slug), where the real GitHub number is in hand. Ensures thestream:<id>label up front.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.Closes #2397
🤖 Generated with Claude Code