[自動レビュー 2026-05-09] 日次コードレビューによる修正 - #4
Draft
stewroux wants to merge 1 commit into
Draft
Conversation
…or抑制, .gitignore改善)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
2026-05-09 の日次コードレビューで発見した問題のうち、自動修正可能なものを対応しました。
修正内容
1. CI: Node.js 18 → 20 LTS へアップグレード
.github/workflows/ci.yml2. AIレスポンスの実行時型バリデーション追加
services/geminiService.tsJSON.parse()後の Gemini APIレスポンスをas TranslationBlock[]で直接キャストしていた問題を修正。isTranslationBlockArray()バリデーター関数を追加し、不正なレスポンスを早期にエラーとして検出。3.
console.errorを開発環境のみに制限services/geminiService.tsprocess.env.NODE_ENV === 'development'条件に限定。4.
.gitignoreにテスト出力ファイルを追加.gitignoretest_genai.js実行時に生成されるoutput_test.jpg/output_test.pngを除外。未対応の重要Issue(手動対応が必要)
Issue [SECURITY] NEXT_PUBLIC_ プレフィックスによりGemini APIキーがクライアントバンドルに露出 #1
[SECURITY] NEXT_PUBLIC_GEMINI_API_KEY クライアントバンドル露出→
app/api/translate/route.tsのAPIルート化が必要(アーキテクチャ変更のため手動対応)Issue [SECURITY] APIキーのlocalStorage保存によるXSS攻撃リスク #2
[SECURITY] APIキーのlocalStorage保存によるXSSリスク→ Issue [SECURITY] NEXT_PUBLIC_ プレフィックスによりGemini APIキーがクライアントバンドルに露出 #1 の対応と合わせてサーバーサイド化することで解決
テスト計画
npm run lintが通ることnpm run buildが通ることこのPRは自動コードレビューエージェントにより作成されました(2026-05-09)。
Generated by Claude Code