vlanse / pymr

Script to find MRs to review in gitlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

View MRs of interest in gitlab

Installation

Install python 3.

Run the following (maybe you will be asked by pip to enter gitHub credentials)

pip3 install git+https://github.com/vlanse/pymr.git#egg=pymr

Usage

Create pymr-config.yaml like this in your home folder

config:
  gitlab: 'https://gitlab.com'
  token: "gitlab private token"
  team: [dev1_login, dev2_login] # team of interest, see show_only_team option below
  robots: [some-robot-account] # automation accounts usernames, to highlight MRs by API clients with special avatar
  groups:
    project-group-1:
      # per-group setting section
      show_only_my: true  # if only MRs authored by current user are needed for some reason, this overrides show_only_team option
      projects:
        my_amazing_repo:
          id: PROJECT_ID

    project-group-2:
      projects:
        another_repo:
          id: PROJECT_ID_2

    project-group-3:
      show_only_team: true # only team's MRs will be shown
      projects:
        another_repo:
          id: PROJECT_ID_2

If you see error too many open files error consider either reducing number of repos in config, or use ulimit -n <limit> command to increase per-process file handlers limit.

Put gitlab address and access token there, write your projects with their IDs

Run:

mr

Possible result:

mr-result

(in some modern terminal emulators like iTerm MRs captions are clickable links)

Symbols meaning in output:

πŸ›‘ - MR has unresolved conflicts

πŸ’₯ - pipeline has failed

🚦 - pipeline has succeeded, no problems detected

⏳ - waiting for some action

πŸ’€ - MR is too old (> 10d for now)

πŸ’” - MR was approved by current user (you) at some moment earlier, but approve has been removed for some reason

πŸ€– - MR is created by 'robot', see robots section in config

To list available options, run:

mr --help

Installation for development

Install virtualenv package (pip3 install virtualenv).

git clone https://github.com/vlanse/pymr.git && cd pymr
make develop # virtualenv with installed dependencies will be created

mr script will be installed in virtualenv bin folder

About

Script to find MRs to review in gitlab

License:Apache License 2.0


Languages

Language:Python 99.6%Language:Makefile 0.4%