Giter VIP home page Giter VIP logo

ttm-as-a-service's Introduction

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

ttm-as-a-service's People

Contributors

gkrumbach07 avatar goern avatar harshad16 avatar khebhut[bot] avatar sesheta avatar shreekarss avatar

Watchers

 avatar  avatar  avatar

ttm-as-a-service's Issues

No version identifier found in sources to perform a release

Automated version release could not be completed.

Kebechet version manager expects a file with one of the following names: ["setup.py", "__init__.py", "__about__.py", "version.py", "app.py", "wsgi.py"] to contain the line:

...
__version__ = X.Y.Z
...

where X.Y.Z is the current semantic version. To fix this issue, add this line to one of these files. If none of these
files exist create one somewhere in your repository.

Related: #5

[2pt] Create a GitHub Webhook Application in Thoth

Create a Github webhook app in the Thoth org. This will be replacing the current app located under @Gkrumbach07.

Acceptance Criteria

  • create new Github App under thoth org
  • update/create secrets in ttm-as-a-service namespace based on github app values
    • GITHUBAPP_ID: App ID: ######
    • GITHUBAPP_SECRET: must generate new client secret
    • GITHUBAPP_KEY: must generate new secret key
  • enable webhooks and set the webhook url (relies on hosted service)

New minor release

Hey, Kebechet!

Create a new minor release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a minor release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

Failed to read env GITHUBAPP_KEY variable

Bug description

Failed to read GITHUBAPP_KEY private key which is set in .env file

ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497574, lib=9, reason=102, reason_text=b'error:04800066:PEM routines::bad end line')])

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set up ttm as service github app to the repo which needs prediction
  2. Open pull request with the desired changes

Actual behavior

Error from github app Recent Deliveries:

<!doctype html>

<title>500 Internal Server Error</title>

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Error from Webhook server:

ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497574, lib=9, reason=102, reason_text=b'error:04800066:PEM routines::bad end line')])
127.0.0.1 - - [08/Sep/2022 17:04:31] "POST / HTTP/1.1" 500 -

Expected behavior

To parse the ENV variables successfully and run webhook server for pull request event and comment on the PR with prediction

New patch release

Hey, Kebechet!

Create a new patch release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a patch release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

New minor release

Hey, Kebechet!

Create a new minor release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a minor release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

New patch release

Hey, Kebechet!

Create a new patch release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a patch release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

New patch release

Hey, Kebechet!

Create a new patch release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a patch release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

New patch release

Hey, Kebechet!

Create a new patch release, please.

IMPORTANT NOTES

  • If Khebut GitHub App Bot is installed, this issue will trigger a patch release. The bot will open a Pull Request to update the CHANGELOG, fix the opened issue and create a tag.

  • Only users that are allowed to release (a.k.a. maintainers specified in the .thoth.yaml file) can open the issue, otherwise bot will reject them, commenting and closing the issue. If AICoE CI GitHub App is installed, once the pull request is merged and a new tag is created by the bot, the pipeline to build and push image starts.

[5pt] Setup Argo workflow to deploy TTM bot to operate first namespace

Setup Argo workflow in Operate First to deploy to TTM namespace.

Current resources

Acceptance Criteria

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.