Git Product home page Git Product logo

next-review's Introduction

next-review

Start your next gerrit code review without any hassle.

So you have 10 minutes to spend on code reviews and you want to be as productive as possible. You definitely don't want to spend 9 minutes shuffling through code reviews that Jenkins already hates, you've already reviewed, etc., and you should definitely be looking at that awesome patch that's about to expire due to two weeks of inactivity.

Solution: Use next-review to immediately jump to the "highest priority" code review currently awaiting your gracious downvotes. Inhale some code, articulate your opinion, cast your vote and then move on to your next-review. Got it?

Installation

From PyPi:

$ pip install next-review

Usage

If you can use git-review, you can probably use next-review. Assuming you're watching some projects in gerrit, have an SSH key public key somewhere obvious and your login name matches your gerrit username, you can just do:

$ next-review
https://review.openstack.org/88443 stackforge/python-openstacksdk Add Transport doc

The link will be automatically opened for you, because that's how lazy I am.

You can also abuse the return code to see how many reviews you have left to go until it's time for beer and/or sleep:

$ echo $?
5

Or, you can just view the entire list without automatically opening any links:

$ next-review --list
https://review.openstack.org/88443 stackforge/python-openstacksdk Add Transport doc
https://review.openstack.org/85210 openstack/keystone Fix variable passed to driver module
https://review.openstack.org/89458 openstack/python-keystoneclient Make auth_token return a V2 Catalog
https://review.openstack.org/90943 openstack/keystone Refactor create_trust for readability
https://review.openstack.org/91440 openstack/identity-api Replace non-breaking space

Configuration File

next-review has the concept of a multi-section (ini-style) configuration file. The default location it looks for it is ~/.next_review. In this configuration file the default section is [DEFAULT] and the following options are supported: host, port, username, email, key, and projects. These values will override the defaults, but any cli-arguments that are explicitly set will take precedence over the config file.

If you specify sections other than [DEFAULT] you can use the --config-section argument to specify the section that should be used. If a given option does not exist in the specified section, the parser will look in [DEFAULT] and if the option does not exist in either section, it will fall back to the global defaults. So the order of precedence would be option passed on the command line, options in the section specified by the --config-section argument, options in the [DEFAULT] section, and finally the global defaults.

Philosophy

  1. Older changes should be reviewed first.
  2. If Jenkins is failing a change, then the author has work to do.
  3. If SmokeStack is failing a change, then the author has work to do. If SmokeStack hasn't reviewed a change, that's okay... SmokeStack is lazy, too.
  4. If a change is already blocked by a core reviewer or marked WIP or Draft, then it's not going to merge right now anyway.

next-review's People

Contributors

dolph avatar dstanek avatar jaormx avatar russellb avatar stpierre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

next-review's Issues

Using config file returns extra projects

I have my next_review setting stored away in a configuration file, and it looks something like:

[DEFAULT]
username = ldbragst
email = [email protected]
key = <my_key_location>

[KEYSTONE]
projects = keystone

When I try and grab a review, or a list of reviews, I seem to get a bunch of extra reviews from projects I didn't specify, openstack/puppet-keystone for example;

(next-review) >>> next-review --config-section KEYSTONE -l
https://review.openstack.org/118590 openstack/keystone LDAP additional attribute mappings description
https://review.openstack.org/155260 openstack/python-keystoneclient No keystone Endpoint now gives a valid Error Message
https://review.openstack.org/162465 openstack/keystone Use `region` or `region_id` in a consistent way
https://review.openstack.org/100892 openstack/puppet-keystone Updated wsgi file from openstack/keystone.
https://review.openstack.org/168087 openstack/python-keystoneclient Provide more flexibility in response body handling in GET, PUT & PATCH
https://review.openstack.org/155758 openstack/python-keystoneclient Avoid message concatenation in error path
https://review.openstack.org/168546 openstack/python-keystoneclient Use UUID values in v3 test fixtures
https://review.openstack.org/167687 openstack/python-keystoneclient remove auth_ prefix
https://review.openstack.org/160909 openstack/keystone-specs Service Catalog Subsets by ID
https://review.openstack.org/135774 openstack/keystone-specs Unified Access Info

Am I just using the tool wrong? I've tried with a few different configs. If I am using the tool wrong I'll be happy to update documentation.

Backtrace due to invalid projects

If you attempt to manually specify a project that doesn't exist, a backtrace occurs.

$ next-review asdf
Traceback (most recent call last):
File ".../bin/next-review", line 9, in
load_entry_point('next-review==1.4.0', 'console_scripts', 'next-review')()
File ".../next-review/next_review.py", line 316, in cli
main(args)
File ".../next-review/next_review.py", line 277, in main
reviews = get_reviews(client, args.projects)
File ".../next-review/next_review.py", line 63, in get_reviews
if reviews[-1]['rowCount'] == 0:
KeyError: 'rowCount'

'sortKey' not in response returned by review.openstack.org

When I run next-review, I get the error

Traceback (most recent call last):
  File "next_review.py", line 320, in <module>
    cli()
  File "next_review.py", line 316, in cli
    main(args)
  File "next_review.py", line 277, in main
    reviews = get_reviews(client, args.projects)
  File "next_review.py", line 58, in get_reviews
    query.append('resume_sortkey:%s' % reviews[-2]['sortKey'])
KeyError: 'sortKey'

It seems the resume_sortkey feature was removed in Gerrit 2.9: https://groups.google.com/forum/#!topic/repo-discuss/yQgRR5hlS3E.

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.