Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

This is a service that implements the time to merge model (ttm)

License

Notifications You must be signed in to change notification settings

thoth-station/ttm-as-a-service

Repository files navigation

Time to Merge (TTM) as a Service

TTM is a model that classifies a GitHub PR into 1 of 10 time categories ranging from under a minute to over 4 days.

This repo takes the TTM model and turns it into a service. This repo hosts a bot that uses GitHub webhooks to respond to pull requests. Currently, any user that installs the bot is assigned to use the Thoth trained bot. In the future, there will be a flow that auto-trains on an org or set of repos.

Output classes

  • 0-1 mins
  • 1-2 mins
  • 2-5 mins
  • 5-10 mins
  • 10-30 mins
  • < 2 hours
  • 2-8 hours
  • 8-17 hours
  • < 4 days
  • > 4 days

Local Testing

The application is developed using flask. Use the following step to setup local env for Testing.

  1. Install and Set python env. pipenv install pipenv shell
  2. Run the app. python wsgi.py

Deployment

This project is managed with kustomize. Use the following command to deploy on OpenShift cluster. kustomize build manifests/overlays/test | oc apply -f -

Latest Updates

TTM Github App project will not be actively pursued and is being archived. User can use this project going forward if they like to or other option like TTM GitHub action is being implemented and available with the latest information on TTM-related projects can be found over here: https://github.com/redhat-et/time-to-merge-tool

If a user wants to self host the TTM tooling instead of have it run through GitHub servers, follow the steps below:

  1. Train and host model (detailed steps can be found here)
  2. Fork and alter GitHub app's model url located here
  3. Create a Github app and use keys to populate env vars
  4. Host app as desired