Bazel/intro #2227
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2227
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2227/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1646
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1646
Original created: 2025-09-18T04:20:19Z
Original updated: 2025-09-19T01:57:18Z
Original head: carverauto/serviceradar:bazel/intro
Original base: main
Original merged: 2025-09-19T01:57:10Z by @mfreeman451
PR Type
Enhancement
Description
Initialize Bazel build system for monorepo migration
Configure multi-language toolchains (Go, Rust, Node.js, OCaml)
Set up remote caching and build configuration
Add comprehensive implementation plan documentation
Diagram Walkthrough
File Walkthrough
2 files
Comprehensive Bazel migration roadmap and strategyDocumentation for Bazel tooling helpers7 files
Multi-language toolchain and dependency configurationGlobal build and test configuration settingsMinimal workspace configuration with bzlmod referencePlaceholder build file for Next.js appNPM registry configuration for Bazel integrationRoot package placeholder build filePin Bazel version to 8.4.11 files
Bazelisk wrapper script for repository commands1 files
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1646#issuecomment-3305368441
Original created: 2025-09-18T04:20:54Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Toolchain Registration
Node.js toolchains are explicitly registered for multiple targets; ensure these labels exist for the selected rules_nodejs version and that only the correct toolchain targets (not both target and toolchain labels) are registered to avoid duplicate or invalid toolchain registrations across platforms.
Integrity Pinning
The archive_override for rules_ocaml pins a SHA256; verify the hash and source URL match the intended release and document why archive_override is needed to avoid supply-chain drift or mismatch when updating.
Lockfile Mismatch
The repo uses pnpm (pnpm-lock.yaml) for npm_translate_lock, but the BUILD exports package-lock.json; consider aligning to pnpm files only to prevent confusion and accidental divergence in dependency graphs.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1646#issuecomment-3305369720
Original created: 2025-09-18T04:21:52Z
PR Code Suggestions ✨
Explore these optional code suggestions:
✅
Fix incorrect lockfile exportSuggestion Impact:
The committed BUILD.bazel changes now reference pnpm-lock.yaml (included in data for nextjs_standalone_build) instead of package-lock.json, aligning with the suggestion’s intent to use pnpm-lock.yaml.code diff:
In
web/BUILD.bazel, exportpnpm-lock.yamlinstead ofpackage-lock.jsonto matchthe file referenced by the
npm_translate_lockrule inMODULE.bazel.web/BUILD.bazel [2-5]
[Suggestion processed]Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical mismatch between the
pnpm-lock.yamlfile required bynpm_translate_lockinMODULE.bazeland thepackage-lock.jsonfile actually exported inweb/BUILD.bazel, which would cause a build failure.Simplify Node.js toolchain registration
Simplify the Node.js toolchain registration by using the
@nodejs_toolchains//:alltarget instead of explicitly listing eachplatform-specific toolchain.
MODULE.bazel [111-120]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies redundant toolchain registrations and proposes a simpler, more maintainable approach using the
:alltarget, which is a standard Bazel practice.Defer Node.js dependency integration
Defer the inclusion of
pnpm-lock.yamland thenpm_translate_lockconfiguration.This is because no Bazel targets currently utilize these Node.js dependencies,
and their inclusion adds unnecessary complexity to this initial setup PR.
Examples:
MODULE.bazel [124-132]
web/pnpm-lock.yaml [1-4615]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies that including the large
pnpm-lock.yamland its processing is premature, as no Bazel targets use these Node.js dependencies yet, improving the PR's focus.Imported GitHub PR review comment.
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1646#discussion_r2360334878
Original created: 2025-09-18T17:04:04Z
Original path: pkg/srql/parser/gen/antlr/pkg/srql/antlr/BUILD.bazel
Original line: 1
probably can get rid of teh pkg/srql at this point
Imported GitHub PR review comment.
Original author: @github-advanced-security[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1646#discussion_r2360577084
Original created: 2025-09-18T18:07:27Z
Original path: .github/workflows/bazel-bootstrap.yml
Original line: 32
Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Show more details
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1646#issuecomment-3309604519
Original created: 2025-09-18T20:31:07Z
CI Feedback 🧐
A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
Action: build-test
Failed stage: Install dependencies (with tests) [❌]
Failure summary:
The action failed during OPAM dependency resolution due to incompatible OCaml compiler constraints:
- The environment pins
ocaml-base-compiler = 5.3.0(invariant), but dependencies require packagesthat only work with OCaml < 5.0.
- Dependency chain
deps-of-srql-translator → dream >= 1.0.0alpha5→ dream-httpaf >= 1.0.0alpha4 → h2 < 0.13.0 → ocaml < 5.0conflicts withocaml-base-compiler =5.3.0, leading OPAM to suggest incompatible compilers (dkml-base-compiler/ocaml-variants) instead.- Additional missing dependencies are gated by unavailable conditions:
ocaml-betarequiresenable-ocaml-beta-repository, andsystem-msvcrequiresos = "win32".- OPAM exited with code 20 due
to the unsatisfiable package set.
Relevant error logs: