Skip to content

RyanCavanaugh/dt-mergebot

 
 

Repository files navigation

This is the bot which controls the workflow of Definitely Typed PRs.

Meta

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.

ENV Vars

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 bound
  • DT_PR_END - the last PR and then it will be ignored

Setup

# Clone it
git clone https://github.com/DefinitelyTyped/dt-mergebot.git
cd dt-mergebot

# Deps
npm install

# Validate it works
npm test

Running Locally

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

Development

# Build
npm run build

# Run the CLI to see what would happen to an existing PR
npm run single-info -- [PR_NUM]

Tests

# 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •