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.
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-73172] Reuse credentials object reference through scans to avoid frequent duplicated lookups #787
[JENKINS-73172] Reuse credentials object reference through scans to avoid frequent duplicated lookups #787
Changes from all commits
18c99c2
c928595
9f7ee5b
09fdd01
82a5871
4f5ce94
6b1b8c9
e773180
82e4bb4
2559e05
ceec868
bae68fc
220550d
5480035
a54552c
5c29094
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 230 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMBuilder.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 261 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
ci.jenkins.io / Code Coverage
Partially covered line
Check warning on line 1650 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
ci.jenkins.io / Open Tasks Scanner
FIXME
Check warning on line 1991 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 335 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 385 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Partially covered line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can be sure it is only username / password credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rsandell Per my understanding, we can only have a HTTPS resolver from
GitHubSCMSource
. OnlyStandardUsernamePasswordCredentials
can be selected and used to connect to the GitHub API:I am not sure why it is not made more explicit with the typing.. But I don't see a scenario where it could be different and that makes sense since this SCM Source is using the GitHub Rest API..
The only specific scenario where we would see SSH if with the
SSHCheckoutTrait
and that is handled by the trait implementation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be an app credential couldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is, but
GitHubAppCredentials
implementsStandardUsernamePasswordCredentials
and is used for REST calls over HTTPS as well as mentioned Alan. So "HTTPS resolver only" here looks good to me.Check warning on line 648 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 1009 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Partially covered line
Check warning on line 1807 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 2940 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
ci.jenkins.io / Code Coverage
Not covered lines
Check warning on line 129 in src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceBuilder.java
ci.jenkins.io / Code Coverage
Not covered lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks to me that
credentials
andcredentialsId
could diverge. I think thatcredentialsId()
should returncredentials.getId()
in casecredentials
is set. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Would be more consistent to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeromepochat I applied your suggestion.