A GitHub bot to submit tips on behalf of contributors

Overview

substrate-tip-bot

A GitHub App built with Probot that can submit tips on behalf of a Substrate based network.

Getting started 🌱

Usage

This bot relies on GitHub pull request that opt in via a body text comment to specify what Substrate network and address to send tips to.

Pull request body

{kusama|polkadot|localtest} address: <SS58 Address>

Followed by a comment on said pull request

Pull request comment

/tip {small | medium | large}

Local development 🔧

To use this bot, you'll need to have an .env file. Most of the options will automatically be generated by the GitHub application creation process, but you will also need to add ACCOUNT_SEED and ALLOWED_USERS.

A reference env file is placed at .env.example to copy over

$ cp .env.example .env

After registering and configuring the bot environment, we can run it. We use Nodemon for hot-reloading, the probot package automatically parses the relevant .env values.

$ yarn start

Docker

To run the bot via Docker, we need to build and then run it like so

$ docker build -t substrate-tip-bot .
$ docker run \
    -e APP_ID=<app-id> \
    -e PRIVATE_KEY=<pem-value> \
    substrate-tip-bot

Contributing

If you have suggestions for how substrate-tip-bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

MIT © 2021 Parity Technologies [email protected]

Comments
  • fetch ALLOWED_USERS from github team

    fetch ALLOWED_USERS from github team

    it doesn't make sense to store ALLOWED_USERS in vault because:

    • we anyway output the list of users who should approve it
    • we don't have visibility and open control for allowed users within org, if some user leaves company or becomes team lead

    In order to simplify managing of allowed users - lets move it under the github team control

    • create a team in GH (something like tip bot approvers or similar)
    • add existing allowed users (as long as they are in ParityTech org) - shawntabrizi, gavofyork, rphmeier, athei, andresilva, arkpar, bkchr, eskimor, drahnr, dvdplm, robbepop, cmichi, tomaka, pepyakin, kianenigma, rossbulat
    • implement dynamic check of allowed user using github api
    opened by mordamax 3
  • Set up the project for deployments on Kubernetes

    Set up the project for deployments on Kubernetes

    • [x] #16
    • [x] Build the container on CI
    • [x] Add Helm charts
    • [x] Add job to deploy Helm charts on CI
    • [x] Create new apps for prod & staging
    • [x] Find out network for staging
    • [x] Create new wallets (for prod & stage)

    Depends on:

    • https://github.com/paritytech/ci_cd/issues/485
    • https://github.com/paritytech/ci_cd/issues/486
    development 
    opened by joao-paulo-parity 3
  • Review Dockerfile

    Review Dockerfile

    • [ ] Use yarn --immutable for installing dependencies (--frozen-lockfile is deprecated) https://github.com/paritytech/substrate-tip-bot/blob/5d55e2cd415ea2866e18e9a505cad0ca3100c2fe/Dockerfile#L13
    enhancement good first issue development 
    opened by joao-paulo-parity 3
  • Moving list of approvers from .env to GitHub team

    Moving list of approvers from .env to GitHub team

    Alongside the feature, following changes were made:

    • Using opstooling-integrations for GitHub interations
    • Upgraded probot, in order to align underlying octokit versions between opstooling-integrations and probot itself
    • Upgraded opstooling-js for the same reason
    opened by mutantcornholio 2
  • ES6 support in app and tests

    ES6 support in app and tests

    • ES6 support in Dockerfile
    • Migrated from jest to mocha as it's more ES6 friendly, similar API as Jest and far more performent
    • Dropping yarn support - These days npm has reclaimed the Node package manager title back from Yarn, we can achieve better and more consistent results with npm, for example, version tagging, package upgrades, lock file installs

    If these PRs are getting annoying @shawntabrizi, let me know (or if I can just merge them), I have a few more coming before I work on features

    opened by azerella 2
  • Server Error Crash

    Server Error Crash

    Ran into this one today:

    INFO (server): POST http://localhost:3000/ - 200                               
    ERROR (server):
        type: "error"
    ERROR (server):
        type: "error"
        status: 520
        message: ""
    

    Needed to restart the bot.

    bug 
    opened by shawntabrizi 1
  • Introducing project linting

    Introducing project linting

    I haven't specifically run the linting over index.js as I intend to refactor this file and introduce ES6 JS features in following PRs.

    Aiming to make these PRs as small as possible for visibility and ease of review

    enhancement 
    opened by azerella 1
  • [ci] deploy from new runners

    [ci] deploy from new runners

    Also changed deploy to k8s job so it's no needed to restart the whole pipeline for re-deploying the app

    cc https://github.com/paritytech/ci_cd/issues/544

    opened by alvicsam 0
  • [ci] Add helm chart

    [ci] Add helm chart

    @mordamax need your help here: what env variables should be added to helm? are there any secrets?

    Close https://github.com/paritytech/ci_cd/issues/486

    opened by alvicsam 0
  • [ci] Add .gitlab-ci and CODEOWNERS

    [ci] Add .gitlab-ci and CODEOWNERS

    PR adds .gitlab-ci.yml, CODEOWNERS and adds labels to Dockerfile. Helm charts will be added in a different PR

    Close https://github.com/paritytech/ci_cd/issues/485

    opened by alvicsam 0
  • Apply opstooling-js and opstooling-js-style

    Apply opstooling-js and opstooling-js-style

    No behavior in the tipping use-case is intended for this pull request, it only affects how the code is written and organized. Also note that conforming the module structure to https://github.com/paritytech/opstooling/pull/100 is out of scope for this pull request.

    This PR

    • Applies https://github.com/paritytech/opstooling-js and https://github.com/paritytech/opstooling-js-style
    • Adjusts the code so that it conforms to the linting rules
    • Adds GHA for linting so that linting rules are respected going forward
    • Remove tests because they're useless

    TODO

    • [x] Try it out and see if it's working

    close #13

    opened by joao-paulo-parity 0
  • Do not show error trace to the user

    Do not show error trace to the user

    The bot currently is posting the full error context into a github comment. As an example see here: https://github.com/paritytech/substrate/pull/12723#issuecomment-1321700543

    It should only post:

    @bkchr ERROR: Error: Contributor did not properly post their account address.
    
    Make sure the pull request description has: "{network} address: {address}".
    
    opened by bkchr 0
  • [Tip Bot V2] Make Tip Bot Asynchronous

    [Tip Bot V2] Make Tip Bot Asynchronous

    There are a bunch of ideas that we can do to take the tip bot to the next level:

    • Allow users to submit their associated address ahead of time, either through some local DB or maybe just easier to maintain a JSON file which people can submit PRs to.
    • Automatically pick the size of the tip based on the "Size of issue" tag on the PR
    • Introduce new tag "tip" which allows the tip bot to execute on that PR
    • Allow anyone (mainly the contributor) to trigger a tip one time, given the appropriate tags, the bot will execute
    • Maybe a new tag "tip-paid" used to signal that the tip was paid.

    This will improve the process for getting tips for good PRs. We can passively add this tag, and the users can themselves trigger the tip bot, rather than waiting for us to do it.

    The only issue might be that we may not want to allow ANYONE to add a tip tag to the PR. Is it possible to limit certain kinds of tags?

    opened by shawntabrizi 1
  • Add metrics endpoint

    Add metrics endpoint

    This will only be really useful after we've deployed it to our infrastructure (#18).

    Enable a /metrics endpoint. We can base ourselves in some metrics from https://github.com/paritytech/substrate-matrix-faucet/blob/82728e9e91e1978dbd623c616fe8e8c53dd8c7a7/src/server/routes/metrics.ts such as

    • Balance of the tipper account
    • RPC timeout, disconnection, error counts
    • Number of requests sent
    enhancement 
    opened by joao-paulo-parity 0
  • Enforce linting rules on CI

    Enforce linting rules on CI

    Either use a GitLab job for this (as demonstrated in https://github.com/paritytech/pr-custom-review/blob/4066ef64c8633fbc9a1b08a4d9442a784253f49a/.gitlab-ci.yml#L66 and https://github.com/paritytech/pr-custom-review/blob/4066ef64c8633fbc9a1b08a4d9442a784253f49a/.gitlab-ci.yml#L154) or a GitHub action (https://github.com/paritytech/opstooling-js-style/blob/a5b700ed4586dfead0ce3b5f7ff5d74f15b66cde/.github/workflows/pre-commit.yml#L49).

    development 
    opened by joao-paulo-parity 0
  • Recover from connection drops

    Recover from connection drops

    From @shawntabrizi on Matrix

    2022-02-21 14:27:26          API-WS: disconnected from wss://[kusama-rpc.polkadot.io/](http://kusama-rpc.polkadot.io/): 1006:: Connection dropped by remot$
     peer.                                                                                                                   
    2022-02-21 14:39:14          API-WS: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropped by remote peer. 
    2022-02-21 14:39:14        RPC-CORE: health(): Health:: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropp
    ed by remote peer.
    2022-02-21 14:44:48          API-WS: disconnected from wss://[kusama-rpc.polkadot.io/](http://kusama-rpc.polkadot.io/): 1006:: Connection dropped by remote
     peer.
    2022-02-22 14:20:20          API-WS: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropped by remote peer.
    2022-02-22 14:38:16          API-WS: disconnected from wss://[kusama-rpc.polkadot.io/](http://kusama-rpc.polkadot.io/): 1006:: Connection dropped by remote
     peer.
    2022-02-22 14:38:16        RPC-CORE: health(): Health:: disconnected from wss://[kusama-rpc.polkadot.io/](http://kusama-rpc.polkadot.io/): 1006:: Connectio
    n dropped by remote peer.
    2022-02-22 14:59:58          API-WS: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropped by remote peer.
    2022-02-22 14:59:58        RPC-CORE: health(): Health:: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropp
    ed by remote peer.
    2022-02-22 15:29:49          API-WS: disconnected from wss://[kusama-rpc.polkadot.io/](http://kusama-rpc.polkadot.io/): 1006:: Connection dropped by remote
     peer.
    2022-02-22 16:20:33          API-WS: disconnected from wss://[rpc.polkadot.io/](http://rpc.polkadot.io/): 1006:: Connection dropped by remote peer.
    
    bug 
    opened by joao-paulo-parity 1
Owner
Parity Technologies
Solutions for a trust-free world
Parity Technologies
A multipurpose bot, a clan bot, a all in one bot. The one bot u need for ur server originally made as Milrato discord Bot and by Tomato6966.

Public Bot and Support Server! Invite the Public Version of this Bot so you don't need to host it by yourself or join my Discord server to get a custo

Tomato6966 472 Dec 25, 2022
New base bot WhatsApp 🈴 bukan self bot lagi atau buka bot yang bisa di pakai oleh bot sendiri 😎

Installation • Thanks to • Donate Official Group Bot • Settings Instalasi Heroku Buildpack Click the deploy icon below ! > heroku/nodejs > https://g

zeeone 27 Feb 9, 2022
Discord-Bot - You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have published on my youtube channel.

Discord-Bot You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have publishe

Umut Bayraktar 114 Jan 3, 2023
It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with buttons. It can play youtube songs, playlists. This bot code was made by Supreme#2401. It uses djs V12

Lofi-Radio-Music-Bot It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with butt

Diwas Atreya 89 Jan 2, 2023
Ini Adalah Tools Bot WhatsApp,Pengodean Ulang Dari Sc Bot Kanna Bot

Node Modules Belum Selesai Unduh File Bot Lengkap Node Modules Click Here Lord Bot FOR DEPLOY HEROKU USER Instal Buildpack heroku/nodejs https://githu

Creator Lord-Botz 8 Jul 1, 2022
This bot can raise your mood. This bot send joke often our channel for users. Sometimes bot don't work because we have not server for this project...)

Hi, welcome to send-joke-bot telegram bot project ?? What can do this bot ? This bot can raise your mood. This bot send joke often our channel for use

Muhammadamin 5 Sep 26, 2022
A bot Similar to the reaction roles discord bot, but free. Written in JavaScript, and uses MongoDB.

Discord Reaction Roles bot About • Features • Installation • Setting Up About An open source reaction roles bot to anyone who needs one in their serve

null 52 Dec 22, 2022
Açık kaynaklı bir discord bot list botu. Bot list sunucularına özel yapılmıştır. Tanıtım videosu MoTion42 Kanalında bulunuyor. Umarım beğenirsiniz.

?? Bot Bilgilendirme Açık kaynaklı bir discord bot list botu. Bot list sunucularına özel yapılmıştır. Tanıtım videosu MoTion42 Kanalında bulunuyor. Um

`Motion 1 Sep 11, 2021
Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram.

Unimore-Bot Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram I

Lorenzo Codeluppi 8 Jun 9, 2022
A Discord bot library to make the development of a bot a little bit easier.

Discord Bot Framework (DBF) A basic Discord bot framework to allow for easier creation of bots. With this library, you can easily parse and handle com

Yoo-Babobo 1 Dec 23, 2021
SlashCommands-Bot - An advanced discord bot, with Slash Commands !

SlashCommands Bot Github post is a discord bot handler with slashcommands in v13 How to install ? You need to have Node.JS 16+ git clone https://githu

null 9 Nov 16, 2022
Revoltchat-bot - Revolt.chat bot template

revoltchat-bot Revolt.chat bot template made with Typescript Setup Guide Clone this repository git clone https://github.com/debert-jamie/revoltchat-bo

Debert Jamie 3 Jan 2, 2023
BOT-TABELA-FIPE - BOT que busca na API da FIPE todas as marcas e seus respectivos modelos e anos.

BOT-TABELA-FIPE BOT que busca na API da FIPE todas as marcas e seus respectivos modelos e anos. O BOT trabalha de maneira assíncrona, assim, torna mui

Cristian Vaghetti 1 Jan 3, 2022
Discord.js bot v13. Russian bot

Nutella-bot Discord.js bot v13. Russian bot Бот создан в России, он набирал популярность среди многих серверов. Завоевал 42 тысячи пользователей, и бы

null 6 Jun 5, 2022
PancakeSwap Prediction Bot [Fullversion]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

?? PancakeSwap Prediction v1.0.0 ?? This bot wins the majority of rounds on PancakeSwap & CandleGenie based. This bot survived the beta and is now in

null 82 Dec 23, 2022
nganu bot, multi device based simple whatsapp-bot with social media downloader

nganu A Simple Multi-Device WhatsApp Bot simple whatsapp-bot using baileys-md to download social media post and many features Install set instagram se

Muhamad Ristiyanto 28 Nov 20, 2022
This bot is a cool Discord bot made in discord.js using Node.JS

Anti-Crosspost Discord Bot This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple c

Muhammad Usman Mithani 4 May 31, 2022
Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot that handles all your server needs.

Welcome to Co-Pilot Bot repo! ?? ?? Co-Pilot (All-in-one Discord Bot) Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot

YMafalha 19 Nov 11, 2022
Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total contributions.

Remoklify - Gitlift Discord Bot Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total

Remoklify 3 Mar 20, 2022