use of com.walmartlabs.concord.imports.NoopImportManager in project concord by walmartlabs.
the class Main method start.
private static ProcessSnapshot start(Runner runner, ProcessConfiguration cfg, Path workDir, Map<String, Object> args) throws Exception {
// assume all imports were processed by the agent
ProjectLoaderV2 loader = new ProjectLoaderV2(new NoopImportManager());
ProcessDefinition processDefinition = loader.load(workDir, new NoopImportsNormalizer(), ImportsListener.NOP_LISTENER).getProjectDefinition();
Map<String, Object> initiator = cfg.initiator();
if (initiator != null) {
// when the process starts the process' initiator and the current user are the same
args.put(Constants.Request.INITIATOR_KEY, initiator);
args.put(Constants.Request.CURRENT_USER_KEY, initiator);
}
return runner.start(cfg, processDefinition, args);
}
use of com.walmartlabs.concord.imports.NoopImportManager in project concord by walmartlabs.
the class Lint method call.
@Override
public Integer call() throws Exception {
if (!Files.isDirectory(targetDir)) {
throw new IllegalArgumentException("Not a directory: " + targetDir);
}
ProjectLoader loader = new ProjectLoader(new NoopImportManager());
ProcessDefinition pd = loader.loadProject(targetDir, new DummyImportsNormalizer(), verbose ? new CliImportsListener() : null).projectDefinition();
List<LintResult> lintResults = new ArrayList<>();
linters().forEach(l -> lintResults.addAll(l.apply(pd)));
if (!lintResults.isEmpty()) {
print(lintResults);
println();
}
println("Found:");
println(" imports: " + pd.imports().items().size());
println(" profiles: " + pd.profiles().size());
println(" flows: " + pd.flows().size());
println(" forms: " + pd.forms().size());
println(" triggers: " + pd.triggers().size());
println(" (not counting dynamically imported resources)");
println();
printStats(lintResults);
println();
boolean hasErrors = hasErrors(lintResults);
if (hasErrors) {
println("@|red,bold INVALID|@");
} else {
println("@|green,bold VALID|@");
}
return hasErrors ? 10 : 0;
}
Aggregations