Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40422

Inferring credentials resolves wrong credential

    Details

    • Similar Issues:

      Description

      The inference for the github credentials uses getCredentials which return checkout credentials.

      Checkout credentials can be SSH credentials, unsuitable for API calls such as commit status updates.

      When checkout credentials are SSH credentials, inference fails with: java.lang.IllegalArgumentException: The credentialsId does not seem to exist, please check it

      Instead, the plugin should probably use getScanCredentialsId to obtain its credentials.

        Attachments

          Issue Links

            Activity

            Hide
            rarabaolaza Raul Arabaolaza added a comment -

            Hi Martin Ringehahn,

            Thanks a lot for your time and feedback, Your suggestion makes a lot of sense, I will investigate this and keep you informed

            Regards, Raúl

            Show
            rarabaolaza Raul Arabaolaza added a comment - Hi Martin Ringehahn , Thanks a lot for your time and feedback, Your suggestion makes a lot of sense, I will investigate this and keep you informed Regards, Raúl
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Raul
            Path:
            src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
            http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/77a59ad97a85ec7da331cba8b40d844a033d239e
            Log:
            JENKINS-40422 Use scanCredentials if available over checkoutCredentials

            When you use a separate set of credentials for checkout and scanning
            it makes sense to use the scan credentials to notify, for example it could
            be that checkout credentials are of type SSH whilst scan are of type username/
            password, or even that due to GH API limits both of them may be adecuate
            but you want to use the scan ones

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/77a59ad97a85ec7da331cba8b40d844a033d239e Log: JENKINS-40422 Use scanCredentials if available over checkoutCredentials When you use a separate set of credentials for checkout and scanning it makes sense to use the scan credentials to notify, for example it could be that checkout credentials are of type SSH whilst scan are of type username/ password, or even that due to GH API limits both of them may be adecuate but you want to use the scan ones
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Raul
            Path:
            src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
            http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/90e63f1d945fc1218e590145e52e7fed296d9ae2
            Log:
            JENKINS-40422 Use scanCredentials for infering

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/90e63f1d945fc1218e590145e52e7fed296d9ae2 Log: JENKINS-40422 Use scanCredentials for infering
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Raul
            Path:
            src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
            http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/a902495a7dcd5a613239f02b01109ca741de5dd6
            Log:
            JENKINS-40422 Use scanCredentials instead of checkoutCredentials

            When you use a separate set of credentials for checkout and scanning
            it makes sense to use the scan credentials to notify, for example it could
            be that checkout credentials are of type SSH whilst scan are of type username/
            password

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/a902495a7dcd5a613239f02b01109ca741de5dd6 Log: JENKINS-40422 Use scanCredentials instead of checkoutCredentials When you use a separate set of credentials for checkout and scanning it makes sense to use the scan credentials to notify, for example it could be that checkout credentials are of type SSH whilst scan are of type username/ password
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Raul
            Path:
            src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
            http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/d88d474e93d96a264b82baa984be2a1096e92016
            Log:
            JENKINS-40422 Use scanCredentials instead of checkoutCredentials

            When you use a separate set of credentials for checkout and scanning
            it makes sense to use the scan credentials to notify, for example it could
            be that checkout credentials are of type SSH whilst scan are of type username/
            password

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/d88d474e93d96a264b82baa984be2a1096e92016 Log: JENKINS-40422 Use scanCredentials instead of checkoutCredentials When you use a separate set of credentials for checkout and scanning it makes sense to use the scan credentials to notify, for example it could be that checkout credentials are of type SSH whilst scan are of type username/ password
            Hide
            rarabaolaza Raul Arabaolaza added a comment -

            Martin Ringehahn I have attached the PR in case you want to take a look, I will wait two days before merging and cut a new minor version of the plugin

            Show
            rarabaolaza Raul Arabaolaza added a comment - Martin Ringehahn I have attached the PR in case you want to take a look, I will wait two days before merging and cut a new minor version of the plugin
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Raúl Arabaolaza Barquin
            Path:
            src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
            http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/9ddafe848d297abfc4fbd7f3d7a11fc1edc6b110
            Log:
            Merge pull request #2 from jenkinsci/JENKINS-40422

            JENKINS-40422 Inferring credentials resolves wrong credential

            Compare: https://github.com/jenkinsci/pipeline-githubnotify-step-plugin/compare/ecf5373b47ac...9ddafe848d29

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raúl Arabaolaza Barquin Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/9ddafe848d297abfc4fbd7f3d7a11fc1edc6b110 Log: Merge pull request #2 from jenkinsci/ JENKINS-40422 JENKINS-40422 Inferring credentials resolves wrong credential Compare: https://github.com/jenkinsci/pipeline-githubnotify-step-plugin/compare/ecf5373b47ac...9ddafe848d29
            Hide
            liyatikal liyatikal added a comment -

            Jenkins 2.73.2/Jenkins 2.89.2

            Pipeline GitHub Notify Step Plugin 1.0.3

            My pipeline command:
            script.githubNotify repo: "git@github.com:xxx/yyy.git", account: "xxx", credentialsId: "jenkins_ssh_key_github", sha: "zzzzz}", status: script.currentBuild.currentResult

            Still get this error:

            java.lang.IllegalArgumentException: The credentialsId does not seem to exist, please check it

             

            Please advice

            Show
            liyatikal liyatikal added a comment - Jenkins 2.73.2/Jenkins 2.89.2 Pipeline GitHub Notify Step Plugin 1.0.3 My pipeline command: script.githubNotify repo: "git@github.com:xxx/yyy.git", account: "xxx", credentialsId: "jenkins_ssh_key_github", sha: "zzzzz}", status: script.currentBuild.currentResult Still get this error: java.lang.IllegalArgumentException: The credentialsId does not seem to exist, please check it   Please advice

              People

              • Assignee:
                rarabaolaza Raul Arabaolaza
                Reporter:
                chrono Martin Ringehahn
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: