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

Duplicated Warnings links when used with Flexible Publish plugin

    XMLWordPrintable

Details

    Description

      On my Visual Studio builds page, the MSBuild Warnings link displays twice, linking to the same report. However, on the report page, it only shows one link.

      Attachments

        1. 2014-07-10_11-00-51-2.png
          2014-07-10_11-00-51-2.png
          105 kB
        2. 2014-07-10_11-16-27-2.png
          2014-07-10_11-16-27-2.png
          82 kB
        3. build.log
          24 kB
        4. 2014-08-06_15-18-16.png
          2014-08-06_15-18-16.png
          8 kB
        5. 2014-08-06_15-29-46.png
          2014-08-06_15-29-46.png
          28 kB

        Activity

          davidruhmann David Ruhmann added a comment -

          Using the freestyle project type.

          davidruhmann David Ruhmann added a comment - Using the freestyle project type.
          davidruhmann David Ruhmann added a comment -

          However, I have checked and if I do a similar publisher conditional on a maven project type, the same issue exists.

          davidruhmann David Ruhmann added a comment - However, I have checked and if I do a similar publisher conditional on a maven project type, the same issue exists.

          I think you are not using the conditional build step plugin here, but the flexible publish plugin https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin
          The conditional build step plugin only works with build steps, but you are using post actions/publishers

          can you confirm this are all "post build actions"?

          domi Dominik Bartholdi added a comment - I think you are not using the conditional build step plugin here, but the flexible publish plugin https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin The conditional build step plugin only works with build steps, but you are using post actions/publishers can you confirm this are all "post build actions"?
          davidruhmann David Ruhmann added a comment -

          @Dominik Oh sorry about that. Yeah, it is the flexible publish plugin. I got them confused and thought they were the same.

          davidruhmann David Ruhmann added a comment - @Dominik Oh sorry about that. Yeah, it is the flexible publish plugin. I got them confused and thought they were the same.
          ikedam ikedam added a comment -

          I know this behavior well.
          I conclude that it's not a bug (a behavior to be fixed), but a limitation (a behavior not to be fixed).

          As it is very complicated, I'm not sure I can exactly explain the details (I know my English is poor). But I try that:

          • Post build steps (Publisher) displays links in the left side of project pages by implementing Publisher#getProjectActions.
          • You can use each Publisher at most only once in a project. For example, if you added "Archiving artifacts" to a project, you cannot add more new "Archiving artifacts" to that project.
          • Using Flexible Publish, you can define a same Publisher for multiple times. This is an irregular case. For example, you can add two "Archiving artifacts" for condition A and condition B. This results Publisher#getProjectActions of a same Publisher are called multiple times for a project. This results duplicated links in a project page.
          • As described before, Publisher should be defined only one in a project. So it's not a bug of Publisher to display duplicated links.
          • At the same time, Flexible Publish does not know how to handle links. Those links may be better to be displayed for each definition, or may be better to be displayed only once (like Warnings plugin).

          As far as I know, this behavior doesn't results harmful, and I don't plan to fix it.

          If you try to fix that, the way of SubProjectsAction of parameterized-trigger plugin may be helpful.
          https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/SubProjectsAction.java
          https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/resources/hudson/plugins/parameterizedtrigger/SubProjectsAction/jobMain.groovy

          If multiple {{SubProjectsAction}}s are defined to a build, it aggregates all {{SubProjectsAction}}s to display.
          I think aggregating WarningsProjectAction and displaying a link only for the first one would fix the behavior.
          But it would get so complicated, and may cause other problems.
          And you need to fix not warnings-plugin, but analysis-core-plugin. It may affect other plugins using analysis-core-plugin.

          ikedam ikedam added a comment - I know this behavior well. I conclude that it's not a bug (a behavior to be fixed), but a limitation (a behavior not to be fixed). As it is very complicated, I'm not sure I can exactly explain the details (I know my English is poor). But I try that: Post build steps ( Publisher ) displays links in the left side of project pages by implementing Publisher#getProjectActions . You can use each Publisher at most only once in a project. For example, if you added "Archiving artifacts" to a project, you cannot add more new "Archiving artifacts" to that project. Using Flexible Publish, you can define a same Publisher for multiple times. This is an irregular case. For example, you can add two "Archiving artifacts" for condition A and condition B. This results Publisher#getProjectActions of a same Publisher are called multiple times for a project. This results duplicated links in a project page. As described before, Publisher should be defined only one in a project. So it's not a bug of Publisher to display duplicated links. At the same time, Flexible Publish does not know how to handle links. Those links may be better to be displayed for each definition, or may be better to be displayed only once (like Warnings plugin). As far as I know, this behavior doesn't results harmful, and I don't plan to fix it. If you try to fix that, the way of SubProjectsAction of parameterized-trigger plugin may be helpful. https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/SubProjectsAction.java https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/resources/hudson/plugins/parameterizedtrigger/SubProjectsAction/jobMain.groovy If multiple {{SubProjectsAction}}s are defined to a build, it aggregates all {{SubProjectsAction}}s to display. I think aggregating WarningsProjectAction and displaying a link only for the first one would fix the behavior. But it would get so complicated, and may cause other problems. And you need to fix not warnings-plugin, but analysis-core-plugin. It may affect other plugins using analysis-core-plugin.

          People

            drulli Ulli Hafner
            davidruhmann David Ruhmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: