-
Notifications
You must be signed in to change notification settings - Fork 84
feat. Bazel V2 Detector With Bzlmod Support #1634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR introduces the Bazel V2 detector, a comprehensive rewrite that delivers robust, mode-agnostic dependency extraction for both BZLMOD (MODULE.bazel) and WORKSPACE-based Bazel projects. The V2 detector replaces the legacy detector's hardcoded WORKSPACE-only approach with an intelligent pipeline selection system that automatically detects the Bazel environment mode and probes the dependency graph to determine which extraction pipelines to run.
Changes:
- Introduced automatic Bazel mode detection (BZLMOD vs WORKSPACE) with graceful fallback and manual override capability
- Implemented intelligent dependency graph probing to automatically select appropriate extraction pipelines
- Enhanced HTTP-family detection with mode-aware strategies and configurable probe limits
- Renamed
detect.bazel.workspace.rulestodetect.bazel.dependency.sourcesfor consistent naming across modes
Reviewed changes
Copilot reviewed 43 out of 47 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/com/blackduck/integration/detect/lifecycle/run/operation/OperationRunner.java |
Switches from legacy Bazel detector to new V2 detector |
src/main/java/com/blackduck/integration/detect/configuration/DetectProperties.java |
Renames property from DETECT_BAZEL_WORKSPACE_RULES to DETECT_BAZEL_DEPENDENCY_SOURCES and adds new properties for mode override and HTTP probe limit |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/DependencySource.java |
Renames enum from WorkspaceRule to DependencySource for consistent terminology |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/v2/BazelV2Detectable.java |
New V2 detectable implementation with mode detection and graph probing |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/v2/BazelEnvironmentAnalyzer.java |
Detects Bazel mode (BZLMOD vs WORKSPACE) via bazel mod show_repo probe |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/v2/BazelGraphProber.java |
Probes dependency graph to determine which pipelines to enable |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/v2/HttpFamilyProber.java |
Mode-aware HTTP archive detection with configurable probe limits |
detectable/src/main/java/com/blackduck/integration/detectable/detectables/bazel/pipeline/Pipelines.java |
Adds mode-aware HTTP pipeline selection (bzlmod vs workspace variants) |
documentation/src/main/markdown/packagemgrs/bazel.md |
Comprehensive documentation update explaining V2 features, properties, and troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR introduces the Bazel V2 detector, delivering mode-agnostic dependency extraction for both BZLMOD (MODULE.bazel) and WORKSPACE projects.
Code Deep Dive Wiki (Recommended because this is a huge change): Detect V2 Deep Dive
Key features
Properties introduced/changed