Coder Social home page Coder Social logo

joshghent / pullb0t Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 136 KB

🤖Bot for posting new Gitlab Merge requests to a Slack Webhook with automatic JIRA integration

TypeScript 96.66% Dockerfile 2.37% Shell 0.98%
bot gitlab slack jira merge-request pull-requests

pullb0t's Introduction

sample message

Pullb0t

A bot for posting new Gitlab Merge requests to a Slack Webhook with automatic JIRA integration

Developed with ❤️ by CloudCall



Features

  • Automatically detect JIRA ticket numbers in the branch name or commit message
  • Post all new non-WIP merge requests to a given Slack Webhook URL

Setup

Environment Variables

The bot requires a few config options. Here's how to get them

JIRA Details

It is recommended you create a new "bot" user account and assign it global admin privileges (so it can view all boards)

JIRA_URL="company.atlassian.net" - Note the lack of the http/https!
JIRA_USERNAME="bot" - the JIRA username used to query the API
JIRA_PASSWORD="password" - the JIRA password for the above user

Slack

  1. Add the "Incoming Webhook" integration
  2. Add a new configuration - setup where the webhook messages will go, and the user they will be posted as
  3. Copy the "Webhook URL" on the page

Gitlab

GITLAB_URL="https://git.company.gitlab.com" - Just the URL for your git instance

Standard

  1. Clone the project - $ git clone https://github.com/joshghent/pullb0t.git
  2. Copy of the .env.example file and fill in the details
  3. Run npm start!

Docker

docker run -d --restart always \ --name pullb0t \
  --env JIRA_URL="company.atlassian.net" \
  --env JIRA_USERNAME="botuser" \
  --env JIRA_PASSWORD="password" \
  --env SLACK_WEBHOOK_URL="HOOK_URL" \
  --env GITLAB_URL="GITLAB_URL" -p 1337:3000  joshghent/pullb0t:latest

Bugs

Please create a new issue here

License

MIT - CloudCall

Author

Josh Ghent on behalf of CloudCall

pullb0t's People

Contributors

dependabot[bot] avatar joshghent avatar mrrefactoring avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pullb0t's Issues

Add Dashboard

Dashboard should contain

  • List of open PR's
  • How long those PR's have been open

Add leaderboard

Add leaderboard to the UI of who has upvoted the most MR's, break down the report by all time or by this week

Add settings

When they want the PR reminders to trigger by day of the week and time.

Add analytics

Add Analytics tab to the UI with reports on average PR open time, upvote times (like when people approve PR's more)

Add verification of the X-Gitlab-Token

If a GITHUB_SECRET is set in env then check if it matches the Secret token that is passed in the X-Gitlab-Token header that is sent with new webhook messages

Create way to bring back old MR's

Run a job scheduler backed by Mongo

Changes:

  • New MR's should be recorded in Mongo to know how many times we've posted the MR
  • If an MR is found in the Mongo DB already then increment the number of times it has been posted
  • Every 8 hours, run a job that
    • Goes through the DB and clean all the ones that have been upvoted or merged and are less than a month old and it has been posted less than 5 times
    • Sends any that haven't been cleared out to the webhook again for processing

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.