Repository navigation
chore(seeds): retire the one-off wm-web-locales seed - #1220
Conversation
The website's nine non-English locales of wm-web-translations were loaded into production on 2026-11-19 and are edited in the admin from now on. A re-run of the script would overwrite an editor's wording, so the script, its nine data files, its registrations (CLI, seed route, counts, data-file registry) and its two specs go. TranslationGlobalsImporter stays: `translations` still runs the atlas global's ten locales through it, and its unit spec now probes atlas files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1220 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The retirement itself is complete. Nothing on the branch still names the script, its symbols or its nine data files, and the route closes without a second list: VALID_SCRIPTS is derived from EXPECTED_COUNTS (route.ts:47), so dropping the entry is what refuses the request. Nothing depends on those locales staying seeded — no seed writes wm-web-config.availableLocales, so a fresh database is English-only by design, which the docs now say. The diff carries nothing the retirement does not force.
One shape question is left behind: the deletion makes TranslationGlobalsImporter a 161-line abstract base with a single subclass, and rewrites away the comment that said why it was separate.
Findings
- should-fix — one subclass left for a shared base →
seeds/lib/TranslationGlobalsImporter.ts:5 - should-fix — the body skips
## Change outlineand## Preview. The diff touchessrc/app/(payload)/, afixture.surfacePathsentry, soNo preview surfaceis not open to it either. (No thread: the body has no line to anchor.) - consider — a
###section for a script that is gone →seeds/AGENTS.md:159
What was checked
- Read whole on the branch:
TranslationGlobalsImporter.ts,dataFiles.ts,run.ts, the seed route,seeds/translations/import.ts, bothAGENTS.md, the four touched specs. git grepforwm-web-locales|WmWebLocales|WM_WEB_TRANSLATION_LOCALES|wmWebTranslationsDataFile|WmWebTranslationLocale: one hit, the deliberate #1213 breadcrumb.- Ladder: the diff adds no file, type, constant or dependency.
- Coverage:
tests/COVERAGE.mdlisted neither deleted spec, so no row goes stale. The publish-before-widening order the deleted integration spec asserted stays covered byavailable-locales(COVERAGE.md:55).
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
#1213 split `seedLocaleFiles` and `writeGlobal` out because two scripts shared the loop. Retiring `wm-web-locales` leaves one caller, so the abstract class, its barrel export and its own file served `translations` alone. Testability was the base's other claim. It does not need a class of its own for that: the spec's `ProbeImporter` extends `TranslationsImporter` instead and still boots no Payload, which is what makes the missing-instance case reachable. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY9rbp8raZqKHwTkGp
A `###` heading inside "Available scripts" reads as a script, and `wm-web-locales` is gone. The `wm-app-translations` retirement (#1169) is a `⚠` paragraph in the `translations` section; this one now matches. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY9rbp8raZqKHwTkGp
|
All three critic findings adopted. The branch was already level with
Lean gate green. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is
The merge queue failed on b3299ff while this PR's own CI was green: `tests/unit/wm-web-translations-locales-seed.spec.ts` required each of the nine non-English wm-web seed files to hold every English key, and this branch adds `common.a11y.menu` to English alone. #1220 retired that seed, its nine data files and that spec, so the queue's base no longer carries the assertion. Nothing here changes to satisfy it — the branch only needed the base it lands on. The merge itself is clean. #1220 also folded the importer base class into `TranslationsImporter`; nothing this branch touches calls it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY74fyRCakbkCvN2uS
#1220 retired the `wm-web-locales` seed on main: its script, its nine non-English data files and its two specs are gone, because the locales were loaded into production on 2026-11-19 and are edited in the admin from now on. This branch had added the five finder keys to all nine of those files, so the merge takes main's deletion. Restoring them would resurrect a seed whose re-run overwrites an editor's wording — the thing #1220 removed. English keeps the five keys, and `clientEnglishFallback` is what the other locales read until an editor types their own. `data.en.json`'s `_meta` keeps both sides: main's `common.a11y.menu` sentence and this branch's mood-finder one, and `schema_version` becomes post-#1223 (14 tabs, 25 leaf groups, 202 declared keys) — 197 on main plus the five here, as `translations-seed-meta.spec.ts` derives it. `src/migrations/index.ts` keeps both migrations, in timestamp order. They write disjoint jsonb columns — `common_a11y` against `meditation_general` and `meditation_a11y` — so neither sees the other. Both snapshots are byte-identical to the one they re-stamp, so the chain's newest-by-timestamp is still this branch's and drifts from nothing. The migration's `down` comment no longer cites the Russian, Ukrainian and Czech seeds for `_few`/`_many`: those files are gone, and the admin's grouped plural row is what writes them now. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX4YpovnqWe4qFsoXk
Summary
wm-web-localespublished the nine non-English wm-web locales on production, 2026-11-19.TranslationGlobalsImportergoes too: feat(seeds): draft the website's wording in nine more languages #1213 split it out for two callers, and this leaves one.Change outline
Files — one script retired, and the base it shared
The deletion is the change.
seeds/lib/keeps only what more than one importer reaches.Contract — what
pnpm seedand the seed route acceptVALID_SCRIPTSis derived fromEXPECTED_COUNTS(route.ts:47), so dropping the entry is what closes the route. There is no second list to keep in step.Behaviour — the per-locale loop is unchanged
It moved file; nothing about it changed. Both failures it tells apart are still asserted, now from
tests/unit/translations-seed-locale-files.spec.ts.TranslationsImporter.seedLocaleFiles({ slug, locales, dataFile, prepare }) per locale: load data.<locale>.json _meta.locale ≠ the slot → addError, next locale prepare(data, locale) # the atlas seed's two live groups writeGlobal(…, publish: true) updateGlobal throw → already reported, next locale no Payload instance → re-throw # fails every locale, reported nowhere elsePreview
The diff touches no collection or admin view, so no fixture record shows it. The seed route is the surface that changed:
/api/seed/wm-web-locales—400 Invalid script, listing the two scripts that remain. The name check runs before auth, so this needs no sign-in./api/seed/translations— still answers its metadata, so the derived allowed set is intact. Sign in at/admin/loginfirst; it is admin-only.Test results
seeds/tests/atlas-translations-import.test.ts(9) andtests/int/wm-web-translations-seed.int.spec.ts(7), the two that drive the moved loop against a database.Notes for reviewer
seedLocaleFilesandwriteGlobalare kept whole, as methods ofTranslationsImporter: the atlas global's ten locales still run through them,_meta.localecheck included.seeds/wm-web-translations/data.en.jsonis kept too, sincetranslationsstill seeds it.wm-web-localescase fromsrc/app/(payload)/api/seed/[script]/route.tstouches a security-review path. It only takes a script name out of the allowed set; the route's auth is unchanged.videotab) touches onlydata.en.jsonamong the seed files, so the two PRs do not overlap.seeds/AGENTS.mdkeeps the nine locales' story as a⚠paragraph in thetranslationssection, beside thewm-app-translationsretirement (chore(seeds): retire the one-shot importers and the atlas sync #1169), rather than a###heading for a script that is gone.Detail
The production run: 117 sections, 0 errors, and each of the nine locales read back afterwards as published with its own wording.
Why the base class went rather than staying for a future caller: its header claimed testability as the reason to keep it apart, and the spec's
ProbeImportergets that by extendingTranslationsImporterinstead — still no Payload bootstrap, which is what makes the missing-instance case reachable at all. No open ticket plans a fourth translation global or a second script that writes one.🤖 Generated with Claude Code