Class ResetQualityGateCommand


  • public class ResetQualityGateCommand
    extends Object
    Resets the quality gate of a static analysis tool to a clean state. Provides a manual way to restart the new warnings quality gate evaluation from a clean state (without new warnings). I.e., once this command has been started the next build (started automatically or manually) will not evaluate a quality gate that considers the number of new warnings. This helps to start over from a clean state if the number of new warnings have been increased accidentally. Otherwise you won't get a successful build anymore until all new warnings have been fixed.

    Technically, this command just adds a marker action to the selected build. Once a new build is running, this marker action will be checked for existence and the quality gate will be bypassed for one single build.

    Author:
    Ullrich Hafner
    • Constructor Detail

      • ResetQualityGateCommand

        public ResetQualityGateCommand()
    • Method Detail

      • execute

        public void execute​(Run<?,​?> selectedBuild,
                            String id)
        Resets the quality gate for the specified analysis tool. This command does not run if not enabled.
        Parameters:
        selectedBuild - the selected build that will show the action link
        id - the ID of the static analysis tool that should be reset
        See Also:
        isEnabled(Run, String)
      • resetReferenceBuild

        public void resetReferenceBuild​(Run<?,​?> selectedBuild,
                                        String id)
        Resets the quality gate for the specified analysis tool.
        Parameters:
        selectedBuild - the selected build that will show the action link
        id - the ID of the static analysis tool that should be reset
      • isEnabled

        public boolean isEnabled​(Run<?,​?> selectedBuild,
                                 String id)
        Returns whether the command to reset the quality gate for the specified analysis tool is enabled or not.
        Parameters:
        selectedBuild - the selected build that will show the action link
        id - the ID of the static analysis tool that should be reset
        Returns:
        true if the command is enabled, false otherwise