mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 06:53:14 +00:00
fix: rename fork-only auto-fix gates to _is_repo_auto_review_enabled
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.
This commit is contained in:
parent
7877a9003e
commit
b4137b63eb
1 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue