pytorch / probot

PyTorch GitHub bot written in probot
ISC License
11 stars 13 forks source link

Add ciflow-bot implementation #40

Closed zhouzhuojie closed 3 years ago

zhouzhuojie commented 3 years ago

Stack from ghstack:


Implementation logic

The implementation can be summarized as the following:

  1. It has a kill switch, so that we can safely redeploy the lambda just in case something went wrong. It also has a list of rollout_users (currently just zhouzhuojie) that are enabled as an allowlist and will only run the bot for this group at the beginning of the rollout.

  2. We are going to handle the following events.

  main(): void {
    this.app.on('pull_request.opened', this.handler.bind(this));
    this.app.on('pull_request.reopened', this.handler.bind(this));
    this.app.on('pull_request.synchronize', this.handler.bind(this));
    this.app.on('issue_comment.created', this.handler.bind(this));
    this.app.on('issue_comment.edited', this.handler.bind(this));
  }
  1. If it's pull_request.* event, it will try to run the default dispatch logic, which adds a ciflow/default label and then signal with assign/unassign event to the main pytorch/pytorch repo.

  2. If it's issue_comment.* event, it first checks if the comment has keyword @pytorchbot ciflow ..., if it does, apply the default dispatch logic and send signals.

Deployment note