Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Variables cannot be fetched #240

Closed
r9nick opened this issue Nov 25, 2018 · 5 comments · Fixed by #241
Closed

Project Variables cannot be fetched #240

r9nick opened this issue Nov 25, 2018 · 5 comments · Fixed by #241

Comments

@r9nick
Copy link

r9nick commented Nov 25, 2018

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)}` : '';

@jdalrymple
Copy link
Owner

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
Copy link
Owner

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

@jdalrymple
Copy link
Owner

🎉 This issue has been resolved in version 4.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@r9nick
Copy link
Author

r9nick commented Nov 26, 2018

You have missed something ;)

I commented on the commit: 28b28cf

@r9nick
Copy link
Author

r9nick commented Nov 27, 2018

Can confirm it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants