Improve performance of credentials lookup#3912
Merged
MarkEWaite merged 4 commits intojenkinsci:masterfrom Jan 25, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors credential lookup code to use the newer CredentialsProvider.findCredentialByIdInItem API introduced in the credentials plugin. The change simplifies the credential lookup pattern while maintaining identical behavior.
Changes:
- Replaced
CredentialsMatchers.firstOrNull+lookupCredentialsInItempattern with the simplerfindCredentialByIdInItemAPI across four files - Removed unused
CredentialsMatchersimports - Added temporary dependency management override for credentials plugin version
1480.v2246fd131e83until it's available in the BOM
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/jenkins/plugins/git/GitSCMTelescope.java | Simplified credential lookup while preserving authentication context and GitClient.CREDENTIALS_MATCHER validation |
| src/main/java/jenkins/plugins/git/GitSCMFileSystem.java | Refactored credential lookup and matching logic for file system operations |
| src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java | Updated getCredentials method to use new API with consistent matcher validation |
| src/main/java/hudson/plugins/git/UserRemoteConfig.java | Simplified lookupCredentials helper method using new API |
| pom.xml | Added dependency management override for credentials plugin to provide the new API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jtnord
approved these changes
Jan 16, 2026
MarkEWaite
approved these changes
Jan 25, 2026
Contributor
MarkEWaite
left a comment
There was a problem hiding this comment.
I've been running the modified version with no issues for almost two weeks. Ready to merge.
CredentialsProvider.findCredentialByIdInItem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downstream of jenkinsci/credentials-plugin#1003.