mdsb100 / cli-gitlab

GitLab CLI library
101 stars 11 forks source link

api v4? node-gitlab v3.7.0? #17

Open gotjoshua opened 6 years ago

gotjoshua commented 6 years ago

Is this lib compatible with Gitlab api v4? with the up-to-date node gitlab?

Background: I updated gitlab itself (which now requires api v4) -> my CI broke silently So then: I tried explicitly installing node-gitlab in my CI-docker image and now i get an error in my CI:

/usr/lib/node_modules/cli-gitlab/bin/worker.js:58
      gitlab = gitlabLib({
               ^

TypeError: gitlabLib is not a function
    at requireOrGetGitlab (/usr/lib/node_modules/cli-gitlab/bin/worker.js:58:16)
    at Command.exports.token (/usr/lib/node_modules/cli-gitlab/bin/worker.js:82:14)
    at Command.listener (/usr/lib/node_modules/cli-gitlab/node_modules/commander/index.js:315:8)
    at emitTwo (events.js:126:13)
    at Command.emit (events.js:214:7)
    at Command.parseArgs (/usr/lib/node_modules/cli-gitlab/node_modules/commander/index.js:651:12)
    at Command.parse (/usr/lib/node_modules/cli-gitlab/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/usr/lib/node_modules/cli-gitlab/bin/command.js:19:9)
    at Module._compile (module.js:635:30)

Not sure if it is related, but i see that there was some reshuffling of the main gitlab repo for node-gitlab... https://github.com/node-gitlab/node-gitlab/issues/191

Any help?

gotjoshua commented 6 years ago

I also see that another user has the same or similar error: https://github.com/mdsb100/cli-gitlab/issues/16#issuecomment-382444889

gotjoshua commented 6 years ago

I also see that migrating to the new node-gitlab may include a "little bit of growing pains for those upgrading from the original node-gitlab v1.8" https://github.com/jdalrymple/node-gitlab#migrating-from-node-gitlabnode-gitlab

mdsb100 commented 6 years ago

I will refactor

mdsb100 commented 6 years ago

Please take a look https://github.com/mdsb100/node-gitlab#cli I create a pull-request to node-gitlab. If node-gitlab does not accept it, I will publish myself by using name cli-gitlab.

gotjoshua commented 6 years ago

Wow that was fast!! Thanks : -)

So is it usable now (via npm?) or only if they accept the pull-request?

and the main node-gitlab repo is on npm as just gitlab...

are you proposing to use node-gitlab in the npm install just for the cli?

mdsb100 commented 6 years ago

For now, you can use it locally by npm link

git clone
cd node-gitlab && npm install
npm run build
npm link
gotjoshua commented 6 years ago

Thanks, can you give a hint why this build fails: https://hub.docker.com/r/onezoomin/allsync-cligitlab/builds/bpgkv2jzhetxqecgcslzcsa/ ?

mdsb100 commented 6 years ago

@gotjoshua try npm run build. It will create 'bin/gitlab'.

mdsb100 commented 6 years ago

OK?

gotjoshua commented 6 years ago

looks better, at least the build succeeded !

still testing if the lib works as it did before (in my CI flow)...