reviewer-bot: workflow_dispatch reads default-branch code for explore tools (set REVIEW_CONTENT_ROOT)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 84/100
Piste de recherche
Commencez dans reviewer-bot.yml et examinez le chemin workflow_dispatch avec le comportement de _content_root() de review_bot/run_review.py. Vérifiez comment HEAD_SHA est obtenu et comment le checkout séparé et REVIEW_CONTENT_ROOT doivent être reliés sans modifier le checkout primaire de confiance. Le travail est terminé lorsque le dispatch manuel explore le head de la PR tandis que le comportement de pull_request reste inchangé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 233
- Forks
- 152
- Merge moyen
- 21 h 5 min
- PR mergées (30 j)
- 10
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de databricks/databricks-sql-python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
engineer-bot
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
databricks/databricks-sql-python#860 · 3 commentaires ·
Toutes les issues de databricks/databricks-sql-python
Issues similaires
-
triage/confirmed
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
apache/cloudstack#14222 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100