Skip to content

fix(standard.site): publish episode docs with publication AT-URI#23

Merged
argyleink merged 2 commits into
mainfrom
fix/standard-site-publication-link
Jun 16, 2026
Merged

fix(standard.site): publish episode docs with publication AT-URI#23
argyleink merged 2 commits into
mainfrom
fix/standard-site-publication-link

Conversation

@argyleink

@argyleink argyleink commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Bluesky shows the publication-promoted card by resolving a site.standard.document record's site field → the publication record. Episodes were published with site: "https://whiskey.fm" (a bare URL), so the publication ref was never attached and shared links showed no publication status.

This makes publish-episodes.ts write the publication AT-URI as site so newly-published episodes carry the publication association (the page URL still reconstructs as publication.url + path).

The existing 247 records were already migrated in place out-of-band and verified via cardyb /v1/extract (episode URLs now return both site.standard.document and site.standard.publication refs). This PR only prevents future episodes from regressing.

@vercel

vercel Bot commented Jun 16, 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 Jun 16, 2026 4:18pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

publish-episodes.ts is updated to set the site field on published episode documents to a publication AT-URI (derived from getPublicationAtUri) instead of the plain site URL. A new migration script, fix-document-sites.ts, iterates all existing site.standard.document records and rewrites any whose site field does not already match the target AT-URI, with --dry-run support. A corresponding publish:fix-sites npm script is registered.

Changes

AT-URI site field and backfill migration

Layer / File(s) Summary
Use publication AT-URI as document site field
scripts/publish-episodes.ts
Adds getPublicationAtUri import, computes publicationUri from the publisher DID and STANDARD_SITE_PUBLICATION_RKEY, and passes it as site in PublishDocumentInput in place of siteUrl.
Backfill migration script
scripts/fix-document-sites.ts, package.json
New script authenticates via env vars, computes the target publication AT-URI, paginates all site.standard.document records, and rewrites the site field on any record not already correct. Supports --dry-run. Registered as publish:fix-sites in package.json.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hoppity-hop through the AT-URI lane,
Old URLs are gone, the right refs remain!
A migration loop fixes each record with care,
--dry-run first, then rewrite with flair.
The rabbit ensures every site is just right,
AT-URIs gleaming, all pointing to light! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 accurately describes the main change: linking documents to publications via AT-URI, which is the core fix addressing the Bluesky publication badge issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/standard-site-publication-link

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 and usage tips.

Bluesky shows the publication-promoted card by resolving a
site.standard.document record's `site` field to the publication record.
Episodes were published with `site: https://whiskey.fm` (a bare URL), so the
publication ref was never attached and shared links showed no publication
status. Write the publication AT-URI instead; the page URL still reconstructs
as publication.url + path.

(Existing 247 records were already migrated in place out-of-band.)
@argyleink argyleink force-pushed the fix/standard-site-publication-link branch from 40bd0fb to 11da41f Compare June 16, 2026 16:21

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@scripts/publish-episodes.ts`:
- Around line 97-100: The environment guard checking for STANDARD_SITE_URL or
siteUrl is now stale since the code has been refactored to use publication
AT-URIs via getPublicationAtUri() which requires only the publisher DID and
publication rkey. Remove the conditional gating that checks for siteUrl or
STANDARD_SITE_URL in the publish logic, as siteUrl is no longer part of the
publication payload and this guard can unnecessarily skip publishing. This stale
gating occurs at multiple locations in the file (around lines 97-100 and 147),
so ensure all instances that check for siteUrl or STANDARD_SITE_URL as a
prerequisite for publishing are removed or refactored to not require this check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 149decc3-520d-4a32-892c-bfd764529374

📥 Commits

Reviewing files that changed from the base of the PR and between 846665e and 40bd0fb.

📒 Files selected for processing (3)
  • package.json
  • scripts/fix-document-sites.ts
  • scripts/publish-episodes.ts

Comment thread scripts/publish-episodes.ts
@argyleink argyleink changed the title fix(standard.site): link documents to publication via AT-URI fix(standard.site): publish episode docs with publication AT-URI Jun 16, 2026
site now uses the publication AT-URI, so STANDARD_SITE_URL is no longer
referenced; requiring it in the env guard could skip publishing
unnecessarily. (per CodeRabbit review)
@argyleink argyleink merged commit 771ebeb into main Jun 16, 2026
6 checks passed
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