Skip to content

Conversation

andrian-sevastyanov
Copy link
Contributor

Description

Property detect.excluded.detectors to exclude individual detectors.
This provides more granularity on top of pre-existing inclusion/exclusion properties.

}

@NotNull
public DetectableEnvironment getEnvironment() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal wasn't strictly necessary, but since this method seems to have been around for years and never used, I decided to remove it.

}

DetectableDefinition definition = entryPoint.getPrimary();
if (detectableExclusionEvaluator.isDetectableExcluded(definition)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if statement is the primary addition here. Most of the rest of this method was simply extracted from a for loop.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new configuration property detect.excluded.detectors that allows users to exclude individual detectors by name, providing more granular control than the existing detector type exclusions.

  • Added DetectableExclusionEvaluator class to handle detector exclusion logic
  • Integrated the exclusion evaluator into the detector evaluation pipeline
  • Updated error messages and documentation to reference the new property

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
DetectProperties.java Adds the new DETECT_EXCLUDED_DETECTORS property definition
DetectConfigurationFactory.java Adds method to retrieve excluded detectors from configuration
OperationRunner.java Integrates the exclusion evaluator into the detector execution flow
DetectableExclusionEvaluator.java New class implementing case-insensitive, space-agnostic detector name matching
DetectorRuleEvaluator.java Modified to use the exclusion evaluator and refactored evaluation logic
DetectorRuleEvaluation.java Removed unused DetectableEnvironment parameter
DetectableEvaluator.java Simplified method signature by moving Detectable creation upstream
ExitCodeType.java Updated error message to reference new exclusion property
currentreleasenotes.md Added release note for the new feature
DetectableExclusionEvaluatorTest.java Comprehensive test coverage for exclusion logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

andrian-sevastyanov and others added 3 commits September 18, 2025 15:16
…racy/entrypoint/DetectorRuleEvaluator.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…etectProperties.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
FAILURE_POLICY_VIOLATION(3, "Detect found policy violations."),
FAILURE_PROXY_CONNECTIVITY(4, "Detect was unable to use the configured proxy. Check your configuration and connection."),
FAILURE_DETECTOR(5, "Detect had one or more detector failures while extracting dependencies. Check that all projects build and your environment is configured correctly."),
FAILURE_DETECTOR(5, "Detect had one or more detector failures while extracting dependencies. Check that all projects build and your environment is configured correctly. Alternatively, consider disabling individual Detectors using the --" + DetectProperties.DETECT_EXCLUDED_DETECTORS.getKey() + " property."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure if I'm for or against this...think for as it might get some users out of the woods...but just want to point out that there are a few other things that could correct this behavior, depending on what happened, and we don't really mention them here. Might be worth some discussion with the team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I was on the fence about this as well. I will hold off merging until we get a chance to chat about it early next week.

andrian-sevastyanov and others added 3 commits September 22, 2025 08:03
…cs (#1550)

* Add test that ensures that detectable names in code match those in docs

* Format comment

* Update src/test/java/com/blackduck/integration/detect/tool/detector/DetectorRuleFactoryTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix test syntax

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrian-sevastyanov andrian-sevastyanov merged commit 4eeeb4c into master Sep 22, 2025
@andrian-sevastyanov andrian-sevastyanov deleted the dev/andrians/IDETECT-4842 branch September 22, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants