• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • pipeline-githubnotify-step-plugin 1.0.0
      jenkins 2.36

      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.

          [JENKINS-40422] Inferring credentials resolves wrong credential

          Martin Ringehahn created issue -
          Martin Ringehahn made changes -
          Description Original: 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.
          New: 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.

          Hi chrono,

          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

          Raul Arabaolaza added a comment - Hi chrono , 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
          Raul Arabaolaza made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          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

          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

          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

          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

          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

          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

          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

          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
          Raul Arabaolaza made changes -
          Remote Link New: This issue links to "PR-2 (Web Link)" [ 15148 ]

          chrono 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

          Raul Arabaolaza added a comment - chrono 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

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

              Created:
              Updated: