gitbeaker icon indicating copy to clipboard operation
gitbeaker copied to clipboard

Project Variables cannot be fetched

Open r9nick opened this issue 8 years ago • 5 comments

Description When trying to use the api.ProjectVariables.show(56, 'SSH_PRIVATE_KEY') it does not work and produces projects/56/null/SSH_PRIVATE_KEY/variables/undefined as a URL.

Steps to reproduce You can see log the endpoint parameter from RequestHelper when you call ProjectVariables.show

Expected behaviour Should produce the endpoint URL projects/56/variables/SSH_PRIVATE_KEY/

Actual behaviour Produces projects/56/null/SSH_PRIVATE_KEY/variables/undefined

Possible fixes This is what I've done, not necessarily the fix. I am aware you are in the middle of a major version release so didn't want to step into that.

ProjectVariables super('projects', 'variables', options);

ResourceVariables Wrap output += 'variables'; in an else Change kId to an optional: const kId = keyId ? `/${encodeURIComponent(keyId)}` : '';

r9nick avatar Nov 25 '18 22:11 r9nick

Perfect! Ill apply this fix to the master branch for the time being and ensure the problem doesnt exist in the new version :) Thank you for finding this!

jdalrymple avatar Nov 25 '18 22:11 jdalrymple

Just deployed, give it a look when you get a chance. Im sure i missed something :)

jdalrymple avatar Nov 26 '18 20:11 jdalrymple

:tada: This issue has been resolved in version 4.2.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

jdalrymple avatar Nov 26 '18 20:11 jdalrymple

You have missed something ;)

I commented on the commit: https://github.com/jdalrymple/node-gitlab/commit/28b28cf

r9nick avatar Nov 26 '18 20:11 r9nick

Can confirm it's fixed now.

r9nick avatar Nov 27 '18 00:11 r9nick