Project Variables cannot be fetched
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)}` : '';
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!
Just deployed, give it a look when you get a chance. Im sure i missed something :)
:tada: This issue has been resolved in version 4.2.5 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
You have missed something ;)
I commented on the commit: https://github.com/jdalrymple/node-gitlab/commit/28b28cf
Can confirm it's fixed now.