cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
182 stars 27 forks source link

nestor executor TypeError: cannot read property #52

Open morsmodre opened 6 years ago

morsmodre commented 6 years ago

Hi! I've just discovered nestor and its pretty awesome! Although, as nothing is is perfect I might have a problem: when I try to run executor, I have the following problems:

$$ nestor executor
/usr/lib/node_modules/nestor/lib/jenkins.js:104
          executor.currentExecutable.url.replace(/.*\/job\//, '').replace(/\/.*/, '') :
                                        ^

TypeError: Cannot read property 'replace' of undefined
    at /usr/lib/node_modules/nestor/lib/jenkins.js:104:41
    at Array.forEach (native)
    at /usr/lib/node_modules/nestor/lib/jenkins.js:97:24
    at Array.forEach (native)
    at Function.executorSummary (/usr/lib/node_modules/nestor/lib/jenkins.js:90:13)
    at resultCb (/usr/lib/node_modules/nestor/lib/cli/jenkins.js:75:28)
    at /usr/lib/node_modules/nestor/node_modules/bagofcli/lib/bagofcli.js:265:7
    at Object.passThroughSuccessJson (/usr/lib/node_modules/nestor/lib/api/util.js:30:3)
    at /usr/lib/node_modules/nestor/node_modules/bagofrequest/lib/bagofrequest.js:86:41
    at done (/usr/lib/node_modules/nestor/node_modules/bagofrequest/lib/bagofrequest.js:149:5)

I can run all other commands I tried work wonders!

Also, I have a variable with JENKINS_URL defined as:

JENKINS_URL="https://me.myself:my_pass_token@jenkins-product.feedzai.com"

and my

$$ nestor --version
1.0.2

Any idea of what's going wrong?

Thanks!

cliffano commented 6 years ago

@morsmodre That's interesting and unexpected, the executor object doesn't have any URL property. Could you please try it with nestor v2.0.0? (I just published it within the last hour). It should have better overall property handling.