databricks / spark-pr-dashboard

Dashboard to aid in Spark pull request reviews
spark-prs.appspot.com
Apache License 2.0
54 stars 46 forks source link

[SPARK-6481] Start JIRA issue progress #49

Closed nchammas closed 9 years ago

nchammas commented 9 years ago

This patch lets the dashboard mark a JIRA as in progress when a PR against it is opened.

nchammas commented 9 years ago

@JoshRosen I'll need your help testing this.

Is there a way to directly invoke start_issue_progress() with arbitrary input to test things out?

JoshRosen commented 9 years ago

@nchammas, I think you should just be able to import the function from that module and call it to test things out, e.g. from sparkprs.jira_api import start_issue_progress in a Python shell that has the sparkprs module on its classpath. It's been a while since I've done this, but you might end up running into some issues when importing things without the Appengine SDK classes on your PYTHONPATH. If you give me a little bit, I can try to dig up the command that I use to configure things for this sort of local testing.

nchammas commented 9 years ago

OK lemme know. I've tested the dashboard UI before (using the README instructions), but loading Python functions directly with a working environment is new to me for this type of project.

JoshRosen commented 9 years ago

Started testing this locally.

Here's what I did, from inside of the root spark-pr-dashboard directory in my local checkout:

export CURRENT_VERSION_ID=test
export PYTHONPATH=`pwd`/lib:`pwd`
python

And then:

>>> from sparkprs.jira_api import start_issue_progress
>>> start_issue_progress("SPARK-6481")
WARNING:root:Could not start progress on JIRA issue SPARK-6481. It's currently in an 'In Progress' state. Issues must be in an 'Open' state.
#
# re-assigned to myself and stopped progress
#
>>> start_issue_progress("SPARK-6481")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sparkprs/jira_api.py", line 39, in start_issue_progress
    jira_client.transition_issue(issue=issue, transition=transition_id)
  File "/Users/joshrosen/anaconda/lib/python2.7/site-packages/jira/client.py", line 52, in wrapper
    result = func(*arg_list, **kwargs)
TypeError: transition_issue() takes at least 3 arguments (2 given)

I think the problem is that the second parameter is actually named transitionId in my version of the jira_client library.

JoshRosen commented 9 years ago

EDIT: updated the above testing command to include our libraries ahead of system versions:

export PYTHONPATH=`pwd`/lib:`pwd`
JoshRosen commented 9 years ago

Apart from my comments above, this looks great. Once we fix those issues, merge this, and verify that it also works in production, I can bust the ETag cache and start a bulk update in order to update progress on all of the existing issues.

nchammas commented 9 years ago

OK, I think this can go for another test.

nchammas commented 9 years ago

Argh, I think I need to setup a virtualenv and install all the dependencies separately, since it looks like I also have a version of Flask that doesn't work with this project.

>>> from sparkprs.jira_api import start_issue_progress
Traceback (most recent call last):
...
ImportError: No module named flask.ext.cache
JoshRosen commented 9 years ago

flask.ext.cache is a Flask addon library that should be installed with the rest of the deps listed in requirements.txt (Flask-Cache==0.13.1).

nchammas commented 9 years ago

Hmm, so I tried this, which should set me up with everything I need:

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt 

Now I'm getting a different import error about memcache... Are we perhaps missing a requirement?

JoshRosen commented 9 years ago

@nchammas Could you post the stacktrace showing where the import error is occurring?

nchammas commented 9 years ago

So I started over without virtualenv and now I'm hitting this error... Lemme figure this out. sigh

JoshRosen commented 9 years ago

Import errors aside, this looks good to me. If you don't have any objections, I'd like to merge this now and push it to the live site to test it there.

nchammas commented 9 years ago

Sounds good to me. I'm still fighting with the new pip install errors...