Giter Club home page Giter Club logo

banter's Introduction

##Banter

Banter creates code reviews on crucible from the command line.

You can run whatever tool you like which produces a diff and pipe that in to banter to submit that diff for review on crucible.

###Getting Banter Banter is available in the Python Package Index, so you can install it with either easy_install or pip. Here's Banter's page on PyPI.

  • sudo pip install banter or sudo easy_install banter
    • You can get pip on ubuntu/debian by running: sudo apt-get install python-pip

###Setup Before using banter you'll need to let it know where your installation of crucible lives, what your username is, etc. You can run:

$ banter --setup

to start the setup tool which will ask you a few questions. It will ask you to enter your crucible password, but it will not store it. Instead it uses your password to request an auth token from crucible and uses that auth token for the rest of its interactions with crucible. Banter will write its configuration file to $HOME/.config/banter/banter.conf.

###Creating Reviews Provided you have completed the setup you can use banter by doing the following:

$ git diff | banter
http://crucible.dev.company.com/fisheye/cru/CR-15

Banter will create a review from the patch provided to it and print out the URL for the new crucible review. You can access that URL to make any modifications that you need to make and then start the review.

banter's People

Contributors

markdrago avatar marky1991 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

banter's Issues

banter.crucible.Crucible use of staticmethod makes overriding hard

Is there a reason that the Crucible class uses staticmethod everywhere? If you change to a normal method, then a subclass can override these methods. Because they are called like Crucible.get_create_review_payload, instead of self.get_create_review_payload, subclassing to modify won't work.

Crucible.get_auth_token() needs error handling

See traceback below. The underlying problem is a 404 in this case, you probably want to use request.raise_for_status(). As a separate question I'm surprised the url (/rest-service/auth-v1/login) 404s.. banter probably needs handshaking to determine whether or not it is compatible with the remote crucible server

[c12067:~/.virtualenvs/PORTALDEV-24925/src/branches/PORTALDEV-24925/iqh] [PORTALDEV-24925] PORTALDEV-24925 โ€ก banter --setup
Please enter the URL for crucible: http://crucible05.example.com
Please enter the crucible project key: project
Please enter your crucible username: user
Enter a comma-separated list of usernames for anyone you'd like to include on reviews by default: user
In order to get an auth token from crucible, you must enter your password once.
Password:
Traceback (most recent call last):
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/bin/banter", line 11, in
sys.exit(main())
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/banter/banter.py", line 16, in main
setup()
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/banter/banter.py", line 67, in setup
set_crucible_token(updated_conf)
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/banter/banter.py", line 74, in set_crucible_token
token = crucible_conn.get_auth_token(conf['crucible']['username'], conf['crucible']['password'])
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/banter/crucible.py", line 14, in get_auth_token
if response.json() == "" or response.json() is None:
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/requests/models.py", line 805, in json
return complexjson.loads(self.text, **kwargs)
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/simplejson/init.py", line 451, in loads
return _default_decoder.decode(s)
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/simplejson/decoder.py", line 406, in decode
obj, end = self.raw_decode(s)
File "/Users/c12067/.virtualenvs/PORTALDEV-24925/lib/python2.7/site-packages/simplejson/decoder.py", line 426, in raw_decode
raise JSONDecodeError("No JSON object could be decoded", s, idx)
simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)

new files appear in crucible in a different tree than modified files

When the patch gets sent up to crucible there's a leading "a" directory on all modified files. If there are new files they end up under a leading "b" directory. I'm pretty sure this is due to the patch header for new files looking like this:

diff --git a/myfile.java b/myfile.java
new file mode 100644
--- /dev/null
+++ b/myfile.java

I've come up with two options to fix this:

  1. replace /dev/null with the "a" version of the file mentioned on the +++ line
  2. remove all "a"s and "b"s.

Option 2 is preferable if that works out as it will likely make the real paths show up in crucible rather than show any prefixed directory.

My only reservation is that there will now be code in banter which modifies the diff that is being passed through.

400 Error When Creating Review

Edit: After doing some investigation, it turns out that this package doesn't work when the crucible url uses https instead of http. Is that a crucible limitation or a bug in banter?

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.