fix: drift ワークフローの実体にソース由来の経路検知を入れる - #1919
Conversation
原本(tools/api-inventory/ci/)には detect_routes.py --cross-check --gate の段が あったが、GitHub Actions が動かす .github/workflows/ 側に反映されておらず、 config で無効な経路が台帳から落ちても CI で気付けない状態だった。 - 原本を実体にコピーする - 原本と実体の一致を見る test_workflows.py を足す - 実体だけを触った変更でもそのテストが走るよう、tests ワークフローの paths に drift の実体を足す Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Reviewer's GuideAPI inventory drift にソース(AST)由来の経路検知を追加し、実機由来の照合では見逃す config 無効・未導入経路もゲート対象にする。併せて原本と実体のワークフロー一致テストを導入し、drift ワークフロー変更時にそのテストが実行されるよう paths を更新している。 Sequence diagram for dual API inventory drift detectionsequenceDiagram
participant Workflow as DriftWorkflow
participant Reconcile as reconcile.py
participant Detect as detect_routes.py
participant Gate as InventoryGate
participant Report as DriftReport
Workflow->>Reconcile: reconcile.py --summary-only --gate
Reconcile->>Gate: compare url_map with inventory
Gate-->>Reconcile: pass or fail
Workflow->>Detect: detect_routes.py --cross-check --summary-only --gate
Detect->>Gate: compare source routes with inventory
Gate-->>Detect: pass or fail
Workflow->>Report: upload /tmp/reconcile.md and /tmp/detect.md
Workflow->>Report: Comment on PR
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 0)サマリ
変化はありません。 台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
ソース由来の経路検知ソース由来の経路検知
判定: ✅ 全検知が台帳に対応 (0件)
参考: 静的検知と結びつかなかった台帳行
|
変更内容
.github/workflows/api-inventory-drift.ymlを原本(tools/api-inventory/ci/)に揃える。実体から抜けていたdetect_routes.py --cross-check --gate(ソース ↔ 台帳の突き合わせ)の段が入るtools/api-inventory/tests/test_workflows.pyを追加api-inventory-tests.yml(原本・実体)の paths に drift の実体を追加目的
原本にだけ検知段があり、CI では一度も走っていなかった。config で無効・プラグイン未導入の経路が台帳から落ちても気付けない状態だったため。
動作確認
detect_routes.pyを実行: 検知 733 件すべてが台帳と対応し、未収載 0 でゲートを通過(出力は件数のみ)cd tools/api-inventory && python3 -m pytest全件パスtest_workflows.pyが落ちることを確認🤖 Generated with Claude Code
Summary by Sourcery
Add source-based route coverage checks to API inventory drift detection and keep the workflow implementation synchronized with its canonical definition.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests: