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

Multibranch scm variable not accessible from non-main scripts

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      See PR 198 for details. Intuitively you would expect the scm global variable to be defined in all loaded code, but it is only available from the main script, and there is no straightforward way for other CpsScript instances to get it.

      Need to find a way to make global variables reliably be accessible from all script files loaded in a flow build. Current idea is to save them in CpsThreadGroup.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java
            http://jenkins-ci.org/commit/workflow-plugin/2394bf99cb8c0b18181edc75c41059ab8158df65
            Log:
            Merge pull request #198 from jglick/multibranch-globalVariable

            JENKINS-30222 Multibranch/global var incompatibility

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/c1699b7e924f...2394bf99cb8c

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java http://jenkins-ci.org/commit/workflow-plugin/2394bf99cb8c0b18181edc75c41059ab8158df65 Log: Merge pull request #198 from jglick/multibranch-globalVariable JENKINS-30222 Multibranch/global var incompatibility Compare: https://github.com/jenkinsci/workflow-plugin/compare/c1699b7e924f...2394bf99cb8c
            Hide
            jglick Jesse Glick added a comment -

            Will be solved as part of JENKINS-30531.

            Show
            jglick Jesse Glick added a comment - Will be solved as part of JENKINS-30531 .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScript.java
            multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java
            multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMVar.java
            multibranch/src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMVar/help.jelly
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java
            http://jenkins-ci.org/commit/workflow-plugin/4e9bd117797620e2f11c03f4053e8210d3086eac
            Log:
            [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record.
            Has the happy side effect of fixing JENKINS-30222: scm as a global variable can be used unqualified from library code.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScript.java multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMVar.java multibranch/src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMVar/help.jelly multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java http://jenkins-ci.org/commit/workflow-plugin/4e9bd117797620e2f11c03f4053e8210d3086eac Log: [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record. Has the happy side effect of fixing JENKINS-30222 : scm as a global variable can be used unqualified from library code.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScript.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/587f35da06082e0ee5c8f925d0877a63c0e123b0
            Log:
            [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record.
            Has the happy side effect of fixing JENKINS-30222: scm as a global variable can be used unqualified from library code.
            Originally-Committed-As: 4e9bd117797620e2f11c03f4053e8210d3086eac

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScript.java http://jenkins-ci.org/commit/workflow-cps-plugin/587f35da06082e0ee5c8f925d0877a63c0e123b0 Log: [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record. Has the happy side effect of fixing JENKINS-30222 : scm as a global variable can be used unqualified from library code. Originally-Committed-As: 4e9bd117797620e2f11c03f4053e8210d3086eac
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java
            multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMVar.java
            multibranch/src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMVar/help.jelly
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/d8d9403029143715efee336d7094d46cef758d6f
            Log:
            [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record.
            Has the happy side effect of fixing JENKINS-30222: scm as a global variable can be used unqualified from library code.
            Originally-Committed-As: 4e9bd117797620e2f11c03f4053e8210d3086eac

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMVar.java multibranch/src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMVar/help.jelly multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinderTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/d8d9403029143715efee336d7094d46cef758d6f Log: [FIXED JENKINS-30531] Set SCMRevisionAction when we do a build, so client code can get access to this record. Has the happy side effect of fixing JENKINS-30222 : scm as a global variable can be used unqualified from library code. Originally-Committed-As: 4e9bd117797620e2f11c03f4053e8210d3086eac

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: