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

Token expansion fails when workspace is not available

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 2.19
      Delivery Pipeline Plugin 0.10.1
      Token Macro Plugin 2.0
    • Similar Issues:

      Description

      If the workspace of a job is not available, task name token expansion fails since the token macro plugin is trying to get the workspace of the node where the build was performed. If the workspace or node is not available, token expansion fails which causes a TokenMacroException. A log message will be emitted and TokenUtils returns an empty string. If your view contains a lot of tasks / pipelines the Jenkins log will be flooded. See https://github.com/Diabol/delivery-pipeline-plugin/blob/master/src/main/java/se/diabol/jenkins/pipeline/token/TokenUtils.java#L51.

      This causes the configured task names not to be shown in the delivery pipeline view (even if no expandable variables exist), which makes the task names default to the job name.

      Workaround is to downgrade token-macro plugin to 1.x of 1.9 or later.

        Attachments

          Activity

          Hide
          tommysdk Tommy Tynjä added a comment -

          The behavior of token-macro plugin has changed in 2.0 so it requires the workspace to be accessible. A workaround for this issue is to downgrade token-macro plugin to 1.10.

          Show
          tommysdk Tommy Tynjä added a comment - The behavior of token-macro plugin has changed in 2.0 so it requires the workspace to be accessible. A workaround for this issue is to downgrade token-macro plugin to 1.10.
          Hide
          tommysdk Tommy Tynjä added a comment -

          Proposed solution for solving task names defaulting to job names: https://github.com/Diabol/delivery-pipeline-plugin/pull/226

          Show
          tommysdk Tommy Tynjä added a comment - Proposed solution for solving task names defaulting to job names: https://github.com/Diabol/delivery-pipeline-plugin/pull/226
          Hide
          tommysdk Tommy Tynjä added a comment -

          Proposed solution in pull request 226 merged. Will be part of next release.

          Show
          tommysdk Tommy Tynjä added a comment - Proposed solution in pull request 226 merged. Will be part of next release.
          Show
          tommysdk Tommy Tynjä added a comment - Released in 0.10.2 https://github.com/Diabol/delivery-pipeline-plugin/releases/tag/delivery-pipeline-plugin-0.10.2
          Hide
          owengo Olivier Schiavo added a comment -

           

          With "cloud" nodes it is very frequent to have jobs with transient workspace which exists only for the duration of the job. All environment variables are available and token expansion would be very useful.

          The so-called "solution for solving task names"  is basically a try / catch with failover, it breaks environment variable in the task name once the job is finished.

          Is there any plan to allow tokenmacro expansion even without a workspace ?

          In the current state the delivery-pipeline-plugin is broken for task built on a transient node.

           

           

          Show
          owengo Olivier Schiavo added a comment -   With "cloud" nodes it is very frequent to have jobs with transient workspace which exists only for the duration of the job. All environment variables are available and token expansion would be very useful. The so-called "solution for solving task names"  is basically a try / catch with failover, it breaks environment variable in the task name once the job is finished. Is there any plan to allow tokenmacro expansion even without a workspace ? In the current state the delivery-pipeline-plugin is broken for task built on a transient node.    

            People

            Assignee:
            tommysdk Tommy Tynjä
            Reporter:
            tommysdk Tommy Tynjä
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: