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

Add support for folder credentials

    Details

    • Similar Issues:

      Description

      It is only possible to supply Global credentials. In the snippet generator we only see Global credentials but not Folder credentials.

      If we try to use Folder credentials in the script anyway, we end up with an error:

      java.lang.IllegalArgumentException: The suplied credentials are invalid to login
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.getGitHubIfValid(GitHubStatusNotificationStep.java:234)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.getRepoIfValid(GitHubStatusNotificationStep.java:239)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.access$100(GitHubStatusNotificationStep.java:75)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep$Execution.run(GitHubStatusNotificationStep.java:344)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep$Execution.run(GitHubStatusNotificationStep.java:326)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at hudson.security.ACL.impersonate(ACL.java:221)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Finished: FAILURE
      

        Attachments

          Activity

          Show
          allan_burdajewicz Allan BURDAJEWICZ added a comment - The context provided to the lookup is Jenkins.getInstance() . We should pass the Run or the Job . Same for the [dropdown in Snippet Generator] ( https://github.com/jenkinsci/pipeline-githubnotify-step-plugin/blob/master/src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java#L280 )
          Hide
          raul_arabaolaza Raul Arabaolaza added a comment -

          Makes sense, I will fix this ASAP

          Show
          raul_arabaolaza Raul Arabaolaza added a comment - Makes sense, I will fix this ASAP
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          pom.xml
          src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java
          http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/5409f11f184db3eab6c76b4f91d5050b043c825a
          Log:
          JENKINS-42955 Unit test for issue

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: pom.xml src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/5409f11f184db3eab6c76b4f91d5050b043c825a Log: JENKINS-42955 Unit test for issue
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
          http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/a09443fcfc6dc327ce07aa21bf8374f4cce03416
          Log:
          JENKINS-42955 Use the Job as context for lookup credentials

          • Previously using the jenkins instance, resulting in not being able to
            find Folder credentials

          Compare: https://github.com/jenkinsci/pipeline-githubnotify-step-plugin/compare/5409f11f184d^...a09443fcfc6d

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/a09443fcfc6dc327ce07aa21bf8374f4cce03416 Log: JENKINS-42955 Use the Job as context for lookup credentials Previously using the jenkins instance, resulting in not being able to find Folder credentials Compare: https://github.com/jenkinsci/pipeline-githubnotify-step-plugin/compare/5409f11f184d ^...a09443fcfc6d
          Hide
          raul_arabaolaza Raul Arabaolaza added a comment -

          Allan BURDAJEWICZ I have created a PR to fix this, if you want to comment is here.

          Will give some days before merging and I will cut a new release after merging

          Show
          raul_arabaolaza Raul Arabaolaza added a comment - Allan BURDAJEWICZ I have created a PR to fix this, if you want to comment is here . Will give some days before merging and I will cut a new release after merging
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java
          http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/2e846dd784b174e11bd3e560f84c11992a742499
          Log:
          JENKINS-42955 Some text fixes

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/2e846dd784b174e11bd3e560f84c11992a742499 Log: JENKINS-42955 Some text fixes
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Raúl Arabaolaza Barquin
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java
          src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java
          http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/e036e84668a73d26ed5abe68265dccf335b6d8f6
          Log:
          JENKINS-42955 Add support for folder credentials (#3)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raúl Arabaolaza Barquin Path: pom.xml src/main/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubStatusNotificationStep.java src/test/java/org/jenkinsci/plugins/pipeline/githubstatusnotification/GitHubNotificationPipelineStepTest.java http://jenkins-ci.org/commit/pipeline-githubnotify-step-plugin/e036e84668a73d26ed5abe68265dccf335b6d8f6 Log: JENKINS-42955 Add support for folder credentials (#3) JENKINS-42955 Unit test for issue JENKINS-42955 Use the Job as context for lookup credentials
          Hide
          rarabaolaza Raul Arabaolaza added a comment - - edited

          Version 1.0.2 released with this fix

          Show
          rarabaolaza Raul Arabaolaza added a comment - - edited Version 1.0.2 released with this fix

            People

            • Assignee:
              rarabaolaza Raul Arabaolaza
              Reporter:
              allan_burdajewicz Allan BURDAJEWICZ
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: