Conversation
chore: sync main to develop
test: Add comprehensive unit and integration tests for storage, AI, and settings
* fix(ci): gate prod frontend deploy on API git_commit_sha match Expose Railway deploy SHA on /api/health and require deploy-prod to verify it matches the pushed commit before publishing Cloudflare Pages. Also fail when production API_BASE_URL is unset instead of skipping checks. Co-authored-by: Cursor <cursoragent@cursor.com> * test(api): use vi.stubEnv for health git_commit_sha tests Address PR #1070 review: align env mocking with other server/api tests. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
More reviews will be available in 33 minutes and 13 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of unit and integration tests across various modules, including general settings, Mermaid diagram generation, storage providers (GitHub and Google Drive), IndexedDB storage adapter, storage settings, user AI credentials, and wiki generator providers. It also updates the /health endpoint to return the Railway git commit SHA. The feedback focuses on improving the robustness of the newly added test suites for GitHub and Google Drive storage providers by using optional chaining and fallback values when parsing potentially undefined or null mock request bodies, thereby avoiding potential TypeScript compilation or runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| expect(calledUrl).toBe("https://api.github.com/repos/owner/repo/contents/images/pic.png"); | ||
| expect(opts.method).toBe("PUT"); | ||
| expect(opts.headers.Authorization).toBe("Bearer ghp_token"); | ||
| const body = JSON.parse(opts.body); |
There was a problem hiding this comment.
| expect(url).toBe("https://raw.githubusercontent.com/owner/repo/dev/sub/pic.png"); | ||
| const [calledUrl, opts] = fetchMock.mock.calls[0]; | ||
| expect(calledUrl).toBe("https://api.github.com/repos/owner/repo/contents/sub/pic.png"); | ||
| expect(JSON.parse(opts.body).branch).toBe("dev"); |
| const [delUrl, delOpts] = fetchMock.mock.calls[1]; | ||
| expect(delUrl).toBe("https://api.github.com/repos/owner/repo/contents/images/pic.png"); | ||
| expect(delOpts.method).toBe("DELETE"); | ||
| expect(JSON.parse(delOpts.body).sha).toBe("sha123"); |
| expect(permOpts.method).toBe("POST"); | ||
| expect(permOpts.headers.Authorization).toBe("Bearer access-token"); | ||
| expect(permOpts.headers["Content-Type"]).toBe("application/json"); | ||
| expect(JSON.parse(permOpts.body)).toEqual({ role: "reader", type: "anyone" }); |
There was a problem hiding this comment.
permOpts や permOpts.body が undefined または null である可能性があり、TypeScript の厳格な型チェックにおいてコンパイルエラーが発生する可能性があります。安全にキャストするか、フォールバックを追加することを推奨します。
| expect(JSON.parse(permOpts.body)).toEqual({ role: "reader", type: "anyone" }); | |
| expect(JSON.parse((permOpts?.body as string) ?? "{}")).toEqual({ role: "reader", type: "anyone" }); |
| const [refreshUrl, refreshOpts] = fetchMock.mock.calls[1]; | ||
| expect(refreshUrl).toBe("https://oauth2.googleapis.com/token"); | ||
| expect(refreshOpts.method).toBe("POST"); | ||
| const refreshBody = refreshOpts.body.toString(); |
There was a problem hiding this comment.
refreshOpts や refreshOpts.body が undefined または null である可能性があり、直接 .toString() を呼び出すとランタイムエラー(TypeError)や TypeScript のコンパイルエラーが発生する可能性があります。オプショナルチェイニングと空文字へのフォールバックを使用することを推奨します。
| const refreshBody = refreshOpts.body.toString(); | |
| const refreshBody = refreshOpts?.body?.toString() ?? ""; |
| expect(tokens).toEqual({ accessToken: "at", refreshToken: "rt" }); | ||
| const [tokenUrl, tokenOpts] = fetchMock.mock.calls[0]; | ||
| expect(tokenUrl).toBe("https://oauth2.googleapis.com/token"); | ||
| const tokenBody = tokenOpts.body.toString(); |
概要
developブランチの変更(3 コミット、13 ファイル)をmainに取り込むリリース PR です。前回の main マージ(#1058 / zedi 0.23.0)以降、テスト強化と本番デプロイ CI のゲート改善を本番へ反映します。変更点
src/lib/server/api//api/healthにgit_commit_shaを追加(Railway デプロイ済みコミットの検証用)(#1070).github/workflows/git_commit_shaが push コミットと一致するまで待機するゲートを追加(#1070)fake-indexeddbdevDependency 追加(IndexedDB 統合テスト用)(#1068)変更の種類
テスト方法
deploy-prod.ymlのverify-server-healthがAPI_BASE_URL/api/healthのgit_commit_shaを検証することを Deploy Production ワークフローで確認するチェックリスト
.ja.mdペア)スクリーンショット(UI 変更がある場合)
該当なし(テスト・CI のみ)
関連 Issue
#1068, #1070
マージ方法
Create a merge commit でマージしてください(AGENTS.md の release フローに従う)。
マージ後の運用メモ
API_BASE_URL=https://api.zedi-note.appが設定されていることを確認する(未設定だとverify-server-healthが fail しフロントはデプロイされない)/api/healthをデプロイするまで CI が待機する(意図した挙動)Made with Cursor