Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix checkout over ssh #821

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

MartinHelwig
Copy link
Contributor

@MartinHelwig MartinHelwig commented Mar 4, 2024

Use the checkoutCredentialsId if available so that the credentials are an instance of SSHUserPrivateKey, the protocol switches to ssh and getCloneLink do not fail. This should fix #811

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

@@ -159,7 +160,7 @@
StandardCredentials credentials = BitbucketCredentials.lookupCredentials(
scmSource.getServerUrl(),
scmSource.getOwner(),
credentialsId,
DescriptorImpl.SAME.equals(scmSource.getCheckoutCredentialsId()) ? credentialsId : scmSource.getCheckoutCredentialsId(),

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
BitbucketSCMSource.getCheckoutCredentialsId
should be avoided because it has been deprecated.
@@ -159,7 +160,7 @@
StandardCredentials credentials = BitbucketCredentials.lookupCredentials(
scmSource.getServerUrl(),
scmSource.getOwner(),
credentialsId,
DescriptorImpl.SAME.equals(scmSource.getCheckoutCredentialsId()) ? credentialsId : scmSource.getCheckoutCredentialsId(),

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
BitbucketSCMSource.getCheckoutCredentialsId
should be avoided because it has been deprecated.
@lifeofguenter
Copy link
Contributor

@MartinHelwig can you please have a look at the merge conflicts?

@MartinHelwig
Copy link
Contributor Author

@lifeofguenter the merge conflicts are resolved.

@lifeofguenter lifeofguenter merged commit cf4056c into jenkinsci:master Mar 13, 2024
16 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Can't find clone link for protocol HTTP" With Checkout over SSH
2 participants