Skip to content

feat: allow run commands on draft PRs #979

Closed

Description

@jpeimer

Optional config to allow running commands on draft PRs

Activity

  1. myakove commented on Jan 15, 2026

    @myakove
    Collaborator

    Thanks for the feature request! To help scope this properly, could you clarify a few things?

    1. Which commands? Should all commands be allowed on draft PRs, or only a subset (e.g., /retest, /cherry-pick, etc.)?

    2. Configuration scope - Should this be configurable:

      • Globally (all repositories)?
      • Per-repository in .github-webhook-server.yaml?
      • Per-command granularity?
    3. Use case - What's the workflow driving this? (e.g., running tests before marking ready for review, getting early feedback, etc.)

    4. Default behavior - Should the default be to block commands on draft PRs (current behavior) or allow them?

  2. jpeimer commented on Jan 15, 2026

    @jpeimer
    ContributorAuthor
    1. Configurable by user, by default - all commands
    2. Same as all other configurations
    3. Create a draft PR and run build-and-push-container
    4. Yes, block by default
  3. myakove commented on Jan 15, 2026

    @myakove
    Collaborator

    Thanks for the clarification! Here's the proposed implementation plan:

    Implementation Plan

    1. Configuration Schema Update

    Add new option to webhook_server/config/schema.yaml:

    allow-commands-on-draft-prs:
      type: boolean
      default: false
      description: "Allow running commands on draft PRs. Default is false (commands blocked on draft PRs)."

    2. Repository Configuration

    Users can enable in their .github-webhook-server.yaml:

    allow-commands-on-draft-prs: true

    3. Code Changes

    • Update the command handler to check for this configuration before blocking commands on draft PRs
    • When allow-commands-on-draft-prs: false (default): block commands on draft PRs (current behavior)
    • When allow-commands-on-draft-prs: true: allow all commands on draft PRs

    4. Tests

    • Add tests for both enabled and disabled states
    • Verify default behavior (blocked) is preserved

    Deliverables

    • Update config schema with allow-commands-on-draft-prs option
    • Update command handler logic
    • Add unit tests
    • Update example config documentation

    Let me know if this looks good or if you'd like any changes to the approach!

  4. myakove commented on Jan 15, 2026

    @myakove
    Collaborator

    Updated the plan based on feedback:

    Revised Implementation Plan

    1. Configuration Schema Update

    Add new option to webhook_server/config/schema.yaml:

    allow-commands-on-draft-prs:
      type: array
      items:
        type: string
      default: null
      description: |
        List of commands allowed on draft PRs.
        - Not set (null): commands blocked on draft PRs (default behavior)
        - Empty list []: all commands allowed on draft PRs
        - List with commands: only specified commands allowed (e.g., ["build-and-push-container", "retest"])

    2. Configuration Levels (following existing pattern)

    Configuration can be set at three levels (in order of precedence):

    1. In-repo config: .github-webhook-server.yaml in the repository
    2. Per-repo in global config: Under specific repository in config.yaml
    3. Global config: Top-level in config.yaml

    Example in .github-webhook-server.yaml:

    # Allow all commands on draft PRs
    allow-commands-on-draft-prs: []
    
    # Or allow only specific commands
    allow-commands-on-draft-prs:
      - build-and-push-container
      - retest

    3. Code Changes

    • Update command handler to check this configuration
    • When not set (null/missing): block commands on draft PRs (current behavior preserved)
    • When empty list []: allow all commands on draft PRs
    • When list has values: allow only those specific commands on draft PRs

    4. Deliverables

    • Update config schema with allow-commands-on-draft-prs list option
    • Update command handler logic with list-based checking
    • Add unit tests for all scenarios (not set, empty list, specific commands)
    • Update example config documentation
  5. added a commit that references this issue on Jan 16, 2026
    1d352d0
  6. added 2 commits that reference this issue on Feb 16, 2026
    0668c5e
    3b1c060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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