-
Notifications
You must be signed in to change notification settings - Fork 620
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
withCredentials in pipeline not supported #536
Comments
Hi, think I have the same issue, but I'm not sure how to access the error logs to make sure of it (I can't even ssh on the machine running Jenkins). In my case, the tokens that are available in the "Configure System" page don't show up in the Pipeline configuration page. Only a username/password credential that is unrelated shows up. Could you please help me determine if this is the same issue? Thanks! What I'm working with:
|
Dupe of #494 I think. |
@dcuenot this is an old bug, so I don't remember the context anymore. Re-reading it, it appears that the OP was saying that Pipeline's withCredentials does not support the GitLab credential types that this plugin defines. That would apply to both the API token and the secret token. But if this is an issue, it's in the Jenkins Credentials plugin, not this plugin. #494 is asking us to support the built-in credentials types, so that withCredentials will work. At least that's what I think. |
I believe the proper usage is as follows
The original issue author's mistake was using However, even using it properly produces an error:
|
where we need to add this environment test in Gitlab CI. |
Hi, |
I tried the secret text approach but I still got a similar error:
|
Not sure why this is closed, #536 (comment) is not the same. |
any news? |
Hi @it-mak Could you please provide us with more details on the context of your issue so we could look into it? |
Is there any new on this issue? I tried #536 (comment) what is not working.
|
I also get this error :
and is there any solution now? my pipeline is
|
I also got this error. Of course the "solution" was switch to secret text. But I wish this would get implemented instead. |
Still there is no solution instead use the secret text? |
yep, still no solution, just hit the same problem. so i will go with secret text for the api token |
Still the same error with declarative form
produces
Jenkins 2.426.3 |
Same here - an attempt to use
The workaround is using |
Well, I think the solution will be to put it in a secret text in Jentkins. The problem? We will lose access to the API. So, is it a solution? No. It's a pirate patch. If we have a variable to check, get other things like URLs, messages... and it doesn't work... it's like having a car without a key. Can someone look at it? If this was mentioned in 2018, it's been about 6 years now. I hope that by 2030 my grandson can enjoy this nonsense. |
No, you won't lose access to the API. You will need to remember that when you update the credential on the remote server, it must be updated in two locations in Jenkins instead of being updated in one location. I agree that is a burden, but you do not lose access to the API.
Yes. You can look at it. When you have the code change working, have added automated tests to confirm the code change is working, and have added documentation showing examples that use your newly added code, I'm sure we can find a reviewer for your pull request. If you decide that you'd rather not look at it, then you can use the already described workaround of using a secret text credential. |
Let's take it one step at a time.
The gitlab variable/token created in the credentials is supposed to have more functionality than just a secret-text / plain text with the encrypted key. While "Secret text" offers more flexibility, using the GitLab variable provides a more specific and potentially more secure integration for working with GitLab. The GitLab variable offers a closer integration with the GitLab API. That is, it already comes with methods, functions, functionalities, and more.
I don't have time. I'm on a mega project. I don't know how I had time or am having time to respond. |
Issue
withCredentials
in pipelines is not supported with custom secrets typeContext
Logs & Traces
Problem description
I tried to do re-use the Token for some custom API steps. Which actually works. Just not with the custom credentials type.
current workaround is to add the token twice. as a string credential as well as a gitlab token credential.
why is it a special type anyway?
The text was updated successfully, but these errors were encountered: