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

Warnings plugin doesn't allow environment variables in file names

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • Jenkins 1.656
      Centos 5
      Warnings plugin 2.52

      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.

          [JENKINS-34157] Warnings plugin doesn't allow environment variables in file names

          Graham Menhennitt created issue -

          Ulli Hafner added a comment -

          Hmm, this has been implemented in https://github.com/jenkinsci/warnings-plugin/pull/33.

          Ulli Hafner added a comment - Hmm, this has been implemented in https://github.com/jenkinsci/warnings-plugin/pull/33 .
          Ulli Hafner made changes -
          Link New: This issue is related to JENKINS-30735 [ JENKINS-30735 ]

          I can use Build Parameters but not env variables.

          Anna Freiholtz added a comment - I can use Build Parameters but not env variables.

          Ulli Hafner added a comment -

          I see. I thought both types are expanded by the API.

          Ulli Hafner added a comment - I see. I thought both types are expanded by the API.

          Do you think it is doable to handle env variables as well?

          Anna Freiholtz added a comment - Do you think it is doable to handle env variables as well?

          Ulli Hafner added a comment -

          Of course. The current expansion just needs to be replaced with a different API call. I need to look into some other plug-ins how these are done...

          Ulli Hafner added a comment - Of course. The current expansion just needs to be replaced with a different API call. I need to look into some other plug-ins how these are done...

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/test/java/plugins/WarningsPluginTest.java
          http://jenkins-ci.org/commit/acceptance-test-harness/11b0e681946950461406e9fd4e4bd35211f85347
          Log:
          JENKINS-34157 Added test case that shows that environment variabes are expanded.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/test/java/plugins/WarningsPluginTest.java http://jenkins-ci.org/commit/acceptance-test-harness/11b0e681946950461406e9fd4e4bd35211f85347 Log: JENKINS-34157 Added test case that shows that environment variabes are expanded.

          Ulli Hafner added a comment -

          In my test environment variables are correctly expanded.

          How is your environment variable set?

          Can you add a build step that echoes the variable?

          echo value=${CLEARCASE_VIEWPATH};
          

          Ulli Hafner added a comment - In my test environment variables are correctly expanded. How is your environment variable set? Can you add a build step that echoes the variable? echo value=${CLEARCASE_VIEWPATH};
          Ulli Hafner made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: