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

support thrown from publisher job statuses

XMLWordPrintable

      Boolean return from publishers is deprecated, but there is a total mess in all plugins and core about it. New and right variant now is to fail build with throw AbortException. Such errors are not catched in flexible publish and first thrown publisher stops flexible execution for other publishers nevertheless on configured conditions.
      According to my debugging plugin must

      try { perform } catch { return false;} 
      

      somewhere in root calls in addition to boolean return codes

      Executor #1 for master : executing job #73@9386, prio=5, in group 'main', status: 'RUNNING'
      	  at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:281)
      	  at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
      	  at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
      	  at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
      	  at org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:183)
      	  at org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:116)
      	  at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      	  at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
      	  at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
      	  at hudson.model.Build$BuildExecution.post2(Build.java:182)
      	  at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
      	  at hudson.model.Run.execute(Run.java:1731)
      	  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	  at hudson.model.ResourceController.execute(ResourceController.java:88)
      	  at hudson.model.Executor.run(Executor.java:232)
      

      Also if flexible-publish needs itself fail build - it must throw AbortException
      See https://github.com/KostyaSha/git-plugin/commit/3af2af6af273a10e9c5ab4e4d200222bc39c2f3e for example.

            ikedam ikedam
            integer Kanstantsin Shautsou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: