This is the bot which controls the workflow of Definitely Typed PRs.
- State: Close to Production
- Dashboard: Azure - Logs - GH Webhook
It is both a series of command line scripts which you can use to test different states, and an Azure Function App which handles incoming webhooks from the DefinitelyTyped repo.
This repo is deployed on every push to master.
To allow for both the old style DT and the new bot to run along-side each other, there is a way to declare that this bot should work with a specific set of PRs:
DT_PR_START
- the lower boundDT_PR_END
- the last PR and then it will be ignored
# Clone it
git clone https://github.com/DefinitelyTyped/dt-mergebot.git
cd dt-mergebot
# Deps
npm install
# Validate it works
npm test
To run and update this repo, you need to have a GitHub API access key in either: DT_BOT_AUTH_TOKEN
, BOT_AUTH_TOKEN
or AUTH_TOKEN
.
Ask Ryan for the bot's auth token (TypeScript team members: Look in the team OneNote).
Don't run the bot under your own auth token as this will generate a bunch of spam from duplicate comments.
# Windows
set BOT_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# *nix
export BOT_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Code-gen the schema
npm run graphql-schema
# Build
npm run build
# Run the CLI to see what would happen to an existing PR
npm run single-info -- [PR_NUM]
# Run tests
npm test
To create fixtures of a current PR:
# To create a fixture for PR 43161
npm run create-fixture -- 43161
Then you can work against these fixtures offline with:
npm test -- --watch