-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[JENKINS-73677] Decorate GitClient after adding credentials #1687
Conversation
bitbucket-branch-source-plugin has been released with workaround that make SSH works with this patch |
@MarkEWaite Any chance to get this merged ? Bitbucket Branch Source should be ready now. cc @nfalco79 |
Yes please. Merging this fix, enable us to fix the authentication issues in Bitbucket plugin |
I'm leaving town until next Monday 2 Dec 2024. I'll plan to test it and release it the week of 2 Dec 2024. |
Git client plugin 6.1.1-rc3643.ff37e600016d includes JGit 7.1.0. JGit 7.1.0 is scheduled to release 4 Dec 2024, so there is a small chance that the version will be updated before the official release. Git client plugin pull request for JGit 7.1.0 is: * jenkinsci/git-client-plugin#1220 JGit 7.1.0 release notes are: * https://projects.eclipse.org/projects/technology.jgit/releases/7.1.0 Git plugin 5.6.1-rc5357.7a_4955e76288 adds credentials to the GitClient object before decorating the object with settings from extensions. A plugin that adds a deocrator will now be able to adjust the credentials if needed. * jenkinsci/git-plugin#1687 * https://issues.jenkins.io/browse/JENKINS-73677 Tested by running: PLUGINS=github-branch-source,cloudbees-bitbucket-branch-source,,mailer TEST=InjectedTest bash local-test.sh
|
I started the testing last week with a pull request to the plugin BOM. You can read more about the adventures there: I still need to run the acceptance test harness with the git plugin pre-release. Unfortunately, there is a distraction in the acceptance test harness due to currently failing tests as noted in two pull requests:
The acceptance test harness distraction won't prevent the release, but it did need some time yesterday to understand what was causing the test failure. I hope to release this week. @sandeepbarnwal have you tested the pre-release build and confirmed that it works for your use case? The incremental build instructions include these links:
|
Tested with suggested verson of git plugin and a version of bitbucket branch source plugin that doesn't have the workaround fix and it didn't work for me. Error: |
We have merge fix jenkinsci/bitbucket-branch-source-plugin#899 into master. |
This bitbucket release already contains a workaround. Does that mean master has workaround fix and jenkinsci/bitbucket-branch-source-plugin#899 both? was it tested earlier without the workaround ? |
I've built the Bitbucket Branch Source plugin on my computer from the |
Master branch would have the workaround fix and I'm testing with username and password credential for my case. |
@sandeepbarnwal I can only test my own use case, which is using username+token for discovery and SSH for checkout (jenkinsci/bitbucket-branch-source-plugin#866). The workaround doesn't solve that, it's still broken in the latest release (but fixed now for me in If you want to test the
That will create a file |
No need to build the plugin yourself. Incremental builds of plugins are generated by ci.jenkins.io and can be downloaded from ci.jenkins.io or from the instructions that are included in the GitHub checks for plugin branches and for plugin pull requests. We need to add a section "Using incrementals" to the existing developer page. It would need to say something like this (improvement suggestions are welcomed): Using Incrementals with Plugin ManagerOnce incrementals are enabled for a plugin, Jenkins administrators and other Jenkins users can use the incremental build on their Jenkins controller by downloading it from ci.jenkins.io. Copy the URL from the specific build on ci.jenkins.ioPaste the URL into the Jenkins plugin managerUsing Incrementals with Configuration as CodeInstructions for the Finding Incrementals from GitHub Checks for a Jenkins jobFinding Incrementals from GitHub Checks for a BranchFinding Incrementals from GitHub Checks for a Pull Request |
Yes, the correct version to use with this pr is master. Any other version will fall into a bug. Only this PR + bitbucket master cover all use case. Credentialsid is NEVER null and user credential is contributed/overridden by the git extension in some use case and in other let git-plugin rely on stored credentials. |
Thanks for your help! It's working fine for me now. |
jenkinsci/git-plugin#1687 and some trivial chores.
(second attempt of #1649)
JENKINS-73677: Credentials are added to GitClient after the client is decorated by extensions.. A plugin cannot for example override the credentials passed in via a GitSCMExtension (Noticed as part of jenkinsci/bitbucket-branch-source-plugin#867)
but unreleased at the momentreleased as 906.vedf430cb_4481).Testing done
Tested simple scenario: configured Pipeline from SCM with GitSCM with provided Credentials.
Tested other scenario: configured Multibranch SCM with Bitbucket Branch Source.
Tested other scenario: configured Multibranch SCM with Bitbucket Branch Source with SSH Credentials trait.
Submitter checklist