MetricsGrimoire / Bicho

Bicho is a command line based tool used to parse bug/issue tracking systems
http://metricsgrimoire.github.com/Bicho/
GNU General Public License v2.0
68 stars 30 forks source link

Can't use non-mysql output database when using jira backend #157

Closed benmishkanian closed 8 years ago

benmishkanian commented 8 years ago

It seems that when using a JIRA backend, the output database must be MySQL, or else bicho crashes. For example, if I try to use postgresql:

bicho --db-user-out=postgresusername --db-password-out=postgrespassword --db-database-out=bicho --db-driver-out=postgresql -d 15 -b jira -u "https://issues.apache.org/jira/browse/CASSANDRA" -g

I get this:

Checking URL: https://issues.apache.org
No account provided.
DBG: [22/Nov/2015-16:49:58] Bicho object created, options and backend initialized
Running Bicho with delay of 15 seconds
No account data provided. Not logged in Jira
Traceback (most recent call last):
  File "/home/bmishkan/.local/bin/bicho", line 25, in <module>
    retval = bicho.main.main()
  File "/home/bmishkan/.local/lib/python2.7/site-packages/bicho/main.py", line 56, in main
    backend.run()
  File "/home/bmishkan/.local/lib/python2.7/site-packages/bicho/backends/jira.py", line 932, in run
    bugsdb.insert_supported_traker("jira", "4.1.2")
AttributeError: 'NoneType' object has no attribute 'insert_supported_traker'

bugsdb is initialized by get_database(backend), which only returns something if opts.db_driver_out == "mysql". So when a different DB type is chosen, bugsdb is None and causes this crash.

sduenas commented 8 years ago

Currently, Bicho doesn't support PostgreSQL and I'm afraid it won't be supported any time soon.

benmishkanian commented 8 years ago

I see. Thank you for the response. I think it might be useful for other users if this missing functionality was documented in the project readme, or in the help description of --db-password-out.

jgbarah commented 8 years ago

I think it might be useful for other users if this missing functionality was documented in the project readme, or in the help description of --db-password-out.

I agree. Right now in README we have:

  • mysqldb or psycopg2 or pysqlite2 (unstable with PostgreSQL; MySQL is recommended - default engine should be set to MYISAM)

I suggest that we change this, removing the references to psycopg2 (and maybe pysqlite2) and to PostgreSQL, and include a new text stating that the data is stored only in MySQL.

@sduenas what do you think? If you agree, I can do the change.

sduenas commented 8 years ago

@benmishkanian sorry for the misunderstood, I didn't know that this was in the documentation.

@jgbarah go ahead, please

jgbarah commented 8 years ago

Done in a07cf9c31f6dba2b56b4c9b11518920675d3684b.

@benmishkanian please close if you think it is clear enough now.

jgbarah commented 8 years ago

Closing...