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

readTrusted Pipeline from SCM only works in */master

    Details

    • Similar Issues:

      Description

      Using a branch with Pipeline from SCM breaks readTrusted. The following snippet only works from */master and not */bugfix/break-readTrusted. See https://github.com/initialzero/jenkins-break-readtrusted.git with branch and pipeline from scm.

      #!groovy
      node {
       stage('test') {
        def trustedText = readTrusted 'foo.properties'
        echo trustedText
       }
      }
      

       

      Error message from Jenkins is:

      ERROR: ‘readTrusted’ is only available when using “Multibranch Pipeline” or “Pipeline script from SCM”

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Prevents JENKINS-31386 from working; seems to have regressed from JENKINS-33273 fix.

            Show
            jglick Jesse Glick added a comment - Prevents  JENKINS-31386 from working; seems to have regressed from  JENKINS-33273 fix.
            Hide
            jglick Jesse Glick added a comment -

            There are actually two bugs here. readTrusted was not working correctly with CpsScmFlowDefinition when the SCM plugin forced a heavyweight checkout. And the Git plugin was needlessly blocking lightweight checkouts when setting a branch on a checkout, because this code is too strict: does not match */x/y as a refspec.

            Show
            jglick Jesse Glick added a comment - There are actually two bugs here. readTrusted was not working correctly with CpsScmFlowDefinition when the SCM plugin forced a heavyweight checkout. And the Git plugin was needlessly blocking lightweight checkouts when setting a branch on a checkout, because this code is too strict: does not match */x/y as a refspec.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStep.java
            src/test/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStepTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/60417b6017779aaf4ebd5d75e25039edca4f27ec
            Log:
            JENKINS-42817 readTrusted was producing a misleading error when using CpsScmFlowDefinition on an SCM rejecting lightweight checkouts.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStep.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/60417b6017779aaf4ebd5d75e25039edca4f27ec Log: JENKINS-42817 readTrusted was producing a misleading error when using CpsScmFlowDefinition on an SCM rejecting lightweight checkouts.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStep.java
            src/test/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStepTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/c49261f827d032a637475071ba6742f0c40a8653
            Log:
            Merge pull request #67 from jglick/readTrusted-heavyweight-JENKINS-42817

            JENKINS-42817 readTrusted broke with CpsScmFlowDefinition & heavyweight checkouts

            Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/f261fb4772e4...c49261f827d0

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStep.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/c49261f827d032a637475071ba6742f0c40a8653 Log: Merge pull request #67 from jglick/readTrusted-heavyweight- JENKINS-42817 JENKINS-42817 readTrusted broke with CpsScmFlowDefinition & heavyweight checkouts Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/f261fb4772e4...c49261f827d0
            Hide
            markewaite Mark Waite added a comment -

            Included in git plugin 3.5.1 released 5 Aug 2017

            Show
            markewaite Mark Waite added a comment - Included in git plugin 3.5.1 released 5 Aug 2017
            Hide
            initialzero Marc Benstein added a comment -

            Please review this again. I am still unable to use branches with readTrusted. Current git plugin version is 3.5.1.

            Show
            initialzero Marc Benstein added a comment - Please review this again. I am still unable to use branches with readTrusted. Current git plugin version is 3.5.1.
            Hide
            jglick Jesse Glick added a comment -

            Marc Benstein the reproduced issue was fixed with tests. If you are still having problems, either you are not actually running the fix versions, or you have some other bug—in which case file a new report with complete steps to reproduce from scratch and link to this one.

            Show
            jglick Jesse Glick added a comment - Marc Benstein the reproduced issue was fixed with tests. If you are still having problems, either you are not actually running the fix versions, or you have some other bug—in which case file a new report with complete steps to reproduce from scratch and link to this one.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                initialzero Marc Benstein
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: