blackducksoftware / hub-detect

This is now deprecated. Please see synopsys-detect.
Apache License 2.0
38 stars 39 forks source link

bazel detector #373

Closed stevebillings closed 5 years ago

stevebillings commented 5 years ago

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.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+1.4%) to 30.493% when pulling fc1038a57c4bb3ebd14f42b2e0947a57a181189f on sb_bazelDetector into ceb72847caa127bea4185f69d43cf419b39bda39 on master.