Skip to content

Publish episodes to ATProto every 30 minutes instead of daily#24

Open
argyleink wants to merge 1 commit into
mainfrom
atproto-publish-cron
Open

Publish episodes to ATProto every 30 minutes instead of daily#24
argyleink wants to merge 1 commit into
mainfrom
atproto-publish-cron

Conversation

@argyleink

@argyleink argyleink commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Why

New episodes were only published to ATProto once a day: publish-episodes.yml was chained to the daily 8:00 UTC site rebuild via workflow_run, so an episode could sit up to ~24h before its site.standard.document record was created (e.g., the June 19 episode dropped at 19:08 UTC and wasn't published until the next morning's run).

What

  • Give the publish workflow its own schedule trigger (every 30 minutes) and drop the workflow_run coupling to the rebuild. The publish script reads the RSS feed directly and dedupes against existing document records, so it never depended on the rebuild — polling it frequently is safe and idempotent.
  • Remove the now-unneeded if condition that gated on the rebuild's conclusion.

Worst-case latency drops from ~24h to ~30 min (plus GitHub's scheduling jitter). A no-op run takes ~30s of Actions time.

Alternatives considered

  • WebSub (push) — the Flightcast feed declares no rel="hub" link, so there's no hub to subscribe to.
  • Flightcast publish webhook → repository_dispatch — would be true zero-latency if Flightcast offers one; can be layered on top of this later without conflict.
  • Vercel cron + API route — duplicates secrets into Vercel and ports the script into a function for no latency benefit over Actions.

The daily rebuild.yml is untouched — it still handles site content freshness.

Summary by CodeRabbit

  • Chores
    • Episode publishing now runs automatically on a regular schedule and can also be started manually.
    • Publishing checks still run before any release goes out, helping ensure only properly configured runs continue.

The publish workflow previously ran only after the daily site rebuild
(workflow_run on Rebuild Astro Site), so a new episode could wait up to
24 hours before its standard.site document was created. The publish
script reads the RSS feed directly and is idempotent, so it never needed
the rebuild — give it its own 30-minute schedule and drop the coupling.
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
www-starpod Building Building Preview, Comment Jul 2, 2026 5:07am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The publish-episodes GitHub Actions workflow is modified to trigger on a 30-minute cron schedule and manual dispatch instead of after the Rebuild Astro Site workflow completes. The job-level conditional gating the check job on the prior workflow's success is removed.

Changes

Workflow Trigger Update

Layer / File(s) Summary
Trigger and job gating changes
.github/workflows/publish-episodes.yml
Replaces workflow_run trigger with cron schedule and manual dispatch, and removes the job-level conditional on the check job while retaining the configured-output gating for the publish job.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: episode publishing now runs every 30 minutes instead of on a daily workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch atproto-publish-cron

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/publish-episodes.yml (1)

15-17: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Consider a concurrency guard for overlapping runs.

With no workflow_run gating and a 30-minute cron, overlapping executions are possible if a run runs long (e.g., pnpm install slowness or ATProto API hiccups). The publish script's list-then-publish sequence (fetch existing paths, then create records) is not atomic, so two concurrent runs could both miss each other's in-flight writes and attempt duplicate publishes — the script already tolerates "already exists" errors gracefully, so this is low-risk, but adding a concurrency group would avoid wasted runner time and redundant API calls.

♻️ Optional: add concurrency group
 on:
   schedule:
     - cron: "*/30 * * * *"
+
+concurrency:
+  group: publish-episodes
+  cancel-in-progress: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish-episodes.yml around lines 15 - 17, Add a
concurrency guard to the publish-episodes workflow so overlapping cron runs
cannot execute at the same time. Update the workflow definition in
publish-episodes.yml to use a concurrency group for this job/workflow, since the
existing list-then-publish flow in the publish script is not atomic and can
cause duplicate API work when runs overlap. Keep the existing "already exists"
tolerance, and use a stable identifier tied to the workflow name so only one run
proceeds at once.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/publish-episodes.yml:
- Around line 15-17: Add a concurrency guard to the publish-episodes workflow so
overlapping cron runs cannot execute at the same time. Update the workflow
definition in publish-episodes.yml to use a concurrency group for this
job/workflow, since the existing list-then-publish flow in the publish script is
not atomic and can cause duplicate API work when runs overlap. Keep the existing
"already exists" tolerance, and use a stable identifier tied to the workflow
name so only one run proceeds at once.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5733e8ba-fa95-4b42-ae4f-bdd2a836bc13

📥 Commits

Reviewing files that changed from the base of the PR and between 771ebeb and 09cf1b9.

📒 Files selected for processing (1)
  • .github/workflows/publish-episodes.yml

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