Feature/oauth bit bucket#3985
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces Bitbucket Cloud OAuth token support by adding a helper that can detect Bitbucket Cloud remotes and rewrite HTTPS remote URLs to include an x-token-auth userinfo token, and wires that behavior into UserRemoteConfig.
Changes:
- Added
BitbucketOAuthHelperutilities for Bitbucket Cloud remote detection, tokenized remote URL rewriting, and token masking for logs. - Added unit tests for
BitbucketOAuthHelper. - Updated
UserRemoteConfigto look up credentials and rewrite Bitbucket Cloud remote URLs when username/password credentials are configured.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/main/java/jenkins/plugins/git/BitbucketOAuthHelper.java |
New helper for detecting Bitbucket Cloud remotes and building tokenized remote URLs. |
src/test/java/jenkins/plugins/git/BitbucketOAuthHelperTest.java |
New unit tests covering Bitbucket Cloud detection, URL rewriting, and masking behavior. |
src/main/java/hudson/plugins/git/UserRemoteConfig.java |
Integrates Bitbucket OAuth remote rewriting and refactors credentials lookup usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2c6471b to
d07fadb
Compare
|
Can someone please review this and get it merged up thanks! @MarkEWaite I have fixed up the copilot things can you please review? |
|
Is this going to get reviewed or??? |
Not for a while. I'm the only active maintainer of the git plugin and I have many other things on my list that benefit a wider group of users. You're encouraged to use the incremental build on your production Jenkins controller so that you can report your successful use of the pull request. That may also encourage others to use the incremental build on their production Jenkins controller. You're also encouraged to adopt one or more of the Jenkins plugins that are up for adoption so that you can help other Jenkins users. Some of the plugins that are up for adoption include: |
|
This update is for me using this plugin for work tasks. I am not looking to step in and help with other plugins and giving them a home. I will do as you suggested to install the .hpi file on a test instance and test that this all works and report back might not get to this today though. |
Description
This pull request adds OAuth authentication support for Git operations performed by the Jenkins plugin.
The change enables OAuth-based credentials to be used when interacting with Git repositories, providing an alternative to traditional username/password or token-based authentication flows. This allows Jenkins environments configured with OAuth credentials to authenticate successfully during supported Git operations.
Testing done
The change was tested by configuring the plugin with OAuth authentication and executing Git operations against a repository that requires OAuth-based authentication.
Testing included:
Submitter checklist