Coder Social home page Coder Social logo

hamster-bridge's People

Contributors

darignac avatar kraiz avatar mmrose avatar next-mad-hatter avatar omarkohl avatar toggm avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hamster-bridge's Issues

Exception-Logging not functional

2013-05-06 07:52:27,810    INFO: Starting new HTTP connection (1): proxy.domain.com
Traceback (most recent call last):
  File "/home/alex/virtualenvs/hamster-bridge/bin/hamster-bridge", line 8, in <module>
load_entry_point('hamster-bridge==0.0.1', 'console_scripts', 'hamster-bridge')()
  File "/home/alex/virtualenvs/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 29, in main
bridge.run()
  File "/home/alex/virtualenvs/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/bridge.py", line 72, in run
listener.on_fact_stopped(fact)
   File "/home/alex/virtualenvs/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/listeners/jira.py", line 44, in on_fact_stopped
logger.exception()
TypeError: exception() takes at least 2 arguments (1 given)

better logging

We should provide a better logging for a few things:

  • Log the workflow ids that has been created, so that this items can be looked up in problem cases (see #10)
  • Log the listeners server url and username which will be used (see #10)
  • Log the which config is read, just to inform the user where to look when expierencing problem or password change.

Need to stop, don't work at task switch

As mentioned by @daroczig in #13

I'd add an extra note, that you have to stop the timer if you want to log something, as if you do not click on "stop the timer" and simply change to a new task, then the time is not logged.

Cannot pip-install 0.5.1: missing CHANGELOG.rst

Hi, thanks for this useful plugin, really looking forward to using it!

I tried to install it using straightforward pip install hamster-bridge issued as a root user (I trust you;) ) but it failed like follows:

$ /usr/bin/pip install hamster-bridge
Downloading/unpacking hamster-bridge
  Downloading hamster-bridge-0.5.1.tar.gz
  Running setup.py (path:/tmp/pip_build_root/hamster-bridge/setup.py) egg_info for package hamster-bridge
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/hamster-bridge/setup.py", line 18, in <module>
        long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(),
    IOError: [Errno 2] No such file or directory: 'CHANGELOG.rst'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/hamster-bridge/setup.py", line 18, in <module>

    long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(),

IOError: [Errno 2] No such file or directory: 'CHANGELOG.rst'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/hamster-bridge
Storing debug log for failure in /home/matej/.pip/pip.log

In contrast, installing version 0.5.0 worked fine:

$ pip install hamster-bridge==0.5.0
Downloading/unpacking hamster-bridge==0.5.0
  Downloading hamster_bridge-0.5.0-py2-none-any.whl
Downloading/unpacking jira>=0.40 (from hamster-bridge==0.5.0)
  Downloading jira-1.0.3-py2.py3-none-any.whl (46kB): 46kB downloaded
Downloading/unpacking six>=1.9.0 (from jira>=0.40->hamster-bridge==0.5.0)
  Downloading six-1.10.0-py2.py3-none-any.whl
Downloading/unpacking requests>=2.6.0 (from jira>=0.40->hamster-bridge==0.5.0)
  Downloading requests-2.9.1-py2.py3-none-any.whl (501kB): 501kB downloaded
Downloading/unpacking tlslite>=0.4.4 (from jira>=0.40->hamster-bridge==0.5.0)
  Downloading tlslite-0.4.9.tar.gz (105kB): 105kB downloaded
  Running setup.py (path:/tmp/pip_build_root/tlslite/setup.py) egg_info for package tlslite

    warning: no files found matching '*' under directory 'docs'
Downloading/unpacking requests-oauthlib>=0.3.3 (from jira>=0.40->hamster-bridge==0.5.0)
  Downloading requests_oauthlib-0.6.0-py2.py3-none-any.whl
Downloading/unpacking requests-toolbelt (from jira>=0.40->hamster-bridge==0.5.0)
  Downloading requests_toolbelt-0.6.0-py2.py3-none-any.whl (48kB): 48kB downloaded
Downloading/unpacking oauthlib>=0.6.2 (from requests-oauthlib>=0.3.3->jira>=0.40->hamster-bridge==0.5.0)
  Downloading oauthlib-1.0.3.tar.gz (109kB): 109kB downloaded
  Running setup.py (path:/tmp/pip_build_root/oauthlib/setup.py) egg_info for package oauthlib

Installing collected packages: hamster-bridge, jira, six, requests, tlslite, requests-oauthlib, requests-toolbelt, oauthlib
  Found existing installation: six 1.5.2
    Not uninstalling six at /usr/lib/python2.7/dist-packages, owned by OS
  Found existing installation: requests 2.2.1
    Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
  Running setup.py install for tlslite
    changing mode of build/scripts-2.7/tls.py from 644 to 755
    changing mode of build/scripts-2.7/tlsdb.py from 644 to 755

    warning: no files found matching '*' under directory 'docs'
    changing mode of /usr/local/bin/tlsdb.py to 755
    changing mode of /usr/local/bin/tls.py to 755
  Found existing installation: oauthlib 0.6.1
    Not uninstalling oauthlib at /usr/lib/python2.7/dist-packages, owned by OS
  Running setup.py install for oauthlib

Successfully installed hamster-bridge jira six requests tlslite requests-oauthlib requests-toolbelt oauthlib
Cleaning up...

Use oauth with jira

Instead of saving the jira password in the config file, hamster-bridge should obtain and use an oauth token.

complains about missing dependency redmine, even though I dont want it

I followed the instructions for JIRA and ended up with this error:

$ hamster-bridge jira
Traceback (most recent call last):
  File "/usr/bin/hamster-bridge", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 24, in main
    (lc.short_name, lc) for lc in [import_listener(l) for l in LISTENERS]
  File "/usr/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 9, in import_listener
    mod = __import__(name.rsplit('.', 1)[0])
  File "/usr/lib/python2.7/site-packages/hamster_bridge/listeners/redmine.py", line 8, in <module>
    from redmine import Redmine
ImportError: No module named redmine

Obviously I can jsut install that module... but since I'm not trying to use redmine thats a little annoying.

Unable to send description to redmine

Hi, while trying to integrate hamster with our internal redmine server (3.3.5) I'm not able to update the time in redmine with description of the ticket being updated.
The thing is, I can't see anything wrong with the request, besides I've been trying many scenarios, none of them got accepted, except the one only with ticket ID alone.
Below I'm pasting working case and a failed one

failed

2018-06-19 21:52:48,448   DEBUG [hamster_bridge.bridge]: Found a stopped task: {'category': u'test', 'activity_id': dbus.Int32(62), 'description': u'test', 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 21, 51, 22), 'ponies': False, 'original_activity': dbus.String(u'22947'), 'delta': datetime.timedelta(0, 85), 'end_time': datetime.datetime(2018, 6, 19, 21, 52, 47), 'activity': u'22947', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(117)}
2018-06-19 21:52:48,448   ERROR [hamster_bridge.listeners.redmine]: Unable to query issue for stopping of hamster fact 22947  

working one, it is accepted by redmine, though no description gets processed further

2018-06-19 09:22:00,172   DEBUG [hamster_bridge.bridge]: Found a started task: {'category': u'Unsorted', 'activity_id': dbus.Int32(54), 'description': None, 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 9, 21, 59), 'ponies': False, 'original_activity': dbus.String(u'22948 test'), 'delta': datetime.timedelta(0, 1), 'end_time': None, 'activity': u'22948 test', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(97)}
2018-06-19 09:23:20,390   DEBUG [hamster_bridge.bridge]: Found a stopped task: {'category': u'Unsorted', 'activity_id': dbus.Int32(54), 'description': None, 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 9, 21, 59), 'ponies': False, 'original_activity': dbus.String(u'22948 test'), 'delta': datetime.timedelta(0, 79), 'end_time': datetime.datetime(2018, 6, 19, 9, 23, 18), 'activity': u'22948 test', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(97)}
2018-06-19 09:23:20,393   DEBUG [urllib3.connectionpool]: Resetting dropped connection: 

Can you please advice what should be a proper string in hamster to get both, ticket and its description , accepted? Thanks

Import old entries into jira

I just discovered hamster-bridge now and want to log my previous entries into jira. Unfortunately I don't see a command line argument that would allow me to do this.

That option would also come handy if I forget to start hamster-bridge.

hamster-bridge does nothing after start

Hi all!
hamster-bridge seems like the perfekt tool i'm looking for. Unfortunately it does nothing after i start it.
Here is a log after starting hamster-bridge:

2015-02-26 12:03:18,375    INFO: Starting hamster bridge
2015-02-26 12:03:18,408    INFO: Activating listener: jira
2015-02-26 12:03:18,408    INFO: Registering <hamster_bridge.listeners.jira.JiraHamsterListener object at 0x7f8e5c141310>
2015-02-26 12:03:18,417    INFO: Starting new HTTPS connection (1): jira.domain.tld

I don't exactly know, how the bridge works but i whould except that hamster-bridge starts hamster after it gathered all informations from jira. For the sake of accuracy i also tried to start hamster first and then hamster-bridge and also the other way around - nothing.

Here is my (anonymized) hamster-bridge config:

[jira]
server_url = https://jira.domain.tld
username = foo
password = bar
auto_start = y

Silent dependency on python-dateutil

Dependency on python-dateutil should be defined in setup.py.

Upon installing hamster-bridge with pip, I observed the issue as can be seen below:

$ hamster-bridge jira
Traceback (most recent call last):
  File "/home/matej/.virtualenvs/2.7-hamster/bin/hamster-bridge", line 11, in <module>
    sys.exit(main())
  File "/home/matej/.virtualenvs/2.7-hamster/local/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 27, in main
    (lc.short_name, lc) for lc in [import_listener(l) for l in LISTENERS]
  File "/home/matej/.virtualenvs/2.7-hamster/local/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 12, in import_listener
    mod = __import__(name.rsplit('.', 1)[0])
  File "/home/matej/.virtualenvs/2.7-hamster/local/lib/python2.7/site-packages/hamster_bridge/listeners/jira.py", line 16, in <module>
    from dateutil.tz import *
ImportError: No module named dateutil.tz

JIRA hosted

First of all, thank you very much for this great project! Quick question: do hamster-bridge supposed to work with hosted JIRA as well? Right after the Lookup issue for activity ... I always get a Resetting dropped connection... error message.

Listener plugin loading

For now there is only the LISTENERS list within the hamster_bridge module where people are able to add new listeners.
You should somehow create a plugin mechanism to (maybe also on runtime) allow loading of additional listeners or a subset of listeners. (You already wrote that as a TODO in code, I extract it as issue so it will not get lost)

Also consider that there is currently one dependeny within the setup.py (jira-python) that only applies to the JIRA listener. If I only want to use f.e. the Redmine listener I do not want to install JIRA libs.

error: g_dbus_connection_real_closed

I added hamster-bridge to the "Startup applications" in Ubuntu and get the following error.

g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

push comment along with worklog entry

I really enjoy this plugin, and an IMHO useful feature came to my mind. Currently, master-bridge logs the time to the related ticket without any details, but the add_worklog from jira also has the option to push some comments for the saved worklog.

Not sure how much work would it require (it seems to me that it might be as easy as passing the hamster description as comment), but it would be nice to save the comments from Hamster into JIRA as well. E.g. I use hamster by specifying the JIRA ticket reference, then providing some details as comments, sometimes maybe also adding tags -- but that's not important at all.

Current behavior: when I type JIRA-1,doing foo an bar in hamster, then the logged time is saved to JIRA-1 ticket without any details.
Suggested behavior: when I type JIRA-1,doing foo an bar in hamster, then the logged time is saved to JIRA-1 ticket with the doing foo and bar as the comment.

Jira 7.3.0+ not working

It looks like the authentication do not work anymore.
I'm not familiar with Python so debugging could take a while.

Info:

  • ssl validation is disabled.
    Log:
2017-02-14 15:39:40,882    INFO: Starting hamster bridge
2017-02-14 15:39:40,885 WARNING: Disabling SSL/TLS certificate verification
2017-02-14 15:39:40,885    INFO: Connecting as "ASDASDASD" to "https://jira.mcl.de"
2017-02-14 15:39:40,890    INFO: Starting new HTTPS connection (1): jira.mcl.de
/home/mfkinder/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
Traceback (most recent call last):
  File "/home/mfkinder/.local/bin/hamster-bridge", line 11, in <module>
    sys.exit(main())
  File "/home/mfkinder/.local/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 53, in main
    bridge.run(args.check_interval)
  File "/home/mfkinder/.local/lib/python2.7/site-packages/hamster_bridge/bridge.py", line 98, in run
    listener.prepare()
  File "/home/mfkinder/.local/lib/python2.7/site-packages/hamster_bridge/listeners/jira.py", line 83, in prepare
    basic_auth=(username, password)
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/client.py", line 261, in __init__
    si = self.server_info()
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/client.py", line 1619, in server_info
    return self._get_json('serverInfo')
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/client.py", line 2035, in _get_json
    r = self._session.get(url, params=params)
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/resilientsession.py", line 130, in get
    return self.__verb('GET', url, **kwargs)
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/resilientsession.py", line 126, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/home/mfkinder/.local/lib/python2.7/site-packages/jira/resilientsession.py", line 45, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 401
	text: 









<html>

<head>
    <title>Unauthorized (401)</title>
..... and more HTML

Unticking "in progress" in Hamster overview and the subsequent saving of the activity does not log time

First of all let me use this opportunity to thank you for this excellent tool, what a time saver!

Below is a description of my use case.

Activity A shows that it has been going on for, say, 60 minutes. Then I realize that I actually have been working on Activity B for the last 20 minutes, just forgot to switch.

I then open Activity A in Hamster overview, untick the "in progress" checkbox and adjust the end time of the Activity A in order to reduce it to 40 minutes.

Then I click on Save button and... nothing happens, the time is not logged in Jira and the Hamster Bridge log (--debug) shows nothing either.

wrong magic module version?

2013-05-06 08:03:55,370    INFO: Starting hamster bridge
2013-05-06 08:03:55,373    INFO: Found listener: hamster_bridge.listeners.jira.JiraHamsterListener
2013-05-06 08:03:55,439    INFO: Registering <hamster_bridge.listeners.jira.JiraHamsterListener object at 0x2c19410>
Traceback (most recent call last):
  File "/home/lakr/.venv/hamster-bridge/bin/hamster-bridge", line 9, in <module>
    load_entry_point('hamster-bridge==0.0.1', 'console_scripts', 'hamster-bridge')()
  File "/home/lakr/.venv/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/__init__.py", line 29, in main
    bridge.run()
  File "/home/lakr/.venv/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/bridge.py", line 62, in run
    listener.prepare()
  File "/home/lakr/.venv/hamster-bridge/local/lib/python2.7/site-packages/hamster_bridge/listeners/jira.py", line 27, in prepare
    basic_auth=(self.config.get(self.short_name, 'username'), self.config.get(self.short_name, 'password'))
  File "/home/lakr/.venv/hamster-bridge/local/lib/python2.7/site-packages/jira/client.py", line 104, in __init__
    self._try_magic()
  File "/home/lakr/.venv/hamster-bridge/local/lib/python2.7/site-packages/jira/client.py", line 1437, in _try_magic
    self._magic = magic.Magic(mime=True)
TypeError: __init__() got an unexpected keyword argument 'mime'

Ubuntu 12.04 dist-package "python-magic" Version 5.09-2

Frequent log outs from JIRA

Not sure if this is closely related to hamster-bridge or not, and I can live with it, but I thought it might be an annpoying problem for others as well, so raising this ticket. In short: my browser seems to be logged out of JIRA from time to time, despite the fact that the "remember me" feature to store the cookies is on.

After some desktop research, I suspect that it might be due to hamster-jira logging in to submit work hours. I tend to push around 10-20 worklogs a day.

Not sure if it might be improved like logging in when hamster-jira starts and reusing the session -- or the described symptoms are totally unrelated. Thanks for reading!

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.