Skip to content

Fix ATProto publish crash; rename script; rebuild once per feed change - #58

Merged
RobbieTheWagner merged 3 commits into
mainfrom
fix-feed-schema-brittleness
Aug 24, 2026
Merged

RobbieTheWagner merged 3 commits into
mainfrom
fix-feed-schema-brittleness

Conversation

@RobbieTheWagner

@RobbieTheWagner RobbieTheWagner commented Aug 24, 2026

Copy link
Copy Markdown
Member

Why

  1. Every Publish Episodes to ATProto run was failing with ValiError: Invalid key: Expected "type" — Flightcast now emits a second, typeless enclosure (the episode cover image; 129 items in the live feed), and the script's feed schema required type on every enclosure.
  2. That crash loop was also causing a Vercel build every ~30 minutes: the feed hash is only persisted after a successful publish, so every poll saw "changed", fired the rebuild webhook, then crashed — repeat.

What

  • Fix: trim the publish script's schema to only the fields it actually reads (title, published, description, content_encoded, itunes_episodeType). Episode pages get their full data from src/lib/rss.ts (which already tolerated the typeless enclosure); this script only publishes standard.site pointer documents, so irrelevant feed-host changes can no longer break it. Verified against the live feed.
  • Hardening: the gate now records which feed content it already triggered a rebuild for (separate cache from the publish-success hash). A persistently failing publish keeps retrying each poll but fires at most one Vercel build per distinct feed content; the publish script still waits on the pages from that one build.
  • Rename: scripts/publish-episodes.tsscripts/publish-atproto-episodes.ts (pnpm scripts publish:atproto / publish:atproto:backfill), since the script is ATProto-only — pages come from the Astro build.

🤖 Generated with Claude Code

Flightcast now emits a second enclosure per episode (the cover image)
with no type attribute, which the copied-from-rss.ts schema required —
so every publish run died in FeedSchema parse. Trim the schema to the
fields the script reads (title, published, description, content_encoded,
itunes_episodeType) so irrelevant feed changes can't break publishing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
starpod Ready Ready Preview Aug 24, 2026 2:51pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 47 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9dc75de-a734-4875-9acd-61337797e661

📥 Commits

Reviewing files that changed from the base of the PR and between e0b155a and 0cb103e.

📒 Files selected for processing (5)
  • .github/workflows/backfill-episodes.yml
  • .github/workflows/publish-episodes.yml
  • README.md
  • package.json
  • scripts/publish-atproto-episodes.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 126b128e-0f90-49ad-89d9-f07fb9be1212

📥 Commits

Reviewing files that changed from the base of the PR and between 27a9038 and e0b155a.

📒 Files selected for processing (1)
  • scripts/publish-episodes.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The RSS feed schema now validates only fields consumed by the episode publishing script. Unused metadata fields and enclosure validation were removed. Fetching, filtering, publishing, pagination, rebuild waits, and error handling remain unchanged.

Changes

RSS feed validation

Layer / File(s) Summary
Narrow feed item validation
scripts/publish-episodes.ts
FeedSchema now validates title, published, description, optional content_encoded, and optional itunes_episodeType. Validation for unused identifiers, duration, image, episode, and enclosure fields was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e0b15

The publish script now validates only the feed fields it uses, preventing unrelated enclosure metadata from stopping publishing; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the crash fix, which matches the main objective, although it also mentions unsupported script renaming and rebuild changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-feed-schema-brittleness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…eed change

The script only publishes standard.site documents to ATProto — episode
pages come from the Astro build — so name it accordingly (pnpm scripts
are now publish:atproto / publish:atproto:backfill).

The gate also now records which feed content it already triggered a
Vercel rebuild for, separately from the publish-success hash. A
persistently failing publish (like the recent FeedSchema crash) keeps
retrying every poll but no longer fires a fresh build each time; the
publish script still waits on the pages from the one build it did
trigger.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RobbieTheWagner RobbieTheWagner changed the title Only validate feed fields the publish script uses Fix ATProto publish crash; rename script; rebuild once per feed change Aug 24, 2026
An in-progress workspace import path ('starpod/src/utils/dasherize')
was accidentally captured during the rename; main still has src/ at the
repo root, so astro check failed with ts(2307).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RobbieTheWagner
RobbieTheWagner merged commit dd04343 into main Aug 24, 2026
5 of 6 checks passed
@RobbieTheWagner
RobbieTheWagner deleted the fix-feed-schema-brittleness branch August 24, 2026 14:50
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