Skip to content

Release: develop を main にマージ#1071

Merged
otomatty merged 3 commits into
mainfrom
develop
Jun 13, 2026
Merged

Release: develop を main にマージ#1071
otomatty merged 3 commits into
mainfrom
develop

Conversation

@otomatty

Copy link
Copy Markdown
Owner

概要

develop ブランチの変更(3 コミット、13 ファイル)を main に取り込むリリース PR です。前回の main マージ(#1058 / zedi 0.23.0)以降、テスト強化と本番デプロイ CI のゲート改善を本番へ反映します。

変更点

領域 主な変更
src/lib/ ストレージプロバイダー(Google Drive / GitHub)、IndexedDB アダプター、Wiki/Mermaid 生成、設定管理の包括的テスト追加(#1068
server/api/ /api/healthgit_commit_sha を追加(Railway デプロイ済みコミットの検証用)(#1070
.github/workflows/ 本番フロントデプロイ前に API の git_commit_sha が push コミットと一致するまで待機するゲートを追加(#1070
ルート fake-indexeddb devDependency 追加(IndexedDB 統合テスト用)(#1068

変更の種類

  • 🐛 バグ修正 (Bug fix)
  • ✨ 新機能 (New feature)
  • 💥 破壊的変更 (Breaking change)
  • 📝 ドキュメント (Documentation)
  • 🎨 スタイル/リファクタリング (Style/Refactor)
  • 🧪 テスト (Tests)
  • 🔧 ビルド/CI (Build/CI)

テスト方法

  1. CI がすべてグリーンになることを確認する
  2. マージ後、deploy-prod.ymlverify-server-healthAPI_BASE_URL/api/healthgit_commit_sha を検証することを Deploy Production ワークフローで確認する
  3. Railway 本番 API が新コミットをデプロイするまでフロントデプロイがブロックされることを確認する(意図した挙動)

チェックリスト

  • テストがすべてパスする
  • Lint エラーがない
  • 必要に応じてドキュメントを更新した(英語正本 + 該当する場合は .ja.md ペア)
  • コミットメッセージが Conventional Commits に従っている

スクリーンショット(UI 変更がある場合)

該当なし(テスト・CI のみ)

関連 Issue

#1068, #1070

マージ方法

Create a merge commit でマージしてください(AGENTS.md の release フローに従う)。

マージ後の運用メモ

  • GitHub production 環境に API_BASE_URL=https://api.zedi-note.app が設定されていることを確認する(未設定だと verify-server-health が fail しフロントはデプロイされない)
  • 初回マージ時は Railway 本番 API が新 /api/health をデプロイするまで CI が待機する(意図した挙動)

Made with Cursor

otomatty and others added 3 commits June 13, 2026 15:20
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>
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@otomatty, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5eb788ae-d00d-4add-9afc-f48ed7aab769

📥 Commits

Reviewing files that changed from the base of the PR and between 5ac15ee and 0a41478.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .github/workflows/deploy-prod.yml
  • package.json
  • server/api/src/__tests__/routes/health.test.ts
  • server/api/src/routes/health.ts
  • src/lib/generalSettings.test.ts
  • src/lib/mermaidGenerator.test.ts
  • src/lib/storage/providers/GitHubProvider.test.ts
  • src/lib/storage/providers/GoogleDriveProvider.test.ts
  • src/lib/storageAdapter/IndexedDBStorageAdapter.integration.test.ts
  • src/lib/storageSettings.test.ts
  • src/lib/userAiCredentials.test.ts
  • src/lib/wikiGenerator/wikiGeneratorProviders.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

opts や opts.body が undefined または null である可能性があり、TypeScript の厳格な型チェック(strictNullChecks)が有効な場合にコンパイルエラーが発生する可能性があります。また、JSON.parse は string 型のみを受け付けるため、安全にキャストするか、文字列への変換を行うことを推奨します。

Suggested change
const body = JSON.parse(opts.body);
const body = JSON.parse((opts?.body as string) ?? "{}");

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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

上記と同様に、opts や opts.body が undefined または null である可能性を考慮し、安全にパースできるようにオプショナルチェイニングとフォールバックを追加することを推奨します。

Suggested change
expect(JSON.parse(opts.body).branch).toBe("dev");
expect(JSON.parse((opts?.body as string) ?? "{}").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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

上記と同様に、delOpts や delOpts.body が undefined または null である可能性を考慮し、安全にパースできるようにオプショナルチェイニングとフォールバックを追加することを推奨します。

Suggested change
expect(JSON.parse(delOpts.body).sha).toBe("sha123");
expect(JSON.parse((delOpts?.body as string) ?? "{}").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" });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

permOpts や permOpts.body が undefined または null である可能性があり、TypeScript の厳格な型チェックにおいてコンパイルエラーが発生する可能性があります。安全にキャストするか、フォールバックを追加することを推奨します。

Suggested change
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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

refreshOpts や refreshOpts.body が undefined または null である可能性があり、直接 .toString() を呼び出すとランタイムエラー(TypeError)や TypeScript のコンパイルエラーが発生する可能性があります。オプショナルチェイニングと空文字へのフォールバックを使用することを推奨します。

Suggested change
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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

上記と同様に、tokenOpts や tokenOpts.body が undefined または null である可能性を考慮し、安全に .toString() を呼び出せるようにオプショナルチェイニングとフォールバックを追加することを推奨します。

Suggested change
const tokenBody = tokenOpts.body.toString();
const tokenBody = tokenOpts?.body?.toString() ?? "";

@otomatty otomatty self-assigned this Jun 13, 2026
@otomatty otomatty merged commit 5ced376 into main Jun 13, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant