Add Bazel support - #18
Open
pjcdawkins wants to merge 6 commits into
Open
Conversation
Implements reusable Bazel parser that integrates with language-specific managers: - Core parser supports BUILD, MODULE.bazel, and WORKSPACE files - Smart Maven coordinate conversion (e.g., com_google_guava_guava -> com.google.guava:guava) - Integrated with Java manager following existing multi-build-tool pattern - Comprehensive test coverage for all parsing scenarios - Designed for future expansion to Python, Go, and other languages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Features added: - Python manager integration with pip dependency parsing (@pip//package_name) - Go manager integration with external repository parsing (@com_github_org_repo//) - Smart Go module name conversion (com_github_gorilla_mux -> github.com/gorilla/mux) - Support for golang.org/x packages (org_golang_x_time -> golang.org/x/time) - Comprehensive test coverage for both Python and Go integrations - Improved code quality with switch statements instead of if-else chains 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Features added: - Comprehensive WORKSPACE file parsing for http_archive, git_repository, and maven_install - Version extraction from tags, commits, and version fields - Support for legacy Bazel dependency management patterns - Dedicated workspace dependency category for better organization - Complete test coverage for WORKSPACE parsing scenarios This provides full coverage of both modern (MODULE.bazel) and legacy (WORKSPACE) Bazel dependency management. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Features added: - Bazel build tool detection using .bazel file extensions to avoid false positives - Comprehensive integration test showing Spring Boot framework detection with Bazel build system - Test case demonstrates real-world scenario: Spring Boot app using Bazel for builds with Maven dependencies - Validates that both framework (Spring Boot) and build tool (Bazel) are correctly detected together - Shows proper Maven package manager integration alongside Bazel This completes the Bazel integration by ensuring proper detection and testing of polyglot build scenarios. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ions for Bazel This commit completes the Bazel dependency parsing implementation with: - Enhanced Maven coordinate parsing with sophisticated heuristics for complex patterns like org_springframework_spring_core and io_grpc_grpc_netty_shaded - Known library pattern recognition for Spring Framework, Apache Commons, Jackson, gRPC, and Netty - Performance optimizations including thread-safe caching for Maven coordinate parsing results - JavaScript/npm dependency support in Bazel BUILD files - Comprehensive test coverage for all language integrations - Cache management functions for monitoring and memory cleanup The implementation now handles real-world Maven coordinate complexity while maintaining high performance through strategic caching of expensive parsing operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix misleading regex comment to clarify @repo// format matching - Add capacity hint to slice allocation for better performance - Limit regex matches to 1000 to prevent excessive memory allocation - Correct comment about generic underscore replacement (dots only) - Implement proper artifact ID normalization with underscore-to-hyphen conversion - Fix code style by moving nil check before comment block 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive Bazel build system support, adding dependency parsing capabilities that integrate with existing language-specific dependency managers (Java, Python, Go, JavaScript). The implementation includes sophisticated Maven coordinate parsing with caching optimizations and extends the framework detection to include Bazel-based Spring Boot projects.
Key changes include:
- Added complete Bazel dependency parser with support for BUILD, WORKSPACE, and MODULE.bazel files
- Integrated Bazel parsing into existing Java, Python, Go, and JavaScript dependency managers
- Enhanced build tool detection with specific Bazel file patterns to avoid false positives
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/dep/bazel.go |
New comprehensive Bazel dependency parser with Maven coordinate parsing and caching |
pkg/dep/bazel_test.go |
Extensive test suite covering all Bazel parsing scenarios and integration tests |
pkg/dep/java.go |
Integration of Bazel dependencies into Java dependency manager |
pkg/dep/python.go |
Integration of Bazel dependencies into Python dependency manager |
pkg/dep/go.go |
Enhanced Go manager with Bazel dependency support and duplicate prevention |
pkg/dep/js.go |
JavaScript manager integration with Bazel dependency merging |
config/build_tools.yml |
Added Bazel build tool detection rule |
pkg/rules/analyze_testfs_test.go |
Test data and expectations for Spring Boot + Bazel integration |
expr.cache |
Cache file update with new Bazel file detection expression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements comprehensive Bazel dependency parsing that integrates with existing dependency managers (Java, Python, Go, JavaScript) in the whatsun
project.
Key Features
Implementation Details
Test Plan
🤖 Generated with https://claude.ai/code