searchable codemod: add republish tool#5368
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 510138ffb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds follow-up tooling for the deployed-realm “searchable” migration: a republish driver to refresh published snapshots, and enhanced tolerance/reporting when realm pull returns non-zero due to stray forbidden objects.
Changes:
- Added
republish.mjsto republish each (source → published) pair and verifysearchableannotations landed by reading back a known module. - Updated
apply-deployed.tsto continue crawling whenrealm pullexits non-zero but the pulled realm still containsrealm.json, recording apullWarningin the output report.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/realm-server/scripts/codemod/searchable/republish.mjs | New script to republish published realm copies from their sources and assert searchable annotations appear post-indexing. |
| packages/realm-server/scripts/codemod/searchable/apply-deployed.ts | Makes deployed crawl “pull-tolerant” by proceeding on partial pulls (when realm.json exists) and surfacing a pullWarning in the report/output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
510138f to
ec2b385
Compare
republish.mjs republishes each published realm copy from its source
realm so the published snapshot picks up the source's searchable
annotations, then reads a known module back from the published realm to
assert the annotation landed. The env argument is checked against a
staging|prod allow-list before it is interpolated into the bash command
that sources the seed file. The run exits nonzero on a real failure or a
missing-searchable assertion, while a realm the server refuses to publish
("not publishable") is recorded as an expected skip and does not fail it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182qehwDYbwBmyYcAhMoij1
ec2b385 to
0c41b87
Compare
Adds
republish.mjs, the publish-side tool for thesearchablemigration: it republishes each published realm copy from its (now-annotated) source realm so the published snapshot picks up the source'ssearchableannotations, then reads a known module back from the published realm to assert the annotation landed.realm publishwaits for the published realm to finish indexing before that read.Args:
<pairs.json> <staging|prod> <out.jsonl> [--limit N].envargument is allow-listed tostaging|prodbefore it is interpolated into that shell command.searchableassertion, while a realm the server refuses to publish ("not publishable") is recorded as an expected skip and does not fail the run.