Conversation
…egory_.json and add tests When translatedTitle is empty or whitespace-only, fall back to the English source title (or "Untitled") so _category_.json label/customProps.title are never blank. Adds unit tests for the fallback and a locale-output regression test that asserts all translated _category_.json files have non-empty labels. Closes #158, closes #159
🐳 Docker Image PublishedYour Docker image has been built and pushed for this PR. Image Reference: Platforms: linux/amd64, linux/arm64 TestingTo test this image: docker pull docker.io/communityfirst/comapeo-docs-api:pr-160
docker run -p 3001:3001 docker.io/communityfirst/comapeo-docs-api:pr-160Built with commit 889d3a2 |
🚀 Preview DeploymentYour documentation preview is ready! Preview URL: https://pr-160.comapeo-docs.pages.dev 📦 Content: From content branch (no script changes)
This preview will update automatically when you push new commits to this PR. Built with commit 889d3a2 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
Files Reviewed (3 files)
Review DetailsThe fix is well-implemented. The fallback chain
Tests cover all edge cases including a regression test to ensure Page-type content doesn't produce |
… in .env.example Add the missing environment variable entries that three tests in docker-config.test.ts and docker-smoke-tests.test.ts were asserting: - OPENAI_API_KEY and OPENAI_MODEL (required for notion-translate scripts) - API_HOST and API_PORT (used by api-server/server.ts at startup) - API_KEY_* pattern documentation (used by ApiKeyAuth to load keys from env)
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🧹 Preview Deployment CleanupThe preview deployment for this PR has been cleaned up. Preview URL was: Note: Cloudflare Pages deployments follow automatic retention policies. Old previews are cleaned up automatically. |
Summary
Scope:
scripts/notion-translate/index.ts,scripts/notion-translate/index.test.ts,scripts/verify-locale-output.test.tsonly. No changes to docs content, CI config, or other scripts.saveTranslatedContentToDiskso that whentranslatedTitleis empty or whitespace-only, bothlabelandcustomProps.titlein the toggle_category_.jsonuse the English source title (already computed viagetTitle(englishPage)) and finally"Untitled"— instead of writing an empty string.elementType: "Page"never produces a_category_.json._category_.jsonfiles underi18n/es/andi18n/pt/and asserts everylabelis a non-empty string. Gracefully skips when the content branch is not checked out (ENOENT pattern already used in the file).Closes #158, closes #159 (part of umbrella #157)
Test plan
bunx vitest run scripts/notion-translate/index.test.ts— all new describe blocks passbunx vitest run scripts/verify-locale-output.test.ts— new_category_.jsonlabel test passes (or skips gracefully if content branch not present)context/tasks/,reviews/,scripts/audit-language-field.ts) were included in the commit