-
Notifications
You must be signed in to change notification settings - Fork 97
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
Migrate Webhook secret to String Credential and fix issue with persistent for JCasC #267
Conversation
@jetersen is there anything I can do to get this merged in the foreseeable future? This affects a lot of our projects hosted at gitlab.eclipse.org. |
@mifitous can you take a look at this pull request? It would help us a lot if this can be fixed soon. |
src/main/java/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer.java
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer.java
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer.java
Show resolved
Hide resolved
I've kept the getter and setter for now. I've manually tested the migrate method with the following scenarios:
Not sure if it's necessary to create mock tests for the migrate method. |
src/main/java/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer.java
Show resolved
Hide resolved
@fredg02 Mind resolving the merge conflict? :) |
Use Jenkins credentials for webhook secret.
* Add readResolve and migrateWebhookSecretCredentials methods to be able to migrate old secret tokens to Jenkins credentials. * Rename secretTokenCredentialsId to webhookSecretCredentialsId
Done. I did a rebase and added a commit to fix indentation. |
@jetersen please let me know if anything is required from my side to push this forward. |
@jetersen friendly ping |
Thanks for all your help! 🙏 |
Well ... with these changes, if I configure a token, I got and if I do not configure token, I got a NullPointerException here ( So, I am stuck ... |
@bguerin PRs are welcome |
@jetersen Would you consider it safe to remove
|
@fredg02 I believe the correct thing is this: Lines 278 to 291 in b9560d6
You need to supply the source.getOwner() as done here: Line 74 in b9560d6
|
Yeah, I tried to copy that part, but I'm not sure how I can provide the |
Either Just check for usage on Otherwise check for |
Alright. I'll try to get this fixed in a timely manner. Sorry about the regression my PR introduced. |
@jetersen any idea how to aquire |
I've tried to check how other plugins handle this (e.g. the GitHub plugin). It looks like there is no permissions check in https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/config/GitHubServerConfig.java#L288. |
Feel free to submit a PR :) |
@fredg02 I believe that the regression has also been reported as JENKINS-70785. Are you willing to investigate a fix for that regression or is that an intentional case and the user needs to perform some specific upgrade step to change from |
The regression is not intentional. I will try to provide a fix asap. I had only limited connectivity last week. |
Use Jenkins credentials for webhook secret.
fixes #162
fixes #283