• 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

          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

          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

          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

          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

          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

          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

          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

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

              Created:
              Updated: