GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
734 stars 209 forks source link

Youtrack new API #836

Closed moorchegue closed 1 year ago

moorchegue commented 3 years ago

Youtrack integration is broken by these API changes:

https://blog.jetbrains.com/youtrack/2021/02/discontinuing-the-legacy-rest-api-action-required/

Attempt to log in fails with:

ERROR:bugwarrior.services:Worker for [my_youtrack] failed: YouTrack responded with <Response [400]>
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bugwarrior/services/__init__.py", line 502, in _aggregate_issues
    service = get_service(service_name)(conf, main_section, target)
  File "/usr/lib/python3.9/site-packages/bugwarrior/services/youtrack.py", line 145, in __init__
    self._login(login, password)
  File "/usr/lib/python3.9/site-packages/bugwarrior/services/youtrack.py", line 162, in _login
    raise RuntimeError("YouTrack responded with %s" % resp)
RuntimeError: YouTrack responded with <Response [400]>

Response from the server looks like this:

{
    "error": "Deprecated REST API is disabled"
    "error_description": "https://blog.jetbrains.com/youtrack/2021/02/discontinuing-the-legacy-rest-api-action-required"
}

Looks like some work is required to make it compatible with the new API.

ryneeverett commented 2 years ago

cc @babelop @dlobue

ryneeverett commented 2 years ago

triage: We should probably remove the service before the next release if nobody steps up to fix it. On the one hand the service is a thin implementation so it doesn't feel like a huge loss. On the other hand it looks like the only changes needed would be to update the base url endpoint from /rest to /api and replace the basic auth endpoint with an oauth handshake. However we'd need a youtrack user to do this work.

peterdb commented 1 year ago

Since I'm a user of both bugwarrior and youtrack, I'm willing to work on this issue. I made some changes, and it seems to be working. I'll create a fork, and create a pull request for reviewing.

ryneeverett commented 1 year ago

Resolved via #982.