Skip to content

PyTorch bot

Danylo Baibak edited this page Apr 12, 2023 · 2 revisions

PyTorch bot is a GitHub app, build on top of probot framework.

Bot codebase is located in https://github.com/pytorch/test-infra/tree/main/torchci/lib/bot

If installed can be used to accomplish following:

Bot comment interface

One can communicate with bot, by issuing specially crafted commands, such as "merge", "revert", "rebase" and "drci". For more information on how those are used in PyTorch, see https://github.com/pytorch/pytorch/wiki/Bot-commands

Auto CC bot

Used to notify interested users when label is assigned to an issue or a pull requests.

Label to users mappings are defined in the special issue, whose number is specified via tracking_issue property of pytorch-probot.yaml config file. Mappings are defined in the issue body as series of * label @yourusername lines

Auto label bot

As name suggests, assign labels to a pull requests depending on what files were touched by it

CIFlow bot

Can be used to schedule additional workflows based on the ciflow/ prefixed labels assigned to the pull request. When label is added to the pull request, bot creates a ciflow/${name}/${pr_numer} tag that points to a pull request head, and expects that repository contains a workflow that will be trigged upon tag creation. For example, PyTorch periodic workflow defines its dispatch rules as follows:

on:
  schedule:
    - cron: 45 0,4,8,12,16,20 * * *
  push:
    tags:
      - ciflow/periodic/*
  workflow_dispatch:

As names of the rules are frequently changed, bot will not assign a tag unless it's listed in the pytorch-probot.yaml via ciflow_push_tags property. Following script can be used to extract known labels from workflows and add them to the config file: https://github.com/pytorch/pytorch/blob/master/.github/scripts/collect_ciflow_labels.py

Enable Dr. CI for new repo

To enable Dr. CI for the new repo, you need two things to be done:

  1. Contact the PyTorch DevX team to enable CI/CD workflow data to be sent to Rockset.
  2. Contact the PyTorch Release Engineering team to enable Dr. CI for the particular repository.