Code Monkey home page Code Monkey logo

idli's Introduction

Idli

A command line bug tracker interface

Introduction

Idli is a command line interface to bug tracking tools. The goal is simple. To add a bug to a project, you can visit your bug tracker's website and use the web interface.

I (the author) prefer the command line:

$ idli add --title "The frobnicator is broken." --body "The frobnicator does not frobnicate."

Currently idli allows you to talk to github and trac backends.

WARNING: THIS DOCUMENTATION IS INCOMPLETE

Installation

Standard python install:

$ git clone [email protected]:stucchio/Idli.git
$ cd Idli
$ python setup.py build
$ python setup.py install

Make sure you have the necessary dependencies installed. If you have python 2.7 or greater, you already have them.

Dependencies

Idli requires the following modules:

argparse
json
urllib, urllib2

Note that argparse comes installed with Python 2.7 or greater, and json with Python 2.6 or greater. There is a good chance you already have these libraries.

Usage

Setting up an idli project

To begin, you need to initialize an idli project. The general format for doing this is:

$ cd project_dir
$ idli init BACKEND OPTION1 OPTION2

For example, if the project is hosted on github, you would use:

$ idli init github idli stucchio

This would direct idli set your idli backend to my idli repository.

Some idli commands also require login information:

$ idli config github USERNAME TOKEN

where TOKEN is the github API token (go to https://github.com/account and select "Account Admin").

The idli config command is used to configure global variables, while idli init is used to configure a project.

Using

To add a bug:

$ idli add --title "title of bug" --body "body of bug."
Issue added!

ID: 33
Title: title of bug
Creator: stucchio
Create time: 2010-10-03 14:35:28
Open: True

body of bug.

If the title and body are unspecified, idli will open an editor for you to type them. The specific editor used can be configured via the EDITOR environment variable (note that git uses the same variable).

To tag a bug:

$ ./scripts/idli tag 33 demo
ID: 33
Title: title of bug
Creator: stucchio
Create time: 2010-10-03 14:35:28
Open: True
Tags: demo

body of bug.

Bugs can also be tagged when created with idli add --tags=foo,bar - the resulting issue will have both the tags foo and bar.

To list existing bugs:

$ idli list
ID     date        title                                creator       owner       # comments
11     2010/10/02  warp drive is broken                 kirk                      0
31     2010/10/03  frobnicator is broken                stucchio      stucchio    0
32     2010/10/03  beer in the widgets                  stucchio      homer       3
35     2010/10/03  beer in the frobnicator              stucchio      homer       4
38     2010/10/03  title of bug                         stucchio                  0

To assign a bug:

$ idli assign 11 scotty --message "I need warp drive now."

To comment on an issue:

$ idli comment 11 --body "Keptin, I canna change the laws of physics!"

To list issues owned by you (not supported by all backends):

$ idli list --mine
ID     date        title                                creator       owner       # comments
31     2010/10/03  frobnicator is broken                stucchio      stucchio    0

To list issues with a given tag:

$ idli list --tag=beer
ID     date        title                                creator       owner       # comments
32     2010/10/03  beer in the widgets                  stucchio      homer       3
35     2010/10/03  beer in the frobnicator              stucchio      homer       4

To view a bug in more detail:

$ idli show 11
ID: 11
Title: Frobnicator broken
Creator: stucchio
Create time: 2010-09-21 03:26:57
Open: True
Tags: frobnicator

So very broken.

To resolve a bug:

$ idli resolve 11 --message "Issue resolved by fixing the frobnicator."

Backends vary

Not all features work in all backends. Github, for example, does not support assigning a bug to a user.

Backends

Github

Idli can connect to the bug tracker at github. To use, first you need to configure idli with your github login information:

$ idli config github USER TOKEN

Here, USER is your username and TOKEN is your github API token. The TOKEN can be accessed by logging in to github, proceeding to https://github.com/account and selecting "Account Admin".

This need only be done once per computer.

To initialize a github project:

$ idli init github REPO OWNER

Here, REPO is the name of the repository (e.g., 'idli') and OWNER is the github username of the project owner (e.g., 'stucchio').

If you wish to use a separate USER/TOKEN pair for a specific project, after calling idli init, you can use:

$ idli config --local-only USER TOKEN

This will set the USER/TOKEN for the current project only.

Trac

Trac is much the same is github, but with slightly different parameters:

$ idli config trac USER PASSWORD
$ idli init SERVER PATH

Setting up trac

Idli can be used with trac, but this requires the xmlrpc plugin for trac to be enabled.

First, the xmlrpc plugin for trac must be installed:

$ easy_install -Z -U http://trac-hacks.org/svn/xmlrpcplugin/trunk

The website for the plugin is here: http://trac-hacks.org/wiki/XmlRpcPlugin

Then it must be enabled. This can be done by adding the following to your trac.ini file:

[components]
tracrpc.* = enabled

Lastly, xmlrpc permissions must be given to authenticated users:

$ trac-admin TRAC_DIRECTORY permission add authenticated XML_RPC

Adding new backends

New backends can be added to idli by subclassing idli.Backend. For example, the GithubBackend has the following general structure:

class GithubBackend(idli.Backend):
    name = "github"
    config_section = "Github"
    init_names = { "repo" : "Name of repository",
                   "owner" : "Owner of repository (github username).",
                   }
    config_names = [ ("user", "Github username"),
                     ("token", "Github api token. Visit https://github.com/account and select 'Account Admin' to view your token.")
                     ]

The init_names and config_names parameters are used to create the arguments for idli init and idli config respectively. These parameters can be retrieved using self.get_config(name) (i.e., in a GithubBackend method, one can call self.get_config("repo") to get the name of the reposuitory).

Then, various specific methods must be build:

def add_issue(self, title, body): #Adds issue
    ...Implementation details...

def issue_list(self, state=True): #Returns a list of idli.Issue objects - state is whether they are open or closed
    ...Implementation details...

etc. For a full listing, see the file idli/__init__.py. Any method which raises an IdliNotImplementedException must be overridden (if possible).

To report errors to the user, you should raise an idli.IdliException("error message") from within the backend:

def issue_list(self, state=True):
    ...Implementation details...
    raise idli.IdliException("Github hates us!")

...More details...

idli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

idli's Issues

idli assign

We want to be able to assign bugs to new users (for backends which support it).

Search for bugs

Search functionality would be useful.

In principle, we could create a default implementation which does the search on the local computer (based on listing all bugs).

Cannot list issues in private repos

In spite of correct login token, issues in private repos are not displayed.
We apparently should pass token for all API calls, not just ones that involve modification.

Trac backend is broken

We seem to have broken the trac backend somehow. Error:
$ ./scripts/idli init trac 'localhost:8000' tractest
Initializing trac project.
Traceback (most recent call last):
File "./scripts/idli", line 28, in
cmds.run_command()
File "/home/stucchio/src/idli/idli/commands.py", line 220, in run_command
result = command_runner.run()
File "/home/stucchio/src/idli/idli/commands.py", line 65, in run
self.backend.initialize()
File "/home/stucchio/src/idli/idli/init.py", line 46, in initialize
cfg.set_config_value(section_name, name, self.args.dict[name], global_val=False)
KeyError: ('server', 'URL of trac server.')

add support for https://... Trac servers

hi,

Idli is cool! But our Trac server is running on port behind SSL (https://...) and I can't configure Idli so that it contacts there (I tried: server=my.server:443 but it does not work).

Could you help, please?...

Łukasz

UnicodeEncodeError in Trac with "idli show"

Using trac 0.12, xmlrpc 1.1.2-r11439

$ idli show 7553
Traceback (most recent call last):
File "/usr/local/bin/idli", line 28, in
cmds.run_command()
File "/usr/local/lib/python2.7/dist-packages/idli/commands.py", line 253, in run_command
result = command_runner.run()
File "/usr/local/lib/python2.7/dist-packages/idli/commands.py", line 126, in run
issue, comments = self.backend.get_issue(self.args.id)
File "/usr/local/lib/python2.7/dist-packages/idli/backends/trac.py", line 17, in __wrapped
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/idli/backends/trac.py", line 67, in get_issue
comments = [ self.__convert_comment(c, issue) for c in self.ticket_api().changeLog(int(issue_id)) if c[2] == 'comment']
File "/usr/local/lib/python2.7/dist-packages/idli/backends/trac.py", line 113, in __convert_comment
return idli.IssueComment(issue, str(c[1]), "", str(c[4]), date=c[0])
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 151: ordinal not in range(128)

There does not seem to be any non ascii text in the user entered body or comments, but Trac might be inserting something on its own.

Using Idli commit 275bd17

Tagging support is needed

Most backends allow you to tag issues with keywords.
It would be great to include such functionality in idli.

Search by tag

Give the ability to search for issues with a given tag.

Need comments

We need to add the ability to comment on an issue.

List my assigned bugs

It would be great to get a list of bugs assigned to me, rather than simply all bugs.

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.