pweingardt/mylyn-gitlab

Connector uses unsupported API

PlasticSturgeon opened this issue ยท 13 comments

GitLab API version 3 was deprecated together with the 9.0 release in March 2017. GitLab 10.2, released in November, removed support for the old API, rendering the connector inoperable.
See the official documentation for details.
Symptoms: Connector complains about invalid path in server due to accessing /api/v3/....

Kind of painful that GitLab decided to remove the API so quickly. IMO they should have supported the old API at least a year.

I am getting the same error about invalid path in server since we had our gitlab server upgraded (yesterday).

I have tried using a token instead of username/password, and the validation seems to work while I am editing the repository configuration, but as soon as I close it the issue comes back. I open again the configuration and see that it is not using the private token but the username/password again.

Thanks for looking into it.

Hi, I am heavily relying on this mylyn gitlab connector and now struggling with the API change.

I downloaded the sources and tried to swap the dependencies to the latest gitlab-java-api version 4.0.0 .

It did not need much of code changes, but it is not working as expected. The gitlab-java fails to connect, looks like it is making an incorrect API call. Unfortunately, I don't know how the exact URL should look like. I am using a user, password authentication, but cannot figure out why it fails. Also don't know if there is a bug in the usage or the gitlab-java itself.

Are the contrbutors already on this issue? If there is some sort of contribution I can do, please let me know.

I continued investigating, and got it somehow running.

User password seems to not work anymore. Using a private token helps to connect. Still after eclipse reboot, the connector cannot remember the token.

I found a bug in the nested java gitlab api, which is trying to receive the notes with the old api v3 style, it is using the ID rather than the IID as supposed to in api v4. I filed the bug here: timols/java-gitlab-api#283

Same in the GitlabTaskHandler which ahs to acces the issues via the IID rather than the ID.

I started some fixes on this issue.

I started to fix the relevant issues in the java-gitlab-api: timols/java-gitlab-api#284

Once there is a new release on that dependency, I can provide a fix and pull request on the overall issue.

Does anyone have a clue about the user/password authentication? As far as I understand it is not supported anymore by the API v4.

Is there any progress on the upstream Java API yet? Anything needed to get this moving? At the moment I am using some dirty workarounds via Apache mod_rewrite, which is probably not a good long term solution.

rompe commented

I have just compiled and installed the fork of @scriptninja which includes the changes made by @PhilMFischer . This works for me (thanks a million for your work!) and makes me wonder what is preventing an update of the official plugin. Even if not all issues are solved (like login with user/password not working) it would be way better to publish it in its current state than leaving the version that doesn't work at all anymore for most users. @PhilMFischer, would you mind adding a current java-gitlab snapshot to the lib dir (at least I had to do this) and send a pull request? Or, otherwise, could you publish an update site for your fork?

This plugin is way too great and important to let it rot.

rompe commented

BTW, if anyone here is desperate enough to trust me for no reason, I have created an update site for my own purposes that you might use as you want:

https://eclipse.rompe.org/mylyn-gitlab

3b0b commented

I haven't got the time or the chops to maintain a fork, but I had been hoping to figure out what I'm doing wrong with my travis-ci build and get a Github Pages update site working (I did the same thing for a Redmine mylyn plugin a while back) and then offer a pull request to someone who actually knows what they're doing. I haven't had the motivation lately, unfortunately.

Plugin version 2.1.0 is up and working with the Gitlab API version 4.

Thx @pweingardt. Just updated my Eclipse (2018-09). Now I get unstoppable repository validation after adding a new task repository with a Gitlab private token as credential. Need to force Eclipse to shutdown.
The dialog tells me that "Wizard cannot be closed due to an active operation", but I cannot cancel the operation.

Thanks from my part, too ๐Ÿ‘

I have installed the new version 2.1.0. I can add my repository with no validation problems - it just takes a bit long in my case, around 10 seconds -, as long as I use a private token instead of user ID/password.
However, when I create a new query for a given milestone (no other filters) I get no tasks, and the error log view shows this:

Synchronization failed
java.lang.RuntimeException: org.gitlab.api.GitlabAPIException
	at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:243)
	at org.gitlab.api.http.GitlabHTTPRequestor$1.hasNext(GitlabHTTPRequestor.java:197)
	at org.gitlab.api.http.GitlabHTTPRequestor.getAll(GitlabHTTPRequestor.java:165)
	at org.gitlab.api.GitlabAPI.getIssues(GitlabAPI.java:2432)
	at org.gitlab.api.GitlabAPI.getIssues(GitlabAPI.java:2427)
	at de.weingardt.mylyn.gitlab.core.GitlabConnector.performQuery(GitlabConnector.java:121)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQuery(SynchronizeQueriesJob.java:304)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQueries(SynchronizeQueriesJob.java:261)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.run(SynchronizeQueriesJob.java:192)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: org.gitlab.api.GitlabAPIException
	at org.gitlab.api.http.GitlabHTTPRequestor.handleAPIError(GitlabHTTPRequestor.java:408)
	at org.gitlab.api.http.GitlabHTTPRequestor.access$300(GitlabHTTPRequestor.java:38)
	at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:240)
	... 9 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class java.time.LocalDate] from String value ('2018-08-27'); no single-String constructor/factory method
 at [Source: java.io.StringReader@10973442; line: 1, column: 49263] (through reference chain: Object[][19]->org.gitlab.api.models.GitlabIssue["due_date"])
...

Is there some setting for date format either in gitlab or the connector which might fix this?

Thanks again!

Also got this error when asking to update the repository info (on existing repositories).

update repository info error