private List<Object> serializeAsList(Repository repo, Reason reason, String comment) { List<Object> result = new ArrayList<>(); result.add(Utils.getHostname()); result.add(this.rtScanner.getRunId()); result.add(Utils.formatCompleteDate(new Date())); result.add(repo.getId()); result.add(repo.getSlug()); result.add(reason.name()); result.add(comment); return result; }
private List<Object> serializeAsList() { Date date = new Date(); List<Object> dataCol = new ArrayList<Object>(); dataCol.add(runid); dataCol.add(buildId); dataCol.add(containerId); dataCol.add(Utils.formatCompleteDate(date)); dataCol.add(Utils.formatOnlyDay(date)); dataCol.add(Utils.getHostname()); dataCol.add(status); return dataCol; }
private List<Object> serializeAsList() { Date now = new Date(); String humanDuration = Utils.getDuration(this.beginDate, now); List<Object> dataCol = new ArrayList<Object>(); dataCol.add(this.runId); dataCol.add(Utils.getHostname()); dataCol.add(Utils.formatOnlyDay(this.beginDate)); dataCol.add(Utils.formatCompleteDate(this.beginDate)); dataCol.add(Utils.formatCompleteDate(now)); dataCol.add(humanDuration); dataCol.add(this.status); dataCol.add(this.nbBuilds); return dataCol; }
public void notifyEnd() { String subject = "Process "+processName+" on "+Utils.getHostname()+" finished"; Date endDate = new Date(); String message = "The following process: "+ processName +" launched on "+ Utils.getHostname()+ " the "+ this.launchDate.toString()+" and finished "+endDate.toString()+". " + "It ran for a total time of "+Utils.getDuration(this.launchDate, endDate); for (NotifierEngine engine : this.engines) { engine.notify(subject, message); } } }
private List<Object> serializeAsList(ProjectInspector inspector) { JobStatus jobStatus = inspector.getJobStatus(); BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected(); Build build = inspector.getBuggyBuild(); String state = getPrettyPrintState(inspector); String realState = StringUtils.join(jobStatus.getStepStatuses(), " -> "); String typeOfFailures = StringUtils.join(jobStatus.getFailureNames(), ",") + ""; List<Object> dataCol = new ArrayList<Object>(); dataCol.add(build.getId() + ""); dataCol.add(build.getRepository().getSlug()); dataCol.add(state); dataCol.add(build.getPullRequestNumber() + ""); dataCol.add(Utils.formatCompleteDate(build.getFinishedAt())); dataCol.add(Utils.formatOnlyDay(build.getFinishedAt())); dataCol.add(realState); dataCol.add(Utils.getHostname()); dataCol.add(Utils.formatCompleteDate(new Date())); dataCol.add(Utils.getTravisUrl(build.getId(), build.getRepository().getSlug())); dataCol.add(typeOfFailures); dataCol.add(buildToBeInspected.getRunId()); return dataCol; }
private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); result.addProperty("runId", this.runId); result.addProperty("buildId", this.buildId); result.addProperty("hostname", Utils.getHostname()); result.addProperty("nbProcessors", Runtime.getRuntime().availableProcessors()); result.addProperty("freeMemory", Runtime.getRuntime().freeMemory()); result.addProperty("totalMemory", Runtime.getRuntime().totalMemory()); return result; }
String url = Utils.getTravisUrl(build.getId(), this.getRepoSlug()); Date date = build.getFinishedAt(); fr.inria.spirals.repairnator.process.inspectors.properties.builds.Build buggyBuild = new fr.inria.spirals.repairnator.process.inspectors.properties.builds.Build(id, url, date); if (build != null) { id = build.getId(); url = Utils.getTravisUrl(build.getId(), this.getRepoSlug()); date = build.getFinishedAt(); fr.inria.spirals.repairnator.process.inspectors.properties.builds.Build patchedBuild = new fr.inria.spirals.repairnator.process.inspectors.properties.builds.Build(id, url, date); machineInfo.setHostName(Utils.getHostname()); repository.setUrl(Utils.getSimpleGithubRepoUrl(this.getRepoSlug())); repository.getOriginal().setName(repo.getParent().getFullName()); repository.getOriginal().setGithubId(repo.getParent().getId()); repository.getOriginal().setUrl(Utils.getSimpleGithubRepoUrl(repo.getParent().getFullName()));
public ProjectScanner(Date lookFromDate, Date lookToDate, String runId) { this.lookFromDate = lookFromDate; this.lookToDate = lookToDate; this.slugs = new HashSet<String>(); this.repositories = new HashSet<Repository>(); this.runId = runId; this.jTravis = RepairnatorConfig.getInstance().getJTravis(); this.logger.info("Look from " + Utils.formatCompleteDate(this.lookFromDate) + " to " + Utils.formatCompleteDate(this.lookToDate)); }
text += "\t Fixer build type: "+fixerBuildType+"\n" + "\t Type of build: "+inspector.getBuildToBeInspected().getStatus().name()+"\n" + "\t Date of the buggy build: "+Utils.formatCompleteDate(buggyBuild.getFinishedAt())+"\n" + "\t Url of the buggy build: "+Utils.getTravisUrl(buggyBuild.getId(), slug)+"\n" + "\t Date of the patched build: "+Utils.formatCompleteDate(patchedBuild.getFinishedAt())+"\n" + "\t Url of the patched build: "+Utils.getTravisUrl(patchedBuild.getId(), slug)+"\n";
File patch = patchList.get(i); String branchName = "repairnator-patch-" + Utils.formatFilenameDate(new Date()) + "-" + i; int status = GitHelper.gitCreateNewBranchAndCheckoutIt(this.getInspector().getRepoLocalPath(), branchName); if (status == 0) { String head = ghForkedRepo.getOwnerName() + ":" + branchName; String travisURL = Utils.getTravisUrl(this.getInspector().getBuggyBuild().getId(), this.getInspector().getRepoSlug());
patches.size() + " patch(es) has been found for the following build: "+ Utils.getTravisUrl(buggyBuild.getId(), repository.getSlug())+".\n"; String repoURL = Utils.getCompleteGithubRepoUrl(slug); String branchName = buggyBuild.getBranch().getName(); if (pullRequestOptional.isPresent()) { PullRequest pullRequest = pullRequestOptional.get(); repoURL = Utils.getCompleteGithubRepoUrl(pullRequest.getOtherRepo().getFullName()); branchName = pullRequest.getHeadRef().getRef(); } else {
public Launcher(String[] args) throws JSAPException { InputStream propertyStream = getClass().getResourceAsStream("/version.properties"); Properties properties = new Properties(); if (propertyStream != null) { try { properties.load(propertyStream); } catch (IOException e) { LOGGER.error("Error while loading property file.", e); } LOGGER.info("SCANNER VERSION: "+properties.getProperty("SCANNER_VERSION")); } else { LOGGER.info("No information about SCANNER VERSION has been found."); } JSAP jsap = this.defineArgs(); JSAPResult arguments = jsap.parse(args); LauncherUtils.checkArguments(jsap, arguments, LauncherType.SCANNER); this.initConfig(arguments); // "this.config" is only available after this call, which initializes the config if (this.config.isDebug()) { Utils.setLoggersLevel(Level.DEBUG); } else { Utils.setLoggersLevel(Level.INFO); } this.initSerializerEngines(); this.initNotifiers(); }
this.treatedBuildTracking = treatedBuildTracking; this.containerName = "repairnator-pipeline_"+ Utils.formatFilenameDate(new Date())+"_"+this.inputBuildId.getBuggyBuildId()+"_"+this.repairnatorConfig.getRunId(); String output = (this.repairnatorConfig.isCreateOutputDir()) ? "/var/log/"+this.repairnatorConfig.getRunId() : "/var/log";
private List<Object> serializeAsList(BuildToBeInspected buildToBeInspected) { List<Object> dataCol = new ArrayList<Object>(); Build build = buildToBeInspected.getPatchedBuild(); Build previousBuild = buildToBeInspected.getBuggyBuild(); long previousBuildId = (previousBuild != null) ? previousBuild.getId() : -1; String committerEmail = "nobody@github.com"; if (build.getCommitter().isPresent()) { committerEmail = build.getCommitter().get().getEmail(); } Date date = new Date(); dataCol.add(build.getId() + ""); dataCol.add(previousBuildId + ""); dataCol.add(buildToBeInspected.getStatus().name()); dataCol.add(build.getRepository().getSlug()); dataCol.add(Utils.formatCompleteDate(date)); dataCol.add(Utils.formatOnlyDay(date)); dataCol.add(Utils.getHostname()); dataCol.add(Utils.getTravisUrl(build.getId(), build.getRepository().getSlug())); dataCol.add(Utils.getTravisUrl(previousBuildId, build.getRepository().getSlug())); dataCol.add(committerEmail); dataCol.add(buildToBeInspected.getRunId()); return dataCol; }
private List<Object> serializeAsList() { List<Object> dataCol = new ArrayList<>(); dataCol.add(this.runId); dataCol.add(this.buildId); dataCol.add(Utils.getHostname()); dataCol.add(Runtime.getRuntime().availableProcessors()); dataCol.add(Runtime.getRuntime().freeMemory()); dataCol.add(Runtime.getRuntime().totalMemory()); return dataCol; } }
private List<Object> serializeAsList(ProjectInspector inspector, String toolName, JsonElement jsonElement) { BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected(); List<Object> result = new ArrayList<>(); result.add(Utils.formatCompleteDate(new Date())); result.add(buildToBeInspected.getRunId()); result.add(buildToBeInspected.getBuggyBuild().getId()); result.add(toolName); result.add(jsonElement.toString()); return result; }
Utils.setLoggersLevel(Level.DEBUG); } else { Utils.setLoggersLevel(Level.INFO);
private JsonElement serializeAsJson(BuildToBeInspected buildToBeInspected) { JsonObject result = new JsonObject(); Build build = buildToBeInspected.getPatchedBuild(); Build previousBuild = buildToBeInspected.getBuggyBuild(); long previousBuildId = (previousBuild != null) ? previousBuild.getId() : -1; String committerEmail = "nobody@github.com"; if (build.getCommitter().isPresent()) { committerEmail = build.getCommitter().get().getEmail(); } Date date = new Date(); result.addProperty("buildId", build.getId()); result.addProperty("previousBuildId", previousBuildId); result.addProperty("scannedStatus", buildToBeInspected.getStatus().name()); result.addProperty("repositoryName", build.getRepository().getSlug()); result.addProperty("dateScannedStr", Utils.formatCompleteDate(date)); this.addDate(result, "dateScanned", date); result.addProperty("dayScanned", Utils.formatOnlyDay(date)); result.addProperty("hostname", Utils.getHostname()); result.addProperty("travisBuildUrl", Utils.getTravisUrl(build.getId(), build.getRepository().getSlug())); result.addProperty("travisPreviousBuildUrl", Utils.getTravisUrl(previousBuildId, build.getRepository().getSlug())); result.addProperty("committerEmail", committerEmail); result.addProperty("runId", buildToBeInspected.getRunId()); return result; }
private JsonObject serializeAsJson(Repository repo, Reason reason, String comment) { JsonObject result = new JsonObject(); result.addProperty("hostname", Utils.getHostname()); result.addProperty("runId", this.rtScanner.getRunId()); this.addDate(result, "dateBlacklist", new Date()); result.addProperty("dateBlacklistStr", Utils.formatCompleteDate(new Date())); result.addProperty("repoId", repo.getId()); result.addProperty("repoName", repo.getSlug()); result.addProperty("reason", reason.name()); result.addProperty("comment", comment); return result; }
private JsonElement serializeAsJson() { Date date = new Date(); JsonObject result = new JsonObject(); result.addProperty("runId", runid); result.addProperty("buildId", buildId); result.addProperty("containerId", containerId); result.addProperty("dateReproducedBuildStr", Utils.formatCompleteDate(date)); this.addDate(result, "dateReproducedBuild", date); result.addProperty("dayReproducedBuild", Utils.formatOnlyDay(date)); result.addProperty("hostname", Utils.getHostname()); result.addProperty("status", status); return result; }