Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pr_agent/servers/github_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _check_pull_request_event(action: str, body: dict, log_context: dict) -> Tup
if not api_url:
return invalid_result
log_context["api_url"] = api_url
if pull_request.get("draft", True) or pull_request.get("state") != "open":
if pull_request.get("draft", False) or pull_request.get("state") != "open":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Missing test for draft-default 📘 Rule violation ⛯ Reliability

The PR changes webhook behavior by treating missing draft as False, but no pytest coverage is
added/updated to lock this behavior in. This risks regression where PRs without an explicit draft
field could be silently skipped again.
Agent Prompt
## Issue description
The webhook validation now defaults missing `pull_request.draft` to `False`, but there is no pytest coverage ensuring PR events without a `draft` field are processed.

## Issue Context
GitHub webhook payloads may omit the `draft` field. Without a test, this behavior can regress and silently skip legitimate PRs.

## Fix Focus Areas
- tests/unittest/test_add_docs_trigger.py[11-75]
- pr_agent/servers/github_app.py[387-388]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

return invalid_result
if action in ("review_requested", "synchronize") and pull_request.get("created_at") == pull_request.get("updated_at"):
# avoid double reviews when opening a PR for the first time
Expand Down