Comfy-Org / Comfy-Org/workflow_templates
preview-cron test leg has failed nightly for 2 weeks: i18n fail-closed assert runs against the preview hub shareId namespace
- Dominant language
- TypeScript
- Stars
- 901
- Forks
- 188
- Avg merge
- 23h 10m
- Merged PRs (30d)
- 86
Description
`preview-cron.yml`'s `test` matrix leg has failed **every night for two weeks** — 15 consecutive runs. The `production` leg of the same run, on the same commit, succeeds every time.
Not to be confused with `cron-rebuild-site.yml`, which is green. Both fire around the same time each night, which makes this easy to misattribute — I did exactly that at first.
## Symptom
Failing step: `6. Build Astro site`.
```
[ERROR] [build] Failed to call getStaticPaths for src/pages/[locale]/workflows/[slug].astro
[i18n] flipped locale(s) zh, zh-TW, ja, ko, es, fr, ru, tr, ar, pt-BR resolved zero indexable pages.
Their translation artifacts are missing or unreadable — fix those, or drop the locale from
INDEXABLE_LOCALES rather than serving English under its URLs.
at assertFlippedLocalesIndexable
```
## History
```
32084101402 success 2026-08-18 ec55a4e3 <- last green
32200841303 failure 2026-08-19 fb18273e <- both legs fail
32316919576 failure 2026-08-20 ... <- test fails, production green
... unbroken ...
33701174118 failure 2026-09-03 8417f4f2
```
The streak starts at `fb18273e` = **#1152 `feat(i18n): flip zh to indexable`**. #1157 repaired the production leg the next morning and left the test leg broken. #1193 added the other nine locales, which is why the message now names all ten.
## Root cause
The message is misleading: the translation artifacts are **fine**. `site/src/i18n/content/en.json` and `content/zh.json` both hold 620 shareIds, with 619 review records, fully consistent. Against the production hub index (626 entries) **all 620 are present — 100% overlap**, with 6 new workflows held for translation. That is why production is green.
The artifacts are keyed by **`shareId`**. `getStaticPaths` takes its shareId set from `listWorkflowIndex()` → `${PUBLIC_HUB_API_URL}/api/hub/workflows/index`. The only difference between the two legs is `preview-cron.yml:83-84`, which switches `PUBLIC_HUB_API_URL` between `HUB_API_URL_PREVIEW` and `HUB_API_URL_PRODUCTION`. Nothing i18n-related differs.
The preview hub is a **separate database with its own shareId namespace**. Essentially nothing matches, every field falls back to English, every page fails the indexability predicate, the count reaches zero, and the fail-closed assert throws.
So the guard is doing exactly what it was written to do. What is wrong is that it is being applied to a build whose shareId namespace the translation artifacts were never generated against. Asserting production translation coverage against the preview hub is a category error — the `test` leg exists to smoke-test the preview API, not the i18n corpus.
## Fix — deliberately not proposing a mechanism
Two shapes, and the choice belongs to whoever owns #1152/#1193, since they chose fail-closed on purpose:
1. **Neutralise the assert for the test leg** — an `INDEXABLE_LOCALES` override plumbed in for that leg only. Note `site/src/lib/i18n/locales.ts` deliberately avoids `import.meta.env` so `astro.config.mjs` can import it, so this has to arrive as a build-time constant rather than be read there.
2. **Stop asserting it there at all** — drop the `test` matrix entry, or point that leg at the production hub URL.
(2) needs no source change.
Either way it is worth doing soon: a job that has been red for 15 days is a job nobody reads, and it is currently the only signal that the preview hub build works at all.
Found while confirming that #1216 was not responsible for it. It is not — the failure predates #1216, #1224 and #1225 by two weeks.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with preview-cron.yml lines 83-84 and compare the test and production matrix environments, then read the fail-closed assertion in the Astro build path and site/src/lib/i18n/locales.ts. Confirm which build-time setting can distinguish the preview leg without changing production coverage. Done means the preview test leg is green, still exercises the preview API, and the production leg retains its existing i18n guard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, internationalization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100