Gorrabot is a bot made to automate checks and processes in the development process.

Overview

Gorrabot is a Gitlab bot made to automate checks and processes in the Faraday development.

Features

Check that the CHANGELOG is modified

By default, merge requests MUST create a .md file inside the CHANGELOG/<current_version> folder. We do this because it is easier to write changelog messages after finishing working on the change than before releasing a new version. In the latter, we could easily forget what we did and write a lower quality changelog message.

When somebody publishes a ready to merge MR that didn't touch the changelog, gorrabot automaticaly sets it to WIP (work in process). Then the MR's author is required to touch the changelog, push a new commit and resolve the WIP status from the gitlab web.

Alternatively, if the MR's author doesn't consider useful to add a changelog entry for that change (e.g. when fixing typos or doing small refactors), he/she can add the no-changelog label to the merge request and this check won't be performed to it.

Issue state changing based on MR status

Get the issue related to a merge request by inspecting its source branch name (e.g tkt_community_1234_some_description). Then, when the status of the MR is updated, also update the labels and status of the related issue.

Gorrabot also adds a Closes #1234 text in the description, so GitLab closes the related issue when the MR is merged. Also, when a user sees the issue details he/she will have a link to its corresponding merge request.

Example actions (see the code of sync_related_issue app.py for the exact list):

  • Created WIP MR -> Label issue as accepted
  • Pending merge/approbal MR -> Label issue as test
  • Merged MR -> Close issue and delete status labels (accepted, test)
  • Closed MR -> Delete status labels (set to new)

Sometimes this actions aren't desired, like for example when an issue requires multiple merge requests to be considered as fixed. In this case, you can add the multiple-merge-requests label to the issue and its status and labels won't be modified by gorrabot.

Merge request field completion based on its issue

If a merge request doesn't have an assigned user, derive it from the assigned user of its related issue. Do the same with the MR's milestone.

Branch naming nomenclature check

If the source branch of a merge request doesn't match our nomenclature, note that in a comment. The merge request won't be set to WIP because of this, it is just a warning to avoid doing this the next time.

Merge request title check

When creating a merge request from the gitlab web, by default it derives its title from the source branch name. This is useful in many projects, but in Faraday it can be annoying because of our branch naming conventions.

For example, it wouldn't be useful to have a merge request titled Tkt community 1234 some description. A more concise title would be more helpful. If we wanted, we could know the related issue and target version just by looking at the source and target branches of the MR.

Like with the previous feature, this check will just leave a comment in the merge request if doesn't pass, so the user could avoid this the next time. There is no need to set it to WIP.

Automatic creation of upper versions MRs

When a community feature MR also needs changes in professional, the suggested way to proceed is to create a branch of professional/dev with both the changes of the community MR and the specific changes to professional. Then, open another merge request with target branch professional/dev.

Creating another merge request for the professional feature is tedious, so when the user pushes the professional branch, Gorrabot will detect this is an "upper version MR". Then, it will create a new MR with the same content as the community MR, but with a (professional edition) added in the title to properly differentiate both MRs.

The same thing happens when a professional branch conflicts with upper branches (if exists).

Gorrabot will also notify the user the MR was created. And when the community MR is merged, it will notify the user who merged it so they don't forget about merging the upper version MR too.

Check and report by slack

Gorrabot checks the status of the projects, and give a summary of:

  • Staled MR (both WIP and non-WIP) not update in a given amount of time
  • The accepted issues are less than a boundary
  • There is no issue waiting for a decision.

And gives each developer a summary of undesirable behaviour. Moreover, it gives a summary of the team to the REPORT users.

Staled MR and accepted issues

Based on the default concept of gitlab, this value is obtained by the gitlab API.

Waiting for decision issues

When the waiting-decision label is set in a issue, gorrabot will parse its description and look for a line starting with the prefix WFD: . After that prefix, there should be a comma-separated list of gitlab or slack users, whom decision is expected to resolve the issue.

In the case of gitlab users, you should reference them with an @, as the common gitlab behaviour. In the case of slack users, based on slack API, you should use the email username. E.g. for [email protected] the id is uname not User Name, or any other display name.

Summary of special labels

  • no-changelog: Use this when the merge request consists of a really small check that shouldn't be reflected on the RELEASE.md file See this for more documentation about this
  • multiple-merge-requests: The only label that must be applied to issues instead of merge requests. Avoid gorrabot changing the status and labels of issues labeled with this. See this for more information
  • sacate-la-gorra: A wildcard label that totally disables gorrabot on that merge request. THIS ISN'T RECOMMENDED, SO THINK TWICE WHEN USING THIS
  • waiting-decision: This issue needs a decision be taken before be resolved. See this for more information.

Design goals

Avoid state

To simplify deployment and avoid having to do data migrations, it makes sense to not use a database in this project. Most things can be achieved this way.

For example, lets take the Branch nomenclature check feature. I don't want gorrabot to make a comment each time the merge request is modified, so I need a way to avoid duplicating this kind of comment.

The traditional way to solve this would be to store in a database the merge requests where this comment has already been made. I instead check for the comments of the MR. If there exists a comment similar to what gorrabot wants to comment, return without commenting. When done this way, I don't need to store anything in a database, just use the Gitlab information.

This has some small drawbacks also. For example, if I want to change the text of the comment to something new and a merge request has already a comment with the old version text, there will be two similar comments with different text.

I think this behavior is acceptable for what we're doing, and doing big architecture changes just to fix this kind of things doesn't bring much benefits. Sacrificing simplicity is bad.

Don't replace a CI

The goal of this project is to help us with some things related to our development process, not to our code base itself. For this things, having a continuous integration seems to be a better choice.

Owner
Faraday
Collaborative Penetration Test and Vulnerability Management Platform. We provide specialized services in offensive security.
Faraday
The official command-line client for spyse.com

Spyse CLI The official command-line client for spyse.com. NOTE: This tool is currently in the early stage beta and shouldn't be used in production. Yo

Spyse 43 Dec 08, 2022
A discord bot for checking what linked profiles a user has to their Ubisoft account

ubisoft_discord_profiles A Discord bot for checking what linked profiles a user has to their Ubisoft account. This can be setup using an enviromental

Andrei 1 Dec 17, 2021
Ghostbuster - Eliminate dangling elastic IPs by performing analysis on your resources within all your AWS accounts

Table of Contents Table of Contents Ghostbuster The problem Project Features Ins

Assetnote 182 Dec 24, 2022
[Multithreading] [Proxy - auto & infile]

Discord-Token-Generator-AutoCheck [Multithreading] [Proxy - auto & infile] How to install? pip install -r requirements.txt run generator.py with pytho

Chakeaw__ 3 Oct 17, 2021
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

6 May 16, 2022
A fork of lavalink.py built for nextcord

nextcord-ext-lava is a wrapper for Lavalink which abstracts away most of the code necessary to use Lavalink, allowing for easier integration into your projects, while still promising full API coverag

nextcord-ext 4 Feb 27, 2022
Neubot client

Neubot, the network neutrality bot Neubot is a research project on network neutrality of the Nexa Center for Internet & Society at Politecnico di Tori

Neubot 57 Nov 02, 2021
Who are we? We are the Hunters of all Torrent in this world.🗡️.Fork from SlamDevs

MIRROR HUNTER This Mirror Bot is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. Repo la

Anime Republic 130 May 28, 2022
THE BEST INSTAGRAM AUTO LIKER GET MORE FOLLOWERS WITH THIS AUTOMATION

Hi 👋 , I'm Anandhu Ashok Developer making awesome things for awesome people 🚀 Connect with me: THE BEST INSTAGRAM AUTO LIKER GET MORE FOLLOWERS WITH

Anandhu Ashok 3 Jul 26, 2022
Telegram bot for stream music or video on telegram

KYURA MUSIC Telegram bot for stream music or video on telegram, powered by PyTgCalls and Pyrogram Help Need Help me to translate this repo, click the

0 Dec 08, 2022
Simple Instagram Login Link Generator

instagram-account-login Simple Instagram Login Link Generator Info Program generates instagram login links and you may get into someone´s thought the

Kevin 5 Dec 03, 2022
ServiceX DID Finder Girder

ServiceX_DID_Finder_Girder Access datasets for ServiceX from yt Hub Finding datasets This DID finder is designed to take a collection id (https://gird

1 Dec 07, 2021
A Twitter bot developed in Python using the Tweepy library and hosted in AWS.

Twitter Cameroon: @atangana_aron A Twitter bot developed in Python using the Tweepy library and hosted in AWS. https://twitter.com/atangana_aron Cost

1 Jan 30, 2022
Análise de dados abertos do programa Taxigov.

Análise de dados do Taxigov Este repositório contém os cadernos Jupyter usados no projeto de análise de dados do Taxigov. Conjunto de dados O conjunto

Augusto Herrmann 1 Jan 10, 2022
An incomplete add-on extension to Pyrogram, to create telegram bots a bit more easily

PyStark A star ⭐ from you means a lot An incomplete add-on extension to Pyrogram

Stark Bots 36 Dec 23, 2022
alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API.

alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API. It allows rapid trading algo development easily, with support for both REST and streaming data interfaces

Alpaca 1.5k Jan 09, 2023
Many discord bots serving different purposes

Discord_Botlari Farklı amaçlara hizmet eden bir çok discord botu En kapsamlı Bot Game Bottur. bir oyun botudur discord sunucularında kullanılır. (tüm

1 Dec 21, 2021
Google Search Results via SERP API pip Python Package

Google Search Results in Python This Python package is meant to scrape and parse search results from Google, Bing, Baidu, Yandex, Yahoo, Home depot, E

SerpApi 254 Jan 05, 2023
Clippin n grafting Backend

Clipping' n Grafting Presenting you, 🎉 Clippin' n Grafting 🎉 , your very own ecommerce website displaying all your artsy-craftsy stuff. Not only the

Google-Developer-Student-Club-ISquareIT (GDSC I²IT) 2 Oct 22, 2021
Production Ontology Merging (PrOM) Framework

Production Ontology Merging (PrOM) Framework OWL 2 DL ontology merging framework tailored to the production domain Features preprocessing: translation

4 Nov 02, 2022