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

Git Publisher plugin does not use token macro expressions for tag name

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When configuring the git publisher to push tags back to the origin repository. A user can put token macros in the tag name. However these token macros are not expanded:

      Consider the following configuration snippet:

      <hudson.plugins.git.GitPublisher plugin="git@1.3.0"><configVersion>2</configVersion><pushMerge>false</pushMerge><pushOnlyIfSuccess>false</pushOnlyIfSuccess><tagsToPush><hudson.plugins.git.GitPublisher_-TagToPush><targetRepoName>origin</targetRepoName><tagName>${ENV,var="JOB_NAME"}-tag-that-does-not-exit</tagName><tagMessage/><createTag>false</createTag><updateTag>false</updateTag></hudson.plugins.git.GitPublisher_-TagToPush></tagsToPush></hudson.plugins.git.GitPublisher>

      This tag does not exist, mostly because I did not want to affect my repo for testing. But the error on the console demonstrates token macro expansion was not done:
      Tag ${ENV,var="JOB_NAME"}-tag-that-does-not-exit does not exist and Create Tag is not specified, so failing.
      Build step 'Git Publisher' marked build as failure
      Notifying upstream projects of job completion
      Finished: FAILURE

        Attachments

          Issue Links

            Activity

            Hide
            mpower_dodtsair Mike Power added a comment -

            Reviewed the code, it seems git plugin produces token macro expressions but never uses them. Seems to be a case for a feature request instead of a bug.

            Show
            mpower_dodtsair Mike Power added a comment - Reviewed the code, it seems git plugin produces token macro expressions but never uses them. Seems to be a case for a feature request instead of a bug.
            Hide
            integer Kanstantsin Shautsou added a comment -

            git-plugin may have optional dependency on token-macro plugin and then it maybe used for string expansions.

            Show
            integer Kanstantsin Shautsou added a comment - git-plugin may have optional dependency on token-macro plugin and then it maybe used for string expansions.
            Hide
            mdkf Michael Fowler added a comment -
            Show
            mdkf Michael Fowler added a comment - Fixed in Pull Request: https://github.com/jenkinsci/git-plugin/pull/448

              People

              • Assignee:
                Unassigned
                Reporter:
                mpower_dodtsair Mike Power
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: