Skip to content

feat: block can-be-merged when unresolved review conversations exist #997

@rnetser

Description

@rnetser

Description

Add a new config option required-conversation-resolution that, when enabled, fails the can-be-merged check if the PR has unresolved review threads.

GitHub's REST API doesn't expose thread resolution status — only the GraphQL API v4 has reviewThreads { isResolved }. The codebase already has httpx as a dependency, so we'll use it for the GraphQL call.

Requirements

  • New required-conversation-resolution boolean config at global + repository level in schema
  • GraphQL helper method get_unresolved_review_threads() on GithubWebhook class
  • Integration into check_if_can_be_merged() in PullRequestHandler
  • Threads that are resolved or outdated are excluded
  • Failure message shows file:line for up to 5 unresolved threads

Deliverables

  • Add required-conversation-resolution to schema.yaml (global + repo level)
  • Load config in github_api.py _repo_data_from_config()
  • Add get_unresolved_review_threads() GraphQL method to GithubWebhook
  • Integrate check in check_if_can_be_merged() (parallel with existing gather)
  • Add tests for GraphQL helper and handler integration
  • Update test_schema_validator.py and test_config_schema.py
  • Add examples in examples/config.yaml and examples/.github-webhook-server.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions