Skip to content

fix(roadmap-emit): soft-fail 400 unknown-channel like 404 unknown-slug#126

Merged
ntatschner merged 1 commit into
nextfrom
feat/roadmap-emit-soft-fail-channel
May 27, 2026
Merged

fix(roadmap-emit): soft-fail 400 unknown-channel like 404 unknown-slug#126
ntatschner merged 1 commit into
nextfrom
feat/roadmap-emit-soft-fail-channel

Conversation

@ntatschner
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a 400-with-unknown-channel soft-fail branch to scripts/roadmap-emit-event.mjs, mirroring the existing 404-soft-fail-on-unknown-slug pattern.
  • Updates the file-header docblock's exit-codes contract to reflect the new soft-fail case.
  • No test file (script has none today), but the worktree's smoke tests verified both the positive (rc soft-fail) and negative (malformed-payload still hard-fail) paths before commit.

Why

PR #125 promoted rc to a first-class ChannelName variant in both the server (ChannelName::Rc) and the client (CHANNEL_MAP['rc'] → channel:'rc'). Server + client landed simultaneously on next. But the rollout pipeline is:

  1. Merge to next → auto-alpha → tags fire → emit script POSTs to production server
  2. Production server is still on the previous live version (here: v1.8.9)
  3. Previous version doesn't know channel: 'rc' → 400 UnknownChannel → fatal → workflow fails

That broke tray-v1.8.9-rc.1 (run 26532296011): tray installer + GitHub Release published fine, but the emit step exit-1'd, which also blocked the Auto-publish roadmap changelog (Live only) job from running.

The pattern is identical to the 404-soft-fail logic shipped in PR #88: telemetry hop is best-effort, a rollout-order gap shouldn't block the release. So apply the same disposition to its mirror image.

What does NOT change

  • Live emit (channel:'live') was never broken — live has been valid for all server versions.
  • Beta + alpha emits were never broken — those channels predate any client/server skew.
  • Generic 400 errors (auth failure, malformed JSON, schema mismatch) still hard-fail; the regex /unknown.*channel/i won't match them.
  • The server-side error response format isn't changing; this is purely a client-side disposition change.

Test plan

  • Behavioral smoke test (in this worktree, not committed): 400 + "UnknownChannel: rc" body → exit 0 with [roadmap-emit] soft-fail 400 unknown-channel log line
  • Negative smoke test: 400 + "malformed payload" body → exit 1 via existing fatal path
  • node -c scripts/roadmap-emit-event.mjs (syntax check)
  • After merge: re-fire the failed rc emit via gh run rerun --job 78154339617 and confirm it now soft-fails cleanly OR succeeds (depending on whether production server has been bumped by then)

Pairs with PR #125 (rc as first-class channel). Should land on the same alpha → beta → rc → live cycle that #125 went through.

When PR #125 introduced `rc` as a first-class ChannelName variant and
updated CHANNEL_MAP to route rc → channel:'rc', the tray-v1.8.9-rc.1
release tag fired the emit script against a production server still
running v1.8.9 (pre-#125), which rejected `channel: 'rc'` with
400 "UnknownChannel: rc". The non-retryable-4xx fatal path then
exit-1'd, blocking the release workflow.

Mirror the existing 404-on-unknown-slug pattern: if the server
returns 400 AND the response text matches /unknown.*channel/i, treat
as a soft failure and exit 0. Same root cause class as 404 (config /
rollout-order chicken-and-egg between client + server); same
disposition (the release artifacts are fine, telemetry is optional,
unblock the workflow).

The regex is deliberately narrow — only matches "unknown" adjacent to
"channel" in the body — so other 400s (auth, bad payload, schema
mismatch) still hard-fail per existing behaviour.

Behavioral tests in this branch's worktree confirmed both paths:
- 400 + "UnknownChannel: rc" body → soft-fail, exit 0
- 400 + "malformed payload" body  → hard-fail, exit 1

Surfaced on tray-v1.8.9-rc.1 (run 26532296011). Live emit was
unaffected because channel:'live' has been valid on the server for
all relevant versions; rc is the only channel that just gained
server-side support and not yet deployed.
@ntatschner ntatschner merged commit beaaac7 into next May 27, 2026
9 checks passed
@ntatschner ntatschner deleted the feat/roadmap-emit-soft-fail-channel branch May 27, 2026 20:41
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