constructor()

in functions/src/plugins/merge.ts [11:45]


  constructor(robot: Application, db: FirebaseFirestore.Firestore) {
    super(robot, db);

    // Pushes to the repository to check for merge conflicts
    // TODO(ocombe): disabled for now because of API rate errors
    // this.dispatch('push', this.onPush.bind(this));
    // PR receives a new label
    this.dispatch('pull_request.labeled', this.onPRLabeled.bind(this));
    // PR looses a label
    this.dispatch('pull_request.unlabeled', this.onPRUnlabeled.bind(this));
    // PR updated or received a new status update from another app
    this.dispatch([
      'status',
      'pull_request.synchronize',
      'pull_request.edited' // Editing a PR can change the base branch (not just text content)
    ], this.updateStatus.bind(this));

    // PR review updated or received
    this.dispatch([
      'pull_request.review_requested',
      'pull_request.review_request_removed',
      'pull_request_review.submitted',
      'pull_request_review.dismissed',
    ], this.updateReview.bind(this));
    // PR created or updated
    this.dispatch([
      'pull_request.synchronize',
      'pull_request.opened'
    ], this.onSynchronize.bind(this));
    // PR closed or reopened (but content not changed)
    this.dispatch([
      'pull_request.closed',
      'pull_request.reopened'
    ], this.onUpdate.bind(this));
  }