public void run() { if (this.getBuildToBeInspected().getStatus() != ScannedBuildStatus.PASSING_AND_PASSING_WITH_TEST_CHANGES) { AbstractStep cloneRepo = new CloneRepository(this); cloneRepo .addNextStep(new CheckoutBuggyBuild(this, true)) .addNextStep(new BuildProject(this)) .addNextStep(new ComputePlugins(this, false)) .addNextStep(new Checkstyle(this)); super.setFinalStep(new ComputeSourceDir(this, false, true)); super.getFinalStep(). addNextStep(new WritePropertyFile(this)). addNextStep(new CommitProcessEnd(this)). addNextStep(new PushProcessEnd(this)); cloneRepo.setDataSerializer(this.getSerializers()); cloneRepo.setNotifiers(this.getNotifiers()); this.printPipeline(); try { cloneRepo.execute(); } catch (Exception e) { this.getJobStatus().addStepError("Unknown", e.getMessage()); this.logger.error("Exception catch while executing steps: ", e); } } else { this.logger.debug("Build " + this.getBuggyBuild().getId() + " is not a failing build."); } }
protected void initProperties() { this.getJobStatus().getProperties().setVersion("Checkstyle 0.1"); super.initProperties(); }
private void mainProcess() { LOGGER.info("Start by getting the build (buildId: "+this.getConfig().getBuildId()+") with the following config: "+this.getConfig()); this.getBuildToBeInspected(); HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, this.getConfig().getRunId(), this.getConfig().getBuildId()+""); hardwareInfoSerializer.serialize(); List<AbstractDataSerializer> serializers = new ArrayList<>(); if (this.getConfig().getLauncherMode() == LauncherMode.BEARS) { serializers.add(new InspectorSerializer4Bears(this.engines)); } else { serializers.add(new InspectorSerializer(this.engines)); } serializers.add(new PropertiesSerializer(this.engines)); serializers.add(new InspectorTimeSerializer(this.engines)); serializers.add(new PipelineErrorSerializer(this.engines)); serializers.add(new PatchesSerializer(this.engines)); serializers.add(new ToolDiagnosticSerializer(this.engines)); ProjectInspector inspector; if (this.getConfig().getLauncherMode() == LauncherMode.BEARS) { inspector = new ProjectInspector4Bears(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } else if (this.getConfig().getLauncherMode() == LauncherMode.CHECKSTYLE) { inspector = new ProjectInspector4Checkstyle(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } else { inspector = new ProjectInspector(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } inspector.setPatchNotifier(this.patchNotifier); inspector.run(); LOGGER.info("Inspector is finished. The process will exit now."); System.exit(0); }