LogoLogo
HomeAbout usSign up
  • Introduction
  • AttentionSet
    • AttentionSet Best Practices
    • How to View AttentionSet for Others
    • How to Manually Change Attention
    • AttentionSet Chrome extension
    • Attention reasons
    • AttentionSet Slack Home Page
  • Releases
    • Getting Started with Releases
    • Concepts for Releases
      • Terminology for Releases
      • Two-step delivery
      • Rollbacks
      • Cherry-picks
      • Dogfood, Canary and Rollout
      • Release notes
    • How-to Guides for Releases
      • How to Create a Release Project
      • How to Configure Environments
      • How to Create a Scheduled Release
      • Create Custom Workflow Parameters
      • How to Manage Cherry-Picks
      • How to Resolve a Cherry-Pick Failure
      • Working with your CI / CD
        • GitHub Actions workflow
        • Buildkite workflow
    • API Reference for Releases
  • FlexReview
    • Getting Started with FlexReview
    • How to Onboard a Large Org
    • Concepts for FlexReview
      • Read-Only Mode in FlexReview
      • Recursive Ownership in FlexReview
      • Reviewer suggestion and assignment
      • FlexReview Teams and SLO Management
      • Validation in FlexReview
    • How-to Guides for FlexReview
      • How to Get a Reviewer Suggestion
      • How to Exclude Reviewers
      • How to Set Up Team Rules
      • Whitelist Teams for Review Assignment
      • Troubleshoot Reviewer Assignment
      • PagerDuty Integration for Reviewers
      • How to Set Up FlexReview Validation
      • Recommended Slack Notification Settings
      • How to Exclude OOO Reviewers
    • FlexReview Reference
      • Configuration
      • Slash commands
      • Expert scoring algorithms
      • Slack Notifications
      • Out of Office User Exclusion
    • FlexReview Roadmap
  • MergeQueue
    • Getting Started with MergeQueue
    • Merge Rules
    • How-to Guides for MergeQueue
      • How to Configure Base Branches
      • How to Customize Required Checks
      • How to Set Up Fast-Forwarding
      • How to Set Up Pre-Queue Conditions
      • How to Queue / Dequeue via API
      • Pause / Unpause Queues via API
      • Slash Commands Using GitHub Comments
      • How to Customize Sticky Comments
      • Require an Aviator Status Check
      • Backport a PR
      • How to Configure ChangeSets
      • Custom Integrations
        • GitHub Integration
      • How to Create Personal Access Tokens
      • How to Set Up SAML Configuration
        • Microsoft Active Directory
      • How to Merge Stacked PRs
      • How to Block Pull Request Mergeing with Slash Commands
    • Concepts for MergeQueue
      • Queue Modes
      • Pull Request Lifecycle
      • Analytics
      • Parallel Mode
      • CI Status Requirements
      • MQ Created Branches
      • Batching
      • Managing flaky tests
      • Fast-forwarding
      • Pre-Queue Conditions
      • Sticky Comments
      • Backporting
      • Paused Queues
      • Affected Targets
        • Directory-Based Affected Targets
        • nx based affected targets
        • GitHub Actions based Affected Targets
      • ChangeSets
        • Global CI Validation
        • ChangeSets FAQs
      • Priority Merges
        • Instant Merges
      • Merge Rules Audit Trail
      • Timeline
      • Ready Hook
      • Reduce Queue Failures From Staleness
    • MergeQueue References
      • Configuration Schema
      • Configuration Reference MergeQueue
      • GitHub Slash Commands
      • Status Codes
  • Stacked PRs CLI
    • Quickstart for Stacked PRs CLI
    • CLI Installation
    • How-to Guides for Stacked PRs CLI
      • How to Create Stacked PRs in CLI
      • How to Navigate & Modify Stacked PRs
      • Add Commits in the Stack
      • How Split a Commit in CLI
      • How to Split and Fold Pull Requests
      • How to Rename a Branch in CLI
      • How to Adopt a Branch in CLI
      • Orphan a Branch with Aviator CLI
      • How to Do Git Subcommand Aliasing
      • How to Create an Access Token
      • How to Set Up Auto Completion in CLI
      • How to Use Editor Plugins in CLI
    • Concepts for StackedPRs CLI
    • How to Rebase and Sync with GitHub
    • Configuration for StackedPRs CLI
    • Stacked PRs FAQs and Troubleshooting
      • Working with Aviator CLI
      • Default Branch Update Master to Main
    • Manpages for Stacked PRs CLI
      • av(1)
      • av-adopt Command Guide
      • av-auth-status(1) in CLI
      • av-stack-branch(1) in CLI
      • av-commit-create(1) in CL
      • av-stack-diff(1) in CLI
      • av-fetch(1) in CLI
      • av-git-interaction Command Guide
      • av-init(1) in CLI
      • av-stack-next(1) in CLI
      • av-orphan Command Guide
      • av-pr-status(1) in CLI
      • av-pr-create(1) in CLI
      • av-stack-prev(1) in CLI
      • av-stack-reorder(1) in CLI
      • av-reparent Command Guide
      • av-restack Command Guide
      • av-commit-split(1) in CLI
      • av-switch Command Guide
      • av-stack-sync(1) in CLI
      • av-stack-tidy(1) in CLI
      • av-stack-tree(1) in CLI
    • Aviator CLI Major Releases
      • Aviator CLI v0.1.0 Release Notes
  • Aviator's Chrome Extension
  • Pilot Automated Actions
    • Scheduled Events
    • JavaScript Execution
    • Pilot Automated Actions Reference
      • GitHub Reference
      • MergeQueue Reference
      • Slack Reference
  • API and Integrations
    • Slack Integration Guide
    • GraphQL API Quickstart
    • Prometheus Metrics Setup for GCP
    • Reference
      • JSON API
      • GraphQL
      • Webhooks
      • Monitoring Metrics
  • Manage
    • Access Management
    • GitHub App Permissions
    • Security
      • Aviator Agents Data Usage & Retention Policy
    • On-Premise Installation
      • GitHub App for On-Prem
      • GitHub OAuth for On-Prem
      • Use Helm Instructions
      • Use Docker Compose Instructions
      • Prometheus endpoint
      • Slack Integration for On-Premise
      • Google SSO Login for On-Prem
    • FAQs
      • Troubleshooting GitHub app connection
      • MergeQueue FAQs
      • Billing FAQs
Powered by GitBook
On this page
  • PullRequest events
  • Payload
  • Actions
  • BotPR
  • Batch events
  • Payload
  • Actions
  • Config change event
  • Sample payload
  • Webhook Signatures

Was this helpful?

  1. API and Integrations
  2. Reference

Webhooks

Get instructions on using webhooks with the Aviator developer collaboration suite. Your app can use webhooks to subscribe to events on your Aviator account.

Your application can use webhooks to subscribe to events happening on your Aviator account.

When configuring a webhook, you can use the UI to choose which event actions will send you payloads. Only subscribing to the specific events you plan on handling limits the number of HTTP requests to your server. You can also subscribe to all current and future event actions. You can change the list of subscribed events anytime.

Each event corresponds to a certain set of actions that can happen on your organization’s repository. For example, if you subscribe to the merge failure event you'll receive detailed payloads every time a PR fails to merge.

PullRequest events

Payload

Each PullRequest webhook event payload contains the following properties.

Key
Description

action

All webhook payloads contain an action property that contains the specific activity that triggered the event.

repository

Name of GitHub repository associated with the action.

organization

Name of the GitHub organization associated with the action.

pr_number

Integer. PR Number associated with the action.

author

GitHub handle of the author of the PR.

status

Current status of the PR. Valid options: open, pending, queued, blocked, merged

skip_line

Boolean. Represents whether the skip line label is present for the PR.

status_code

status_code_text

message

Optional. Present if there is an additional message provided by GitHub on the reason for failure.

failed_ci_list

Optional. List. List of CI names that failed in case of CI failure.

pr_reset_count

Optional. Integer. Number of PRs that were reset due to a reset. This property only exists in a reset action.

closed_bot_pr_count

Optional. Integer. Number of Bot PRs that were closed due to a reset. This property only exists in a reset action.

bot_pull_request

Optional. BotPR. This property only exists in a reset action that is caused by a test failure of a Bot PR.

blocking_pr_numbers

Optional. List of PR numbers that are blocking the current PR. Only available in added_to_batch event.

instant_merge

Actions

Below is the list of actions that can be configured in the MQ UI to receive webhook events.

Name
When it is triggered

opened

When the PR is opened.

labeled

When the Aviator trigger label was added to a PR.

queued

When the PR is queued. This typically happens when the PR is in an approved state and the Aviator trigger label is associated with the PR.

dequeued

When the Aviator label is manually removed from the PR. It is not reported in case of PR failing to merge.

added_to_batch

(Parallel mode only) A PR is added to a batch for validation.

top_of_queue

When the PR reaches the top of the queue for processing.

merged

When the PR is successfully merged.

blocked

When the PR fails to merge and is blocked. The typical reason for failures can be retrieved from status_code, including CI failure or merge conflict.

stuck

(Parallel mode only) When a PR is stuck if the original PR is still running the checks after the specified timeout.

reset

(Parallel mode only) When a parallel PR queue is reset.

BotPR

Below is the BotPR schema embedded in the payload.

Key
Description

github_url

String. The GitHub URL to the Bot PR.

number

Integer. PR Number of the Bot PR.

head_branch_oid

String. The commit hash of the Bot PR.

Batch events

Batch events contain one or more PullRequests that are queued together in a single batch. These events are triggered regardless of configured batch_size.

Payload

Key
Description

action

All webhook payloads contain an action property that contains the specific activity that triggered the event.

repository

Name of GitHub repository associated with the action.

organization

Name of the GitHub organization associated with the action.

pull_requests

A list of pull_requests associated with the batch. Each pull_request object contains pr_number, author, status, skip_line, status_code

message

Optional. Present if there is an additional message provided by GitHub on the reason for failure.

batch_commit_sha

Optional. Represents the SHA associated with the temp branch where the CI validation was run.

Actions

Name
When it's triggered

batch_merged

When a batch of PRs are merged.

batch_failed

When a batch failed to merge.

batch_bisected

When a batch is bisected after a failure. Typically CI check failure in the batch PR would result in bisection when batch_size > 1

Config change event

This webhook is triggered when configuration for a repository is changed. To listen to these webhook events, subscribe to config_change webhook.

Sample payload

{
  "action": "config_change",
  "repository": {
    "name": "mergeit",
    "org": "aviator"
  },
  "history": {
    "modified_by": {
      "email": "email@email.com",
      "gh_username": "jainankit"
    },
    "modified_at": "2022-11-16T17:21:41.350499Z"
    "commit_sha": "85d419bbca585f04456083fd98b7858c0f1e4d13",
    "diff": "-     publish: \"always\"\n+     publish: \"ready\"",
  }
}

The modified_by property contains email and gh_username. If the config was modified from the Dashboard, email of the user would be present, and if the config was modified from the GitHub repo change, a gh_username would be present. commit_sha property may also be only present if the change was made from the GitHub repository.

Webhook Signatures

All webhooks sent by Aviator include a digest signature to verify that the webhook was sent by Aviator itself. The signature is included in a X-Aviator-Signature-SHA256 header and is calculated as the SHA256 of the webhook body using the Aviator account API token as the HMAC key.

In Python, this can be calculated as follows.

compare_signature.py
# The exact HTTP body of the webhook
message_body = "{...}"

# The Aviator API token associated with the account
api_token = "av_live_xxxyyyzzz"

# The signature received in the headers of the webhook request
received_signature = "bbbf25d449dc5f1101d36085b7913dfccce6a9307048ed110d4c70afd83eafd5"

import hashlib
import hmac

signature = hmac.new(
    api_token.encode(), message_body.encode(), hashlib.sha256
).hexdigest()

# Use compare_digest rather than == to prevent timing attacks.
if hmac.compare_digest(received_signature, signature):
    print("Signatures match!")
else:
    raise ValueError("Signatures do not match!")
PreviousGraphQLNextMonitoring Metrics

Last updated 16 days ago

Was this helpful?

Integer. Represents the reason for failure, if there was a failure. See section for all possible options.

String. Represents the reason for failure, if there was a failure. See section for all possible options.

Optional. Boolean. Indicates if the PR was instant merged. See for more info.

Status Codes
Status Codes
Instant Merges