chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成 - #583

Merged
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan
Aug 5, 2026
Merged

chore: Renovate の backend 依存 6 件を 1 本に統合し THIRD_PARTY_LICENSES を再生成#583
yusuke0610 merged 3 commits into
mainfrom
claude/renovate-pr-cleanup-8njhan

Conversation

@yusuke0610

@yusuke0610yusuke0610 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

変更概要

Renovate の PR #575-#580(backend 依存 6 件)を 1 本に統合する。6 件とも backend/uv.lock を共有するため個別にマージすると 2 件目以降が必ず競合し Renovate のリベース待ちが連鎖する。まとめて lock を再生成することで一度に解消する。あわせて、依存更新時に再生成が必要な THIRD_PARTY_LICENSES.md が未更新だったため make licenses で追従させ、その過程で見つかった生成スクリプトの穴(不完全な環境でも黙って通す)も塞いだ。

バージョン更新(統合元 PR)

PRパッケージ変更
#578fastapi0.140.13 → 0.141.1
#577uvicorn[standard]0.52.0 → 0.52.1
#580redis8.0.1 → 8.1.0
#575markdown3.10.2 → 3.10.3
#576ruff0.16.0 → 0.16.1
#579mutmut3.6.0 → 3.7.0

マージ後に上記 6 件は close されます。lock を共有しない #573(redis docker digest)/ #574(react-router-dom)は先行してマージ済み。

レビュー時に見てほしい点

THIRD_PARTY_LICENSES.md の差分が今回の 6 件を超えて広い(+34 / -35 行)。このファイルは CI に drift 検知が無く、過去のマージ済み依存 PR の分がずっと陳腐化していたため(fastapi の行が 0.138.2、uvicorn 0.49.0、ruff 0.15.20 のまま等)、生成スクリプトを回すと全体が一斉に追従する。部分再生成はできない。

内容の忠実性は確認済み:

  • 削除された openai / stripe / google-genai は backend/pyproject.toml に既に存在しない(依存から外れた後も行が残っていた)
  • 追加された cryptography / pypdf は pyproject に存在する(追加時に再生成されていなかった)
  • frontend 側の版数は web/package-lock.json に一致
  • 再実行してもファイルに差分が出ないこと(べき等性)を確認済み

生成スクリプトの穴を塞いだ(2 コミット目)

scripts/gen-third-party-licenses.py は依存を解決できなくても 要確認 (未インストール) という行を書いて exit 0 していた。そのため node_modules 未インストールの環境で生成した結果が気付かれず main に載っていた:

| [@stryker-mutator/core] | — | 要確認 (未インストール) |
| [@stryker-mutator/vitest-runner] | — | 要確認 (未インストール) |

「再生成し忘れ」とは別系統の壊れ方で、CI に drift 検知も無いため誰も気付けない。解決できない依存が 1 件でもあれば ファイルを書かずに exit 1 するようにした(欠けた依存名と、npm ci / nix devshell どちらが原因かの切り分けを stderr に出す)。中止しても既存ファイルは無傷。

ライセンス種別だけ判定できない 要確認 / 要確認 (プロジェクト参照) はメタデータ側の事情であり実行環境の不備ではないため、中止条件には含めていない。

なお scripts/ は ruff の includeapp / tests / alembic_migrations)外で CI 対象外。参考として手で ruff をかけると EXE001 / I001 / PLE2515 の 3 件が出るが、origin/main の同ファイルでも同一の 3 件が出るため本 PR 由来ではない(範囲外として触っていない)。

確認した非互換リスク

  • security 目的で明示ピンしている starlette 1.3.1 / cryptography 50.0.0 / python-multipart 0.0.32 はいずれも降格していない。fastapi 0.141.1 の要求は starlette>=0.46.0 でピンは有効
  • fastapi の minor bump でも OpenAPI 出力は不変(web/src/api/generated.ts に差分なし)
  • 新しく出るようになった DeprecationWarning が 2 件あるが動作は維持(本 PR の対応範囲外)
    • starlette TestClient の Using httpx with starlette.testclient is deprecated; install httpx2 instead
    • redis 8.1.0 で progress_service.pysetex が deprecated(set(..., ex=...) へ寄せる余地あり)

セルフレビューチェックリスト

必須確認

  • make ci が pass している(lint + test + build-web) — 作業環境に nix が無く make ci を直接実行できなかったため個別に実行: pytest 626 passed / ruff check All checks passed / pyright 0 errors / uv lock --check pass / lint-env-keyslint-adr-indexlint-tdd OK / codegen-drift 相当は差分なし。smoke-backend・test-web・test-e2e・detect-duplication は本 PR の CI で検証
  • コメント・ドキュメント・エラーメッセージは日本語で記述した

条件付き確認(該当する場合のみ N/A と記入)

  • app/schemas/ または app/routers/ を変更した場合: N/A(変更なし。ただし fastapi bump の影響確認のため codegen を実行し差分なしを確認済み)
  • 新しいページ・認証・ナビゲーション・レイアウトを変更した場合: N/A
  • 新規環境変数を追加した場合: N/A
  • web/src/ で日本語メッセージを定数経由で参照した: N/A(web/src/ の変更なし)

破壊的変更

  • 破壊的変更なし(API 契約・DB スキーマ・既存の公開インターフェースに変更なし)
  • 破壊的変更あり → 概要:

ADR(設計判断を伴う変更の場合のみ)

  • 新しいライブラリ採用・アーキテクチャ変更を伴う場合、ADR を作成した(または既存 ADR が対応している) — N/A(既存依存のバージョン更新のみ)
  • ADR を新規作成・ステータス変更した場合: N/A

Summary by CodeRabbit

  • Chores
    • Updated backend dependencies and development tooling to newer versions.
    • Refreshed the third-party license inventory with current dependency versions and packages.
  • Documentation
    • Documented the required license-inventory update process when dependencies change.
  • Bug Fixes
    • License inventory generation now detects unresolved dependencies and stops without overwriting the existing file, helping prevent incomplete compliance records.

Renovate の PR #575-#580 を 1 本に統合する。6 件とも backend/uv.lock を
共有するため個別マージでは競合が連鎖するので、まとめて lock を再生成した。
- fastapi 0.140.13 -> 0.141.1
- uvicorn[standard] 0.52.0 -> 0.52.1
- redis 8.0.1 -> 8.1.0
- markdown 3.10.2 -> 3.10.3
- ruff 0.16.0 -> 0.16.1
- mutmut 3.6.0 -> 3.7.0
あわせて未再生成だった THIRD_PARTY_LICENSES.md を make licenses で更新する。
CI に drift 検知が無く過去の依存 PR 分も陳腐化していたため、今回の 6 件以外の
行も追従している。再発防止として review.md の SSoT 観点と CLAUDE.md の
生成物テーブルに licenses の系統を追記した。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42a512e9-eb00-4c02-90b7-cef7f8d917b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5168801 and cb01cdb.

📒 Files selected for processing (2)
  • THIRD_PARTY_LICENSES.md
  • scripts/gen-third-party-licenses.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/gen-third-party-licenses.py

📝 Walkthrough

Walkthrough

The PR updates backend dependency pins, regenerates third-party license metadata, documents the regeneration workflow, and prevents license generation when npm or Python dependencies cannot be resolved.

Changes

Dependency License Workflow

Layer / File(s)Summary
Dependency declarations and license inventory
backend/pyproject.toml, THIRD_PARTY_LICENSES.md, .claude/CLAUDE.md, .claude/rules/common/review.md
Backend dependency versions and license records were updated. The documentation now requires make licenses after direct dependency changes and adds a review check for regenerated license data.
Unresolved dependency validation
scripts/gen-third-party-licenses.py
The generator uses NOT_INSTALLED for unresolved packages, classifies mutmut as a development tool, reports incomplete dependency groups, exits with status 1, and avoids modifying the existing license file.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant main
participant collect_npm
participant _py_license
participant _abort_if_incomplete
participant LicenseFile
main->>collect_npm: Collect frontend dependency records
main->>_py_license: Collect backend dependency records
main->>_abort_if_incomplete: Validate dependency groups
_abort_if_incomplete-->>main: Exit with status 1 if unresolved packages exist
main->>LicenseFile: Write generated licenses when validation passes
Loading

Possibly related PRs

  • yusuke0610/devforge#499: Both changes update scripts/gen-third-party-licenses.py and the dependency/license-generation workflow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passedタイトルは、backend依存6件の統合とTHIRD_PARTY_LICENSES.mdの再生成という変更の主要内容を明確に示しています。
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/renovate-pr-cleanup-8njhan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actionsgithub-actionsBot added chore 雑務・保守作業 documentation Improvements or additions to documentation backend バックエンド labels Aug 4, 2026
gen-third-party-licenses.py は依存を解決できなくても「要確認 (未インストール)」
という行を書いて exit 0 していたため、node_modules 未インストールの環境で
生成した結果がそのまま main に載っていた(@stryker-mutator/* の 2 行)。
再生成漏れとは別系統の壊れ方で、CI に drift 検知も無いため気付けない。
解決できない依存が 1 件でもあれば、ファイルを書かずに exit 1 するようにした。
欠けた依存名と原因の切り分け(npm ci / nix devshell)を stderr に出す。
既存ファイルは変更しないので、中止しても正しい状態が残る。
ライセンス種別だけ判定できない「要確認」「要確認 (プロジェクト参照)」は
メタデータ側の事情であり実行環境の不備ではないため中止条件に含めない。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

前回はレビュー上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610 PR #583 のレビューを再実行します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/gen-third-party-licenses.py (1)

174-201: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add regression tests for the fail-before-write contract.

Test missing npm and Python dependencies. Assert SystemExit(1) and unchanged output bytes. Test a fully resolved input and a metadata-only unknown license to confirm those paths still write.

As per coding guidelines, changed branches must be covered by tests when existing tests do not cover them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/gen-third-party-licenses.py` around lines 174 - 201, Add regression
tests around the license generation flow and _abort_if_incomplete: cover missing
npm and Python dependencies by asserting SystemExit(1) and byte-for-byte
unchanged output, and cover fully resolved input plus metadata-only unknown
licenses by asserting generation still writes successfully. Use the existing
test fixtures and entry points where available, without changing the
fail-before-write behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@THIRD_PARTY_LICENSES.md`:
- Line 75: Add "mutmut" to the BACKEND_DEV_TOOLS collection in
gen-third-party-licenses.py, then regenerate THIRD_PARTY_LICENSES.md so mutmut
is removed from the Backend runtime list and appears under the backend
development-tools section.
---
Nitpick comments:
In `@scripts/gen-third-party-licenses.py`:
- Around line 174-201: Add regression tests around the license generation flow
and _abort_if_incomplete: cover missing npm and Python dependencies by asserting
SystemExit(1) and byte-for-byte unchanged output, and cover fully resolved input
plus metadata-only unknown licenses by asserting generation still writes
successfully. Use the existing test fixtures and entry points where available,
without changing the fail-before-write behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf13df2-3be9-40f9-9238-f68bfacf9afb

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1f1e1 and 5168801.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .claude/CLAUDE.md
  • .claude/rules/common/review.md
  • THIRD_PARTY_LICENSES.md
  • backend/pyproject.toml
  • scripts/gen-third-party-licenses.py

Comment threadTHIRD_PARTY_LICENSES.md Outdated
mutmut はミューテーションテスト専用(週次 CI: mutation.yml / ADR-0017)で
app/ から一切 import されないが、BACKEND_DEV_TOOLS に入っていなかったため
THIRD_PARTY_LICENSES.md の「Backend(ランタイム)」に載っていた。
attribution としてランタイム同梱物を誤って示すことになる。
BACKEND_DEV_TOOLS に mutmut を追加して再生成した(runtime 25 -> 24 / dev 6 -> 7)。
ランタイム一覧の残り 24 件も突合したが、他に誤分類は無い。
CodeRabbit の指摘(PR #583)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpmNEaJWhNMLp6cw9uwP6q
@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

レビューありがとうございます。2 件の対応状況です。

✅ 対応済み: mutmut をランタイム一覧から開発ツールへ(cb01cdb)

妥当な指摘でした。mutmutapp/ から一切 import されず、make mutation-backend と週次の mutation.yml(ADR-0017)でしか使われないため、ランタイム同梱物として attribution に載るのは誤りです。

BACKEND_DEV_TOOLSmutmut を追加して再生成しました(Backend runtime 25 → 24 / dev 6 → 7)。あわせてランタイム一覧の残り 24 件も突合しましたが、他に同種の誤分類はありませんでした。

⏸ 見送り: 生成スクリプトの回帰テスト

提案自体は妥当ですが、このリポジトリには scripts/ 配下のテストが 1 つも存在せず、追加するには「リポジトリ運用スクリプトのテストをどこに置き、CI でどう回すか」という設計判断が要るため、依存整理の本 PR には含めません。

根拠:

  • ルート直下に pytest 設定・テストディレクトリが無い。backend/pyproject.tomltestpaths = ["tests"] で backend に閉じており、make test-backend はそこしか回さない
  • backend/tests/ に置くと backend のテストスイートがリポジトリルートのツールをテストすることになり責務境界が崩れる。加えて gen-third-party-licenses.py はハイフン込みのファイル名で通常の import ができず、importlib でのファイルロードが要る
  • CI で実際に動いている lint-env-keys.sh / lint-adr-index.sh / lint-tdd.sh を含め、scripts/ の 8 本すべてが未テスト。本スクリプトだけ先にテストを持たせても一貫しない
  • 本プロジェクトの TDD 必須スコープは [tool.mutmut] only_mutate(= app/services/ 配下)と定めており(ADR-0019)、scripts/ は意図的に対象外。実際 make lint-tdd は green

なお、今回追加した fail-before-write の挙動は手動で両経路を検証済みです。

  • 正常系: exit 0、かつ再実行しても差分なし(べき等)
  • 異常系: web/node_modules を退避して実行 → exit 1、欠けた 38 件を列挙、THIRD_PARTY_LICENSES.md は無変更(既存ファイル保持)

scripts/ のテスト基盤整備は別 issue として切るのが適切と考えます。ご判断ください。


Generated by Claude Code

@yusuke0610Claude

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai review

cb01cdb(mutmut を開発ツールへ移動)の増分レビューが上限でスキップされたため再実行します。


Generated by Claude Code

@coderabbitai

coderabbitaiBot commented Aug 5, 2026

Copy link
Copy Markdown

@yusuke0610cb01cdb の増分レビューを実行します。mutmut の開発ツール分類と、再生成されたライセンス一覧を確認します。

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backendバックエンドchore雑務・保守作業documentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yusuke0610@claude