-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
# Conflicts: # hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/diagnostic/RelevantFileTracker.java # hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/profiling/BomToolAggregateTimings.java # hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/util/ReportConstants.java
…set of xpath-based rules
…or test refactoring
…ore code via SimpleToolDetector and ToolRunner
@AcceptableValues(value = { "DETECTOR", "DOCKER" }, caseSensitive = true, strict = true, isCommaSeparatedList = true) | ||
DETECT_PROJECT_TOOL("detect.project.tool", "5.0.0", PropertyType.STRING, PropertyAuthority.None, "DETECTOR,DOCKER"), | ||
@AcceptableValues(value = { "DETECTOR", "DOCKER", "BAZEL" }, caseSensitive = true, strict = true, isCommaSeparatedList = true) | ||
DETECT_PROJECT_TOOL("detect.project.tool", "5.0.0", PropertyType.STRING, PropertyAuthority.None, "DOCKER,DETECTOR,BAZEL"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the docker and detector order deliberately swapped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was making the ordering in the help match the default ordering. Thought it might avoid some potential confusion.
if (dockerToolResult.resultType == DockerToolResult.DockerToolResultType.FAILURE) { | ||
eventSystem.publishEvent(Event.ExitCode, new ExitCodeRequest(ExitCodeType.FAILURE_GENERAL_ERROR, dockerToolResult.errorMessage)); | ||
} | ||
ToolRunner toolRunner = new ToolRunner(eventSystem, detectContext.getBean(DockerDetector.class, detectorEnvironment)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but you should retrieve the DetectorFactory and ask it to create the detectors. But since these are technically 'not detectors' I don't know what we want.
DetectorFactory detectorFactory = detectContext.getBean(DetectorFactory.class);
detectorFactory.createDocker();
} catch (ExecutableRunnerException e) { | ||
logger.debug(String.format("Bazel version threw exception: %s", e.getMessage())); | ||
return new ExecutableNotFoundDetectorResult("bazel"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably move this to the executable finder if it is just a version check.
if (!hasLookedForSystemBazel) { | ||
final String userProvidedBazelPath = detectConfiguration.getProperty(DetectProperty.DETECT_BAZEL_PATH, PropertyAuthority.None); | ||
resolvedBazel = executableFinder.getExecutablePathOrOverride(ExecutableType.BAZEL, true, environment.getDirectory(), userProvidedBazelPath); | ||
hasLookedForSystemBazel = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it might fit the CacheableExecutableFinder model - might not need it's own class. But this is perfectly fine.
…- if a project order is not supplied and a decision is needed, detect will error out. (picking up Jordan's change from master).
… command) to BazelExecutableFinder
# Conflicts: # detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/DetectTool.java # hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/lifecycle/run/RunManager.java
This PR adds the new bazel tool. Here's the overview:
Behavior of the bazel tool (the ExternalId extraction part) is driven by a set of rules. Given how flexible and extensible bazel is, we assume that some customers will need to be able to tweak these rules for their environment and bazel extensions. BazelExternalIdExtractionSimpleRule is intended to represent an relatively easily-tweakable rule. Unfortunately I don't think we know nearly enough yet to be at all confident that SimpleRule exposes the right details. I assume our understanding (and SimpleRule) is likely to change, so I have not yet added the properties to allow the user to tweak it's values.
SimpleRules are converted into FullRules (BazelExternalIdExtractionFullRule), and FullRules are what actually drive the ExternalId extraction behavior. These can be overridden by the user, but they are complex, and the user must provide a json file to overwrite them. I'm pretty sure that I'll be providing those json files to customers as they run into problems with the hard-coded default rules. Early on as we're trying to get this working for early customers, I think it'll be important to have the ability swap in a new set of rules. Whether we leave that capability in detect forever is an open question.
So here's the flow (BazelExtractor): SimpleRules -> FullRules -> ExternalIds -> BDIO dependencies.