Skip to content

Comments

feat: add configurable auto-verification for cherry-picked PRs#876

Merged
myakove merged 1 commit intomainfrom
feature/configurable-cherry-pick-verification
Oct 20, 2025
Merged

feat: add configurable auto-verification for cherry-picked PRs#876
myakove merged 1 commit intomainfrom
feature/configurable-cherry-pick-verification

Conversation

@myakove
Copy link
Collaborator

@myakove myakove commented Oct 20, 2025

Added configuration option to control automatic verification of cherry-picked PRs, allowing users to disable auto-verification while maintaining backward compatibility (default: true).

Configuration:

  • New auto-verify-cherry-picked-prs boolean config (default: true)
  • Available as global config and per-repository override
  • Cherry-picked PRs are detected via CHERRY_PICKED_LABEL_PREFIX label

Changes:

  • Added auto_verify_cherry_picked_prs property to GithubWebhook class
  • Modified _process_verified_for_update_or_new_pull_request() to check:
    • If PR is cherry-picked (has CherryPicked label)
    • If auto-verify is disabled for cherry-picks
    • Skips auto-verification and sets status to queued if disabled
  • Added CHERRY_PICKED_LABEL_PREFIX import to pull_request_handler
  • Updated schema with new boolean field (global + repo level)
  • Updated example configs with usage examples
  • Added 2 comprehensive tests for both enabled/disabled scenarios
  • Updated README with cherry-pick configuration documentation
  • Updated schema validator to include new boolean field

Backward Compatibility:

  • Default is true (maintains current behavior)
  • Cherry-picked PRs continue to be auto-verified by default
  • Users can opt-out per repository or globally

Testing:

  • test_process_verified_cherry_picked_pr_auto_verify_enabled: Verifies default behavior
  • test_process_verified_cherry_picked_pr_auto_verify_disabled: Verifies disabled behavior
  • All 49 pull request handler tests pass

Summary by CodeRabbit

  • New Features

    • Added configuration option to control automatic verification of cherry-picked pull requests (enabled by default).
    • Introduced new multi-branch cherry-pick command with configurable verification behavior.
  • Documentation

    • Added user-facing documentation for cherry-pick commands and auto-verification configuration controls.

Added configuration option to control automatic verification of
cherry-picked PRs, allowing users to disable auto-verification while
maintaining backward compatibility (default: true).

Configuration:
- New `auto-verify-cherry-picked-prs` boolean config (default: true)
- Available as global config and per-repository override
- Cherry-picked PRs are detected via CHERRY_PICKED_LABEL_PREFIX label

Changes:
- Added auto_verify_cherry_picked_prs property to GithubWebhook class
- Modified _process_verified_for_update_or_new_pull_request() to check:
  * If PR is cherry-picked (has CherryPicked label)
  * If auto-verify is disabled for cherry-picks
  * Skips auto-verification and sets status to queued if disabled
- Added CHERRY_PICKED_LABEL_PREFIX import to pull_request_handler
- Updated schema with new boolean field (global + repo level)
- Updated example configs with usage examples
- Added 2 comprehensive tests for both enabled/disabled scenarios
- Updated README with cherry-pick configuration documentation
- Updated schema validator to include new boolean field

Backward Compatibility:
- Default is true (maintains current behavior)
- Cherry-picked PRs continue to be auto-verified by default
- Users can opt-out per repository or globally

Testing:
- test_process_verified_cherry_picked_pr_auto_verify_enabled: Verifies default behavior
- test_process_verified_cherry_picked_pr_auto_verify_disabled: Verifies disabled behavior
- All 49 pull request handler tests pass
@myakove-bot
Copy link
Collaborator

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest python-module-install - Test Python package installation
  • /retest pre-commit - Run pre-commit hooks and checks
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 1 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, or conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new feature adds configurable auto-verification for cherry-picked PRs across the webhook server. The implementation introduces a boolean configuration flag auto-verify-cherry-picked-prs (default true) at global and repository levels, updates schema validation, modifies the pull request handler to conditionally skip auto-verification when disabled for cherry-picked PRs, and includes corresponding tests and documentation.

Changes

Cohort / File(s) Summary
Configuration Schema
webhook_server/config/schema.yaml
Added auto-verify-cherry-picked-prs boolean field at both top-level and repository-level properties with description and default: true.
Configuration Examples & Manifests
examples/config.yaml, examples/.github-webhook-server.yaml, webhook_server/tests/manifests/config.yaml
Added auto-verify-cherry-picked-prs configuration entries demonstrating both global (true) and repository-level (false) overrides across example configurations.
Documentation
README.md
Added user-facing documentation for cherry-picked PR auto-verification configuration option, multi-branch cherry-pick commands, and control flow for disabling auto-verification.
Core Implementation
webhook_server/libs/github_api.py, webhook_server/libs/pull_request_handler.py
Extended GithubWebhook to load auto_verify_cherry_picked_prs configuration flag and updated pull request handler to detect cherry-picked PRs and skip auto-verification when the flag is disabled.
Test Coverage
webhook_server/tests/test_pull_request_handler.py, webhook_server/tests/test_schema_validator.py
Added two async tests for cherry-picked PR auto-verify behavior (enabled and disabled cases) and extended schema validation tests to recognize the new boolean field.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes follow a consistent pattern across multiple files (adding a new configuration flag), but span diverse file types (schema, config, implementation logic, tests, documentation) and introduce conditional logic in the pull request handler that warrants careful review.

Possibly related issues

Suggested reviewers

  • rnetser
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/configurable-cherry-pick-verification

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78d0576 and 0babb1f.

📒 Files selected for processing (9)
  • README.md (2 hunks)
  • examples/.github-webhook-server.yaml (1 hunks)
  • examples/config.yaml (2 hunks)
  • webhook_server/config/schema.yaml (2 hunks)
  • webhook_server/libs/github_api.py (1 hunks)
  • webhook_server/libs/pull_request_handler.py (2 hunks)
  • webhook_server/tests/manifests/config.yaml (1 hunks)
  • webhook_server/tests/test_pull_request_handler.py (2 hunks)
  • webhook_server/tests/test_schema_validator.py (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@myakove
Copy link
Collaborator Author

myakove commented Oct 20, 2025

/approve
/verified

@myakove myakove merged commit 072d06c into main Oct 20, 2025
7 of 9 checks passed
@myakove myakove deleted the feature/configurable-cherry-pick-verification branch October 20, 2025 10:11
@myakove-bot
Copy link
Collaborator

New container for ghcr.io/myk-org/github-webhook-server:latest published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants