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

quality gate setting to only set stage to unstable except of whole build

      It would be nice to have the possibility to set only the stage result to unstable if quality gates are not satisfied. 
      e.g. like possible with the CatchErrorStep
      There it is handled with the following code snippet:

       

      if (buildResult.isWorseThan(Result.SUCCESS)) {
        context.get(Run.class).setResult(buildResult);
      }
      if (stepResult.isWorseThan(Result.SUCCESS)) {
        context.get(FlowNode.class).addOrReplaceAction(new WarningAction(stepResult).withMessage(message));
      } 

      Currently the warning-ng-plugin is using `io.jenkins.plugins.util.PipelineResultHandler`
      which always sets both the build and the stage result.

      public void setResult(final Result result, final String message) {
        run.setResult(result);
        WarningAction existing = flowNode.getPersistentAction(WarningAction.class);
        if (existing == null || existing.getResult().isBetterThan(result)) {
          flowNode.addOrReplaceAction(new WarningAction(result).withMessage(message));
        }
      } 

      In some usecases it would really be helpful to still visualize not met quality gates but not alter the whole build result.

      Or is there any workaround to already get the desired behaviour?

       

          [JENKINS-72059] quality gate setting to only set stage to unstable except of whole build

          Kevin Broselge created issue -
          Ulli Hafner made changes -
          Component/s New: plugin-util-api-plugin [ 26521 ]
          Ulli Hafner made changes -
          Labels New: hacktoberfest
          Ulli Hafner made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Ulli Hafner made changes -
          Labels Original: hacktoberfest
          Ulli Hafner made changes -
          Remote Link New: This issue links to "plugin-util-api #309 (Web Link)" [ 29300 ]
          Ulli Hafner made changes -
          Component/s New: coverage-plugin [ 29223 ]
          Ulli Hafner made changes -
          Remote Link New: This issue links to "coverage-plugin #52 (Web Link)" [ 29301 ]
          Ulli Hafner made changes -
          Remote Link New: This issue links to "warnings-plugin #1649 (Web Link)" [ 29405 ]
          Kalle Niemitalo made changes -
          Link New: This issue relates to JENKINS-57801 [ JENKINS-57801 ]
          Ulli Hafner made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

            drulli Ulli Hafner
            thebro Kevin Broselge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: