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

Shared Library, cannot access global-scoped credentials when using Modern SCM while it is possible with the legacy SCM

    Details

    • Similar Issues:

      Description

      In a folder, as standard user, when I try to add a global-scoped credential using the git implementation of the "modern SCM",  I cannot select any credentials while it is possible to select the credentails when selecting git the Legacy SCM.

      As administrator, it is possible to select the global-scope credential in both (Modern and Legacy) implementation.

      The issue seems liked to the fact that when using the modern scm In jenkins.plugins.git.GitSCMSource.DescriptorImpl.doFillCredentialsIdItems(SCMSourceOwner, String, String), the context parameter is null.

      When the legacy SCM is selected, in the hudson.plugins.git.UserRemoteConfig.DescriptorImpl.doFillCredentialsIdItems(Item, String, String) method, the project is not null and the global-scoped credentials are listed.

       

      When I try the same process at the level of a job, both the modern and legacy SCM are able to list the credentials.

      The issue could be liked to JENKINS-38048.

       

       

       

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andy Neebel
            Path:
            src/main/java/jenkins/scm/impl/subversion/SubversionSCMSource.java
            http://jenkins-ci.org/commit/subversion-plugin/c056e9af67458d94106f617ab97e2579b5f27b92
            Log:
            JENKINS-49624 Fix selecting credentials for Pipeline Libraries using Modern SCM (#206)

            Comes from JENKINS-44271, applying fix for git-plugin to subversion-plugin

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andy Neebel Path: src/main/java/jenkins/scm/impl/subversion/SubversionSCMSource.java http://jenkins-ci.org/commit/subversion-plugin/c056e9af67458d94106f617ab97e2579b5f27b92 Log: JENKINS-49624 Fix selecting credentials for Pipeline Libraries using Modern SCM (#206) Comes from JENKINS-44271 , applying fix for git-plugin to subversion-plugin
            Hide
            guillaumichaud Guillaume Michaud added a comment -

            Show
            guillaumichaud Guillaume Michaud added a comment -
            Hide
            markewaite Mark Waite added a comment -

            Fixed in git plugin 3.5.1 released 5 Aug 2017

            Show
            markewaite Mark Waite added a comment - Fixed in git plugin 3.5.1 released 5 Aug 2017
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/plugins/git/GitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/8e901a8e4a82a19eca8adb0f11c77f26ce043b36
            Log:
            Merge pull request #505 from acontes/JENKINS-44271

            JENKINS-44271 doFillcredentialsId to look for Item not SCMSourceOwner.

            Compare: https://github.com/jenkinsci/git-plugin/compare/e08051a8e571...8e901a8e4a82

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/plugins/git/GitSCMSource.java http://jenkins-ci.org/commit/git-plugin/8e901a8e4a82a19eca8adb0f11c77f26ce043b36 Log: Merge pull request #505 from acontes/ JENKINS-44271 JENKINS-44271 doFillcredentialsId to look for Item not SCMSourceOwner. Compare: https://github.com/jenkinsci/git-plugin/compare/e08051a8e571...8e901a8e4a82
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: acontes
            Path:
            src/main/java/jenkins/plugins/git/GitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/9841317807c4320ebb7db9688f28939fdb8198e5
            Log:
            JENKINS-44271 doFillcredentialsId to look for Item not SCMSourceOwner.

            The method GitSCMSource.DescriptorImpl#doFillCredentialsIdItems
            expects the parameter 'context' to be an SCMSourceOwner which breaks
            the ability to add a global library at the level of a folder with the
            modern SCM implementation. Changing the parameter type from
            SCMSourceOwner to Item solves the issue.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: acontes Path: src/main/java/jenkins/plugins/git/GitSCMSource.java http://jenkins-ci.org/commit/git-plugin/9841317807c4320ebb7db9688f28939fdb8198e5 Log: JENKINS-44271 doFillcredentialsId to look for Item not SCMSourceOwner. The method GitSCMSource.DescriptorImpl#doFillCredentialsIdItems expects the parameter 'context' to be an SCMSourceOwner which breaks the ability to add a global library at the level of a folder with the modern SCM implementation. Changing the parameter type from SCMSourceOwner to Item solves the issue.
            Hide
            guillaumichaud Guillaume Michaud added a comment -

            +1

            Show
            guillaumichaud Guillaume Michaud added a comment - +1
            Hide
            acontes Arnaud Contes added a comment -

            a patch that fixed the issue is visible at this PR : https://github.com/jenkinsci/git-plugin/pull/505

             

            Show
            acontes Arnaud Contes added a comment - a patch that fixed the issue is visible at this PR : https://github.com/jenkinsci/git-plugin/pull/505  

              People

              • Assignee:
                Unassigned
                Reporter:
                acontes Arnaud Contes
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: