jenkinsci / gogs-webhook-plugin

Jenkins Gogs Webhook
https://plugins.jenkins.io/gogs-webhook/
MIT License
79 stars 42 forks source link

Does not work with jobs in folders #10

Closed jf647 closed 7 years ago

jf647 commented 7 years ago

When using the Cloudbees Folder plugin, the webhook cannot start jobs that are in folders. The log reports:

WARNING: Job 'foo/bar' is not defined in Jenkins Feb 19, 2017 10:00:19 PM org.jenkinsci.plugins.gogs.GogsWebHook exitWebHook WARNING: Job 'foo/bar' is not defined in Jenkins Feb 19, 2017 10:01:23 PM org.jenkinsci.plugins.gogs.GogsWebHook doIndex WARNING: Job 'foo/job/bar' is not defined in Jenkins Feb 19, 2017 10:01:23 PM org.jenkinsci.plugins.gogs.GogsWebHook exitWebHook WARNING: Job 'foo/job/bar' is not defined in Jenkins

When I move this job to the root of my Jenkins server, it works properly.

In the webhook in gitea, I've tried using url-encoded and raw slashes to separate path elements with no observable change. I suspect gitea is encoding it for me in the later case. I've also tried putting 'job' as an element between the folder and the job, as this is what the Jenkins address bar shows, also without success.

willemvd commented 7 years ago

Tested this and I think you can just use "bar" as the job name in Gogs/Gitea, so: /gogs-webhook/?job=bar

This also showed me a problem with the fact that we at the moment only look at the job.getName() . If the name of a job is used in 2 different folders, it is possible that we cannot find the right job. Will create a new PR to address this issue.

@jf647 could you confirm that only the job name is enough to get the stuff running?

willemvd commented 7 years ago

Think this can be closed since #12 is merged

sanderv32 commented 7 years ago

12 is merged :-)

fuhbar commented 7 years ago

@willemvd Yes, this works by just supplying the job name while using foldered jenkins setups.

fuhbar commented 7 years ago

@sanderv32 When will this change released? Or how do I use nightly builds or something?

sanderv32 commented 7 years ago

@fuhbar You can get an SNAPSHOT artifact from the JenkinsCI buildserver for the time being. Will try to release a the new version before the end of the week.