Giter Site home page Giter Site logo

embezzler's Introduction

Embezzler

Embezzler is a simple script to automatically assign SonarQube issues to authors according to SCM.

Embezzler is a self-contained script that could be easily distributed, it is written in Groovy, uses Grape for SonarQube API dependency.

Status

Bitdeli Badge

Run

# get last unassigned issue and assign it to appropriate user
groovy Embezzler.groovy -s http://localhost:9000 -u login -p password -c 'project1,project2' -n 1 --dry-run false
# get last 5 unassigned issues started from yesterday and assign it to appropriate users
groovy Embezzler.groovy -s http://localhost:9000 -u login -p password -c 'project1,project2' -n 5 -db 1 --dry-run false
# get all unassigned issues started from yesterday and assign it to appropriate users
groovy Embezzler.groovy -s http://localhost:9000 -u login -p password -c 'project1,project2' -db 1 --dry-run false

Usage

groovy main/groovy/Embezzler.groovy --help

usage: groovy Embezzler.groovy -s http://localhost:9000 -u user -p
              password
 -c,--components <arg>          specify list of components (separated by comma)
 -d,--dry-run <arg>             specify to not to perform any action, by default
                                is dry-run
 -h,--help                      print this message
 -n,--number <arg>              specify number of issues to retreive, if not 
                                specified will be queried all issues for whole day
 -db,--days-before <arg>        specify day for which will be queried issues
                                (1 - yesterday, 2 - two days ago and so on), if not 
                                specified issues will be queried without date 
                                relation
 -da,--default-assignee <arg>   specify default user to assign issues on                          
 -p,--password <arg>            specify user password
 -s,--host <arg>                specify SonarQube URL
 -u,--user <arg>                specify user login

Configuration

In order to hide password from console history or script is used with CI server, for example Jenkins, you can specify environment variable SNR_PASSWORD instead of passing password with -p.

export SNR_PASSWORD=mypassword

embezzler's People

Contributors

webdizz avatar travmik avatar t0klian avatar bitdeli-chef avatar

Stargazers

Dan avatar

Watchers

 avatar James Cloos avatar  avatar

embezzler's Issues

Pagination

I might be wrong, but it looks like the script doesn't take the pagination in the results of search query for issues into account.
The code should rather be
List issues = []

IssueQuery query = IssueQuery.create()
.componentRoots(COMPONENT_ROOTS)
.resolved(false)
.severities('BLOCKER', 'CRITICAL', 'MAJOR')
.assigned(false)
.statuses('OPEN', 'REOPENED')

int pages = (issueClient.find (query)).paging().pages()

for (int i=1; i<=pages; i++) {
issues.addAll ((issueClient.find (query.pageIndex(i))).list())
}

Use of Embezzler behind a proxy

Please add a note on usage of Embezzler behind a proxy to documentation, e.g.: if behind a corporate proxy add @GrabResolver (name = 'proxy_name', root = 'proxy_url') as first line in the script. This will save some time for people not familiar with Grape.

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.