From b4137b63eb5fcac5bac2b59603b1f6de21014c96 Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Thu, 16 Jul 2026 17:30:11 -0400 Subject: [PATCH] fix: rename fork-only auto-fix gates to _is_repo_auto_review_enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cherry-pick of upstream 92d63170 renamed _is_repo_enabled_for_review to _is_repo_auto_review_enabled, but the fork's CI auto-fix, auto-fix toggle command, and auto-fix review-feedback gates (not present upstream) still referenced the old name and would raise NameError at request time. Rename them in place — auto-fix surfaces stay gated on the dashboard auto-review opt-in list, preserving current fork behavior. --- agent/webapp.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/agent/webapp.py b/agent/webapp.py index 894fc9f3..7a21085e 100644 --- a/agent/webapp.py +++ b/agent/webapp.py @@ -2445,8 +2445,8 @@ async def github_webhook(request: Request, background_tasks: BackgroundTasks) -> if event_type in _GH_CI_EVENTS: if not is_failing_ci_payload(payload, event_type): return {"status": "ignored", "reason": "CI event is not a completed failure"} - if not await _is_repo_enabled_for_review(webhook_repo_config): - return {"status": "ignored", "reason": "Repository not enabled for review"} + if not await _is_repo_auto_review_enabled(webhook_repo_config): + return {"status": "ignored", "reason": "Automatic review disabled for repository"} logger.info("Accepted GitHub %s webhook, scheduling CI auto-fix evaluation", event_type) background_tasks.add_task(process_github_ci_event, payload, event_type) return {"status": "accepted", "message": f"Processing GitHub {event_type} for auto-fix"} @@ -2501,8 +2501,8 @@ async def github_webhook(request: Request, background_tasks: BackgroundTasks) -> } autofix_command = _parse_autofix_command(comment_body) if autofix_command is not None and is_pr_related_comment: - if not await _is_repo_enabled_for_review(webhook_repo_config): - return {"status": "ignored", "reason": "Repository not enabled for review"} + if not await _is_repo_auto_review_enabled(webhook_repo_config): + return {"status": "ignored", "reason": "Automatic review disabled for repository"} gate_rejection = await _enforce_public_repo_org_gate(payload, event_type) if gate_rejection is not None: return gate_rejection @@ -2522,9 +2522,9 @@ async def github_webhook(request: Request, background_tasks: BackgroundTasks) -> return {"status": "accepted", "message": "Processing review finding reply"} if not any(tag in comment_body.lower() for tag in OPEN_SWE_TAGS): - if _is_actionable_review_payload(payload, event_type) and await _is_repo_enabled_for_review( - webhook_repo_config - ): + if _is_actionable_review_payload( + payload, event_type + ) and await _is_repo_auto_review_enabled(webhook_repo_config): gate_rejection = await _enforce_public_repo_org_gate(payload, event_type) if gate_rejection is not None: return gate_rejection