node-jenkins-api icon indicating copy to clipboard operation
node-jenkins-api copied to clipboard

last_result() is broken

Open jamesjenner opened this issue 10 years ago • 3 comments

Hi,

I'm using last_result and have found that the generated URL is screwed up.

It works if I change the following code:

request({method: 'GET', url: build_url(last_result_url + API, jobname)}, function(error, response, body) {

to the following:

request({method: 'GET', url: last_result_url + API + jobname}, function(error, response, body) {

The reason why is because the call to build_url fails when it util.format, as there is no %s in the string, the host is copied into the string a second time. It seems that the last_result_url already has the host information in it.

In my case the host is different to the value returned in the last_result. Both work, just appears to be a config problem with our jenkins due to network migrations.

I would do a pull request, but I'm not 100% clear on your logic for using build_url.

jamesjenner avatar Aug 21 '14 05:08 jamesjenner

I can second this, the URL being generated is messed up

SyntaxStacks avatar Nov 10 '14 22:11 SyntaxStacks

+1

jonashartmann avatar Dec 30 '15 15:12 jonashartmann

yup the url is broken :(

siddrc avatar Jul 29 '16 09:07 siddrc