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

Mercurial polling does not expand parameters/tokens

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Ubuntu Linux
    • Similar Issues:

      Description

      In Mercurial Source Code Management, in the field "Branch", I have specified a build parameter $hgBranch.
      The default value for this parametrized build is "default" so as to hit the default branch.
      This works well when doing manual or time-triggered builds.

      But the Poll SCM build trigger does not seem to be expanding this parameter at all, resulting in the polling to not work at all.

      Here is the output of the Mercurial polling log:

      Started on May 13, 2011 3:00:42 PM
      [workspace] $ hg incoming --style /var/lib/jenkins/jobs/ds/workspace/tmp7235984072799037438style --no-merges --rev $hgBranch --newest-first
      comparing with http://192.168.15.239/ds
      abort: unknown revision '$hgBranch'!
      Done. Took 1 sec
      No changes

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Kim Randell would be a follow-up RFE blocking this one.

            Show
            jglick Jesse Glick added a comment - Kim Randell would be a follow-up RFE blocking this one.
            Hide
            krandell Kim Randell added a comment -

            Reopened as I'm not sure if my previous comment has much visibility when the issue is closed.

            Show
            krandell Kim Randell added a comment - Reopened as I'm not sure if my previous comment has much visibility when the issue is closed.
            Hide
            krandell Kim Randell added a comment -

            Would it be possible to fix this for Choice parameters as well as strings? This is often a more suitable and less error-prone way of parameterising branches.

            Show
            krandell Kim Randell added a comment - Would it be possible to fix this for Choice parameters as well as strings? This is often a more suitable and less error-prone way of parameterising branches.
            Hide
            marc_swingler Marc Swingler added a comment -

            Thanks for looking into it Jesse. I've just updated to 1.514 and latest for my installed plugins. I'll see if the issue is still reproducible early next week.

            Show
            marc_swingler Marc Swingler added a comment - Thanks for looking into it Jesse. I've just updated to 1.514 and latest for my installed plugins. I'll see if the issue is still reproducible early next week.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/mercurial/MercurialSCM.java
            src/test/java/hudson/plugins/mercurial/SCMTestBase.java
            http://jenkins-ci.org/commit/mercurial-plugin/7d5b7d52221b55e7cb6bee5ae280bb3ecd2ffe9f
            Log:
            [FIXED JENKINS-9686] Expand default values of string parameters when polling.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/test/java/hudson/plugins/mercurial/SCMTestBase.java http://jenkins-ci.org/commit/mercurial-plugin/7d5b7d52221b55e7cb6bee5ae280bb3ecd2ffe9f Log: [FIXED JENKINS-9686] Expand default values of string parameters when polling.
            Hide
            jglick Jesse Glick added a comment -

            @marc_swingler your issue is not related I think. If you know how to reproduce, file it separately.

            Show
            jglick Jesse Glick added a comment - @marc_swingler your issue is not related I think. If you know how to reproduce, file it separately.
            Hide
            jglick Jesse Glick added a comment -

            Polling and checkout are distinct so these could probably be considered separate bugs (though the fixes might be analogous or even overlap).

            Show
            jglick Jesse Glick added a comment - Polling and checkout are distinct so these could probably be considered separate bugs (though the fixes might be analogous or even overlap).
            Hide
            marc_swingler Marc Swingler added a comment -

            I'm not sure if this should be classified as a bug or a request for enhancement, but I'm seeing a similar issue with environment variables. I'm using the EnvInject Plugin, which claims that it "Executes a setup script before or/and after a SCM checkout for a run" I've defined environment variables prior to SCM checkout called "MERCURIAL_URL" and "MERCURIAL_BRANCH". I'd like to use them under "Repository URL", "Branch" and "Repository browser/URL." I tried with just MERCURIAL_URL for "Repository URL" under various forms:

            ${env.MERCURIAL_URL}
            ${MERCURIAL_URL}
            %env.MERCURIAL_URL%
            %MERCURIAL_URL%

            None worked and the Console Output logs clearly show the variable has not been expanded.

            https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

            Show
            marc_swingler Marc Swingler added a comment - I'm not sure if this should be classified as a bug or a request for enhancement, but I'm seeing a similar issue with environment variables. I'm using the EnvInject Plugin, which claims that it "Executes a setup script before or/and after a SCM checkout for a run" I've defined environment variables prior to SCM checkout called "MERCURIAL_URL" and "MERCURIAL_BRANCH". I'd like to use them under "Repository URL", "Branch" and "Repository browser/URL." I tried with just MERCURIAL_URL for "Repository URL" under various forms: ${env.MERCURIAL_URL} ${MERCURIAL_URL} %env.MERCURIAL_URL% %MERCURIAL_URL% None worked and the Console Output logs clearly show the variable has not been expanded. https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                marc_boscher Marc Boscher
              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: