reviewer-bot: workflow_dispatch reads default-branch code for explore tools (set REVIEW_CONTENT_ROOT)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
調査の方向性
reviewer-bot.yml から始め、review_bot/run_review.py の _content_root() の動作と併せて workflow_dispatch の経路を調査します。HEAD_SHA がどのように取得されるか、また信頼されたプライマリ checkout を変更せずに、個別の checkout と REVIEW_CONTENT_ROOT をどのように接続すべきかを確認します。manual dispatch で PR の head を調査でき、pull_request の動作が変更されないことをもって完了とします。
索引モデルが issue の本文から書いたものです。
説明
Follow-up from PR #862 review (thread on reviewer-bot.yml).
Problem
On the workflow_dispatch (manual) trigger, reviewer-bot.yml does a single actions/checkout with no ref:, which resolves to the default branch — not the PR being reviewed. The PR head is resolved separately (HEAD_SHA = gh pr view ... --json headRefOid).
Result:
- The review diff and comment anchors are correct — the engine fetches them from the GitHub compare API keyed on
HEAD_SHA(repos/{repo}/compare/...), independent of the checkout. - But the agent's explore tools (
read_paths/grep) read from the engine's_content_root(), which falls back to the primary checkout (= default branch on dispatch) whenREVIEW_CONTENT_ROOTis unset. So on manual dispatch, the agent explores default-branch code, not the PR head.
The automatic pull_request trigger (the normal case) is unaffected — its checkout already is the PR merge ref.
Why the engine expects this
Per reviewer_bot/run_review.py _content_root(), workflow_dispatch is meant to check the PR head into a separate directory and export its path as REVIEW_CONTENT_ROOT, while engine code keeps running from the trusted default-branch checkout. This is a deliberate security boundary: dispatch is exempt from the fork guard, so the PR's own code must not run/read from the primary checkout dir.
Fix
On the dispatch path, add a second checkout of HEAD_SHA into a separate dir and export REVIEW_CONTENT_ROOT pointing at it (mirroring the engine's documented pattern).
Severity
Low — only manual dispatch is affected, and only the explore-tool reads (diff/anchors are always correct). Deferred from #862 as a follow-up.
- 主要言語
- Python
- スター
- 233
- フォーク
- 152
- 平均マージ
- 21時間 5分
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databricks/databricks-sql-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
engineer-bot
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
databricks/databricks-sql-python#860 · コメント 3 件 ·
databricks/databricks-sql-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100