Conversation
Prevents build failures from broken image URLs in Notion content.
…RCE_ID migration - Remove deprecated databasesQuery() method from EnhancedNotionClient - dataSourcesQuery() is now the sole query method for v5 API - Remove runtime warning when DATA_SOURCE_ID is missing (silent fallback) - Update tests: databasesQuery tests → dataSourcesQuery tests - Update migration docs: mark migration complete (2026-06) - Update testing docs: databases.query → dataSources.query examples DATABASE_ID retained as silent backward-compat fallback. All 3263 tests pass, typecheck clean.
Merge upstream improvements while preserving custom title wrapping: - Add useDocById for automatic doc descriptions on CardLink - Import useDocById from @docusaurus/plugin-content-docs/client - CardLink now falls back to doc.description from frontmatter Preserved customizations: - .cardTitle CSS keeps word-break/overflow-wrap for long titles - Heading omits text--truncate (titles wrap, not truncate) Verified: typecheck clean, build succeeds (3 locales).
The comment claimed vi.setSystemTime was unavailable in Vitest 4.x, but it works fine in 4.0.18. Replace 40-line manual Date constructor override with clean vi.setSystemTime(fixedDate) / vi.useRealTimers(). All 44 generateBlocks tests pass.
Add two test suites that catch breaking changes when upgrading Docusaurus: 1. docusaurus-swizzle-contracts.test.ts (20 tests): - Verifies all upstream APIs our swizzled components depend on - Checks theme-original re-exports (TOC, DocSidebar, DocSidebarItem) - Validates plugin-content-docs/client exports (useDocById, etc.) - Validates theme-common exports (usePluralForm, useHistorySelector) - Checks @docusaurus/types type exports (WrapperProps, I18nLocaleConfig) - Verifies theme-classic type declarations (@theme/DocCard Props) - Checks virtual module declarations in module-type-aliases - Validates DropdownNavbarItem and Icon/Language sources 2. docusaurus-config.test.ts (9 tests): - Validates config loads without runtime errors - Checks required fields (title, url, baseUrl) - Validates i18n config (locales: en, pt, es) - Validates localeConfigs for all locales - Checks presets and plugins arrays - Validates customFields (defaultDocsPage, localizedDocKeysByLocale) - Verifies markdown hooks config (3.10+ pattern) Uses filesystem checks for type-only and virtual packages since runtime imports fail outside the Docusaurus build context.
Add entries for 54 commits since Jan 2026: - Docusaurus 3.10.1 upgrade, Node 20 bump, DocCard re-swizzle - Notion DATA_SOURCE_ID migration completion - Vitest Date mock cleanup, ESLint fix, lockfile cleanup - Regression tests for Docusaurus updates - Fetch-one API, translation strategies, DeepSeek support - i18n locale detection and dropdown fixes
The error message hardcoded '@docusaurus/types' even though the function is generic. Use pkgDir parameter instead.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e2545b978
ℹ️ 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".
| import Link from "@docusaurus/Link"; | ||
| import { findFirstSidebarItemLink } from "@docusaurus/plugin-content-docs/client"; | ||
| import { | ||
| useDocById, |
There was a problem hiding this comment.
Bump Docusaurus before importing useDocById
This imports useDocById, but the committed install still locks @docusaurus/plugin-content-docs to 3.9.2 (bun.lock keeps the 3.9.2 entries and package.json still declares ^3.9.2), while the new contract test itself labels useDocById as added in Docusaurus 3.10. In any install that honors the committed lockfile, including the Docker build with bun install --frozen-lockfile, this DocCard module will fail to resolve that export before the site can build; update the Docusaurus package ranges/lockfile to 3.10.x or avoid the new API.
Useful? React with 👍 / 👎.
🚀 Preview DeploymentYour documentation preview is ready! Preview URL: https://pr-182.comapeo-docs.pages.dev 🔄 Content: Regenerated 5 pages from Notion (script changes detected)
This preview will update automatically when you push new commits to this PR. Built with commit b92ac35 |
| it("* matches files in current directory only", () => { | ||
| expect(matchesPathFilter("bun.lockb", ["bun.lockb*"])).toBe(true); | ||
| expect(matchesPathFilter("bun.lock", ["bun.lockb*"])).toBe(false); | ||
| expect(matchesPathFilter("bun.lock", ["bun.lock"])).toBe(true); | ||
| expect(matchesPathFilter("bun.lockb", ["bun.lock"])).toBe(false); | ||
| }); |
There was a problem hiding this comment.
Misleading test name and missing wildcard coverage
The test was renamed from verifying bun.lockb* glob behaviour to testing an exact-match pattern ["bun.lock"], but its title still says "* matches files in current directory only". More critically, the production pattern in RECOMMENDED_PATH_FILTERS and DOCKERFILE_COPY_PATTERNS is "bun.lock*" (with wildcard), yet neither assertion here exercises that wildcard — so a regression in glob evaluation against bun.lock* would go undetected by this test case.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/test-docker/path-filter.test.ts
Line: 279-282
Comment:
**Misleading test name and missing wildcard coverage**
The test was renamed from verifying `bun.lockb*` glob behaviour to testing an exact-match pattern `["bun.lock"]`, but its title still says "* matches files in current directory only". More critically, the production pattern in `RECOMMENDED_PATH_FILTERS` and `DOCKERFILE_COPY_PATTERNS` is `"bun.lock*"` (with wildcard), yet neither assertion here exercises that wildcard — so a regression in glob evaluation against `bun.lock*` would go undetected by this test case.
How can I resolve this? If you propose a fix, please make it concise.| it("exports Config type", () => { | ||
| expectTypeExport(typesDir, "Config"); | ||
| }); |
There was a problem hiding this comment.
content.includes("Config") matches any occurrence of the substring, including SiteConfig, DocusaurusConfig, GlobalPluginConfig, etc. If the Config type itself were removed or renamed, the test would still pass as long as any other identifier containing "Config" remains in the file. A word-boundary check (or testing for the export declaration form) would make the assertion meaningful.
| it("exports Config type", () => { | |
| expectTypeExport(typesDir, "Config"); | |
| }); | |
| it("exports Config type", () => { | |
| expectTypeExport(typesDir, "export type Config"); | |
| }); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/docusaurus-swizzle-contracts.test.ts
Line: 117-119
Comment:
`content.includes("Config")` matches any occurrence of the substring, including `SiteConfig`, `DocusaurusConfig`, `GlobalPluginConfig`, etc. If the `Config` type itself were removed or renamed, the test would still pass as long as any other identifier containing "Config" remains in the file. A word-boundary check (or testing for the export declaration form) would make the assertion meaningful.
```suggestion
it("exports Config type", () => {
expectTypeExport(typesDir, "export type Config");
});
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
🐳 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-182
docker run -p 3001:3001 docker.io/communityfirst/comapeo-docs-api:pr-182Built with commit b92ac35 |
Updates all 11 @docusaurus/* packages: - @docusaurus/core - @docusaurus/preset-classic - @docusaurus/plugin-client-redirects - @docusaurus/plugin-google-gtag - @docusaurus/plugin-ideal-image - @docusaurus/plugin-pwa - @docusaurus/plugin-sitemap - @docusaurus/eslint-plugin - @docusaurus/module-type-aliases - @docusaurus/tsconfig - @docusaurus/types Verified: typecheck clean, build succeeds (3 locales), 3264 tests pass. Notable upstream changes (3.10.0): - Docusaurus Faster (Rspack) now stable via future.v4 flag - DocCard refactored: split into Layout sub-component, emoji extraction, useDocById for descriptions (our swizzle uses stable APIs, unaffected) - React upgraded to v19 internally - Node 18 dropped (EOL)
|
Closing: Notion client migration is obsolete due to content pipeline migration; Docusaurus DocCard and contract test improvements can be cherry-picked to a clean branch. |
Summary
Batch of maintenance tasks identified during the Docusaurus 3.10.1 update review. Each task was implemented, tested, and reviewed individually via Codex before committing.
Changes
1. Notion
DATA_SOURCE_IDmigration completed (a77f338)databasesQuery()method fromEnhancedNotionClientdataSourcesQuery()is now the sole query method for the Notion v5 APIDATA_SOURCE_IDis missing (silent fallback toDATABASE_ID)databasesQuery→dataSourcesQuery,database_id→data_source_idcontext/workflows/translation-process.md) — marked completecontext/testing/vitest-mocking-best-practices.md) —databases.query→dataSources.queryDATABASE_IDretained as silent backward-compat fallback (removing it would break 50+ CI/Docker/test files)2. DocCard re-swizzle for Docusaurus 3.10 (
3e7cc47)src/theme/DocCard/index.tsxuseDocByIdfrom@docusaurus/plugin-content-docs/clientfor automatic doc descriptionsCardLinknow falls back todoc.descriptionfrom frontmatter whenitem.descriptionis absent.cardTitleCSS keeps word-break/overflow-wrap for long titles; heading omitstext--truncate(titles wrap, not truncate)3. Vitest Date mock cleanup (
89679a5)Dateconstructor override with cleanvi.setSystemTime(fixedDate)/vi.useRealTimers()vi.setSystemTimewas unavailable in Vitest 4.x — verified it works fine in 4.0.18generateBlockstests pass4. Docusaurus regression tests (
58e4201)Added 29 tests across two new suites that catch breaking changes on future Docusaurus upgrades:
scripts/docusaurus-swizzle-contracts.test.ts(20 tests):@theme-original/*source files (TOC, DocSidebar, DocSidebarItem)plugin-content-docs/clientexports (useDocById,findFirstSidebarItemLink,useActiveDocContext)theme-commonexports (usePluralForm,useHistorySelector)@docusaurus/typestype exports (WrapperProps,I18nLocaleConfig,Config)theme-classictype declarations (@theme/DocCardProps,LocaleDropdownNavbarItem)module-type-aliasesscripts/docusaurus-config.test.ts(9 tests):title,url,baseUrl)en,pt,es; localeConfigs with labels)presetsandpluginsarrayscustomFields(defaultDocsPage,localizedDocKeysByLocale)markdown.hooks.onBrokenMarkdownLinksconfig (3.10+ pattern)5. CHANGELOG update (
457d305)CHANGELOG.mdwith 54 commits worth of changes since Jan 20266. Minor fix (
6e2545b)expectTypeExporthelperVerification
tsc --noEmitvitest run(3324 tests)docusaurus build(en, pt, es)Notes
databases.retrieve(notdatabases.query) is still used innotion-translate,notion-version, andmigration/discoverDataSource— this is a different Notion API endpoint, still valid in v5 for retrieving database metadataGreptile Summary
Batch of five maintenance tasks: Notion v5 API migration completion, DocCard re-swizzle for Docusaurus 3.10.1, Vitest Date mock cleanup, new Docusaurus regression test suites, and a CHANGELOG update.
databasesQuery()and itsDATABASE_ID → data_source_idremapping removed;dataSourcesQuery()is now the only query method. No remaining callers of the old method found anywhere in the codebase.useDocByIdadded so doc frontmatterdescriptionis surfaced as a card description fallback whenitem.descriptionis absent; existing word-wrap CSS customizations preserved.docusaurus-swizzle-contracts.test.ts,docusaurus-config.test.ts) verify that swizzled-component upstream APIs and config shape survive future Docusaurus upgrades.Confidence Score: 5/5
Changes are safe to merge; all modifications are additive tests, a clean API removal with no remaining callers, and a minor DocCard enhancement.
The Notion migration removes a deprecated shim with no remaining callers; the DocCard change is a one-liner description fallback; the new regression suites add coverage without touching production paths. The one non-trivial question — whether
vi.setSystemTimewithoutvi.useFakeTimers()fully mocksnew Date()in Vitest 4.x — is noted as a suggestion, but the PR author verified all 44 Date-related tests pass.scripts/notion-fetch/generateBlocks.test.ts — verify
vi.useFakeTimers()is not required beforevi.setSystemTime()in the project's Vitest version to guard against future breakage.Important Files Changed
databasesQuery()method and theDATA_SOURCE_IDmissing warning;dataSourcesQuery()is now the sole query path. No remaining callers ofdatabasesQueryfound across the codebase.useDocByIdto pull doc description from frontmatter whenitem.descriptionis absent; existing CSS customizations preserved.Dateconstructor override withvi.setSystemTime/vi.useRealTimers();vi.useFakeTimers()is missing beforevi.setSystemTime(), which the Vitest docs require to mock thenew Date()constructor.content.includes("Config")) may produce false-positives.eslintand@eslint/jspinned to exact version 9.39.4 without semver range, unlike the rest of devDependencies.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[fetchNotionData / notion-translate] -->|dataSourcesQuery| B[EnhancedNotionClient] B --> C[dataSources.query via Notion v5 API] B -->|pagesRetrieve / blocksChildrenList| D[pages.retrieve / blocks.children.list] subgraph DocCard rendering E[DocCard item=link] --> F[useDocById item.docId] F -->|doc found| G[doc.description fallback] E -->|item.description present| H[item.description used directly] G --> I[CardLayout description prop] H --> I end subgraph Regression tests J[docusaurus-swizzle-contracts.test.ts] -->|fs checks| K[node_modules source files] L[docusaurus-config.test.ts] -->|dynamic import| M[docusaurus.config.ts] end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[fetchNotionData / notion-translate] -->|dataSourcesQuery| B[EnhancedNotionClient] B --> C[dataSources.query via Notion v5 API] B -->|pagesRetrieve / blocksChildrenList| D[pages.retrieve / blocks.children.list] subgraph DocCard rendering E[DocCard item=link] --> F[useDocById item.docId] F -->|doc found| G[doc.description fallback] E -->|item.description present| H[item.description used directly] G --> I[CardLayout description prop] H --> I end subgraph Regression tests J[docusaurus-swizzle-contracts.test.ts] -->|fs checks| K[node_modules source files] L[docusaurus-config.test.ts] -->|dynamic import| M[docusaurus.config.ts] endReviews (2): Last reviewed commit: "chore(deps): update Docusaurus from 3.9...." | Re-trigger Greptile