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

Warnings plugin doesn't allow environment variables in file names

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Jenkins 1.656
      Centos 5
      Warnings plugin 2.52

    Description

      When configuring file names to be scanned for compiler warnings, it would be good to be able to use build environment variables (similar to other fields e.g. the Command field in an Execute Shell box).

      I'd like to be able to enter "${CLEARCASE_VIEWPATH}/vobs/somePath/build_output" into the File Pattern field of Scan Workspace Files. But it doesn't expand the ${CLEARCASE_VIEWPATH}.

      I can work around it by using "*/vobs/somePath/build_output" as that filename is unique. But I shouldn't have to.

      Attachments

        Issue Links

          Activity

            annafreiholtz Anna Freiholtz added a comment - - edited

            I couldn't shell command, I don't know why. (We never use shell in Jenkins.) So I added a build step Execute Windows Batch Command instead:

            echo %BUILD_NUMBER%
            

            Console output:

            D:\Q1>echo 2186 
            2186
            
            D:\Q1>exit 0 
            [WARNINGS] Parsing warnings in files '${BUILD_NUMBER}_master\ND4\ReleaseTools\Build\Log\warning.log' with parser Warning.log parser
            [WARNINGS] Finding all files that match the pattern ${BUILD_NUMBER}_master\ND4\ReleaseTools\Build\Log\warning.log
            [WARNINGS] Computing warning deltas based on reference build #2181_TP_10564
            

            2181 is the previous successful build.

            My Jenkins job also use the plugin for injecting env variables.

            annafreiholtz Anna Freiholtz added a comment - - edited I couldn't shell command, I don't know why. (We never use shell in Jenkins.) So I added a build step Execute Windows Batch Command instead: echo %BUILD_NUMBER% Console output: D:\Q1>echo 2186 2186 D:\Q1>exit 0 [WARNINGS] Parsing warnings in files '${BUILD_NUMBER}_master\ND4\ReleaseTools\Build\Log\warning.log' with parser Warning.log parser [WARNINGS] Finding all files that match the pattern ${BUILD_NUMBER}_master\ND4\ReleaseTools\Build\Log\warning.log [WARNINGS] Computing warning deltas based on reference build #2181_TP_10564 2181 is the previous successful build. My Jenkins job also use the plugin for injecting env variables.

            I tested to create a new Jenkins job where the only build step is

            echo %BUILD_NUMBER%
            

            Console output:

            d:\JenkinsSlave\workspace\TestWarningPlugin>echo 2 
            2
            
            d:\JenkinsSlave\workspace\TestWarningPlugin>exit 0 
            [WARNINGS] Parsing warnings in files '${BUILD_NUMBER}' with parser Texas Instruments Code Composer Studio (C/C++)
            [WARNINGS] Finding all files that match the pattern ${BUILD_NUMBER}
            [WARNINGS] Computing warning deltas based on reference build #1
            
            annafreiholtz Anna Freiholtz added a comment - I tested to create a new Jenkins job where the only build step is echo %BUILD_NUMBER% Console output: d:\JenkinsSlave\workspace\TestWarningPlugin>echo 2 2 d:\JenkinsSlave\workspace\TestWarningPlugin>exit 0 [WARNINGS] Parsing warnings in files '${BUILD_NUMBER}' with parser Texas Instruments Code Composer Studio (C/C++) [WARNINGS] Finding all files that match the pattern ${BUILD_NUMBER} [WARNINGS] Computing warning deltas based on reference build #1
            drulli Ulli Hafner added a comment -

            I see. Maybe expansion does not work in the same way on Windows. I'm not sure if I can setup a test fixture that uses a Windows slave.

            drulli Ulli Hafner added a comment - I see. Maybe expansion does not work in the same way on Windows. I'm not sure if I can setup a test fixture that uses a Windows slave.

            I apologize, I was under the impression that I had installed the latest version of the plugin. But I hadn't... Now I have updated the plugin and it is working! Sorry again.

            annafreiholtz Anna Freiholtz added a comment - I apologize, I was under the impression that I had installed the latest version of the plugin. But I hadn't... Now I have updated the plugin and it is working! Sorry again.
            drulli Ulli Hafner added a comment -

            When you are reopening an issue it makes sense to write a comment why it is not solved. Or why it happens again.

            drulli Ulli Hafner added a comment - When you are reopening an issue it makes sense to write a comment why it is not solved. Or why it happens again.

            People

              drulli Ulli Hafner
              gfim Graham Menhennitt
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: