update to v4 of gitlab api
I have this stackstrace if I launch a scan of my gitlab projects :
[Fri Jun 08 13:43:45 UTC 2018] Updating actions...
[Fri Jun 08 13:43:45 UTC 2018] Consulting GitLab Projects
ERROR: [Fri Jun 08 13:43:45 UTC 2018] Could not fetch sources from navigator argelbargel.jenkins.plugins.gitlab_branch_source.GitLabSCMNavigator@49df211a
java.util.NoSuchElementException: unknown id: visible
at argelbargel.jenkins.plugins.gitlab_branch_source.api.GitLabProjectSelector.byId(GitLabProjectSelector.java:19)
at argelbargel.jenkins.plugins.gitlab_branch_source.ProjectQuery.<init>(ProjectQuery.java:31)
at argelbargel.jenkins.plugins.gitlab_branch_source.GroupProjectQuery.<init>(GroupProjectQuery.java:15)
at argelbargel.jenkins.plugins.gitlab_branch_source.ProjectQuery.create(ProjectQuery.java:20)
at argelbargel.jenkins.plugins.gitlab_branch_source.SourceVisitor.visitSources(SourceVisitor.java:25)
at argelbargel.jenkins.plugins.gitlab_branch_source.GitLabSCMNavigator.visitSources(GitLabSCMNavigator.java:133)
at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:458)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
@jbomaileva we have the same issue.
Any updates or progress on this? How could one help move this along? I believe this could resolve #83.
GitLab v11 removed the v3 API. I tried your PR, seems to be working only when i remove my old project (old settings on version 0.6.x of this plugin) After recreating, the Jenkins project scan is working and all pipelines are created. But the webhooks arent registered in gitlab. Triggering the web hooks from old projects arent working too. However, testing the webhook from Gitlab returns HTTP 200, loggings are fine, but no builds are started.
Saving configuration triggers system webhook register which results in 403 forbidden responses
Okay found all problems and it's working now.
- Add
org.gitlab.api.models.GitlabProjectin ClassFilter - In GitLabSCMHead.java remove the suffix "t2" and "t3" ...
Last problem is registering System WebHook in GitlabAPI. Method private GitlabSystemHook registerSystemHook(String url) throws IOException. It always throws WARNING: could not register hook https://***/gitlab-scm/notify/***: error accessing gitlab-api: {"message":"403 Forbidden"}, don't know why, i created this hook manually in gitlab via curl ...
curl --request POST --header "PRIVATE-TOKEN: ***" "https://***/api/v4/hooks?url=https://***/gitlab-scm/notify/***&enable_ssl_verification=false"
Hey @awilhelmer,
Thanks for looking into this! When you said, "Okay found all problems and it's working now." Were you referring to this pull request?
Also, when you said, "Last problem is registering System WebHook in GitlabAPI." Is that a new issue or did you resolve it?
Sorry for the confusion.
Cheers, Alex
Hi @alexkoepke yes iam referring to this pull request and the two changes i made (The two points) locally. The System Webhook is still a problem and i think it's a problem in the Gitlab API v4 dependency...
So, the plugin is not fully compatible with gitlab 11 yet ?
It works. The System Webhook is to detect new or deleted branches. The Push webhook for projects works fine.
can you share your commits?
I resolved the issues noted in code that were part of my code for testing and also merged in the latest changed from master on here.
Additionally I began work on getting the note event trigger which is successfully working for merge requests but I cannot get it to trigger a job because it determines that the source code has not chnaged and will not trigger a build.
I would appreciate some help on this.
Thanks for working on this, @ilushka85! Commenting out the note event stuff, I was able to build this (findbugs complained about the unused assignment) and get it working again after a Gitlab upgrade
@paulerickson do you think your fixes will get this PR to a passing state? @Argelbargel are you able to confirm?
@alexkoepke okay, I opened #91 with Ilya's changes minus Notes, although I have not tested just yet. It would be great if someone else could test it too.
Push events still don't trigger for me, which I think is existing since 0.6.6.7
I think this can be closed, since the v4 changes were incorporated in #91
@paulerickson fantastic! Good to hear, I’ll test when I get the chance.