Skip to content

feat: support user-defined custom commands in PR welcome message #1132

Description

@rnetser

Problem

Currently, the PR welcome message only displays built-in commands (/retest, /cherry-pick, /lgtm, /approve, etc.). Some teams have external tooling, bots, or workflows that respond to custom PR comment commands (e.g., /deploy-staging, /run-integration-tests, /preview). There's no way to document these in the welcome message, so contributors either don't know about them or maintainers have to manually explain them.

Proposed Solution

Add a custom-commands configuration option (global and per-repo) that lets users define custom commands with descriptions. These are rendered in a new Custom Commands section in the PR welcome message.

Config example (in config.yaml or .github-webhook-server.yaml):

custom-commands:
  - name: deploy-staging
    description: Deploy this PR to the staging environment
  - name: run-e2e
    description: Trigger end-to-end test suite against this PR
  - name: preview
    description: Generate a preview deployment URL

Welcome message output (new section under "Available Commands"):

#### Custom Commands
* `/deploy-staging` - Deploy this PR to the staging environment
* `/run-e2e` - Trigger end-to-end test suite against this PR
* `/preview` - Generate a preview deployment URL

Key design points:

  • These are documentation-only — the server renders them in the welcome message but does NOT process them as commands. External bots/tools handle them independently.
  • Section is only rendered when custom-commands is configured and non-empty.
  • Supports both global config and per-repo override.

Affected Files

File Change
webhook_server/config/schema.yaml Add custom-commands schema definition
webhook_server/libs/handlers/pull_request_handler.py Add _prepare_custom_commands_welcome_section property, include in _prepare_welcome_comment()
examples/config.yaml Add commented example

Done

  • Add custom-commands schema to webhook_server/config/schema.yaml
  • Add _prepare_custom_commands_welcome_section property to PullRequestHandler
  • Include custom commands section in _prepare_welcome_comment()
  • Add commented example to examples/config.yaml
  • Tests for the new welcome section (present when configured, absent when not)
  • Schema validation tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions