Bazel Monorepo and CI/CD Integration Training
Master monorepo architecture, CI/CD integration, migration strategies, and the Bazel developer tool ecosystem in 2 days.
Design and operate large-scale monorepos with Bazel's package visibility system, incremental testing, and CI/CD integration patterns used by Google, Stripe, Uber, Pinterest, and Dropbox. This 2-day training covers monorepo architecture, dependency management at scale, migration from Maven/Gradle/Make, CI pipeline design with remote caching, and the Bazel developer tool ecosystem.
Training Details
| Duration | 2 days (16 hours) |
| Level | Advanced |
| Delivery | In-person, Live online, Hybrid |
| Certification | N/A |
Who Is This For?
- Engineering leads designing monorepo architectures
- Build engineers integrating Bazel into CI/CD pipelines
- Migration engineers moving from Maven, Gradle, or Make to Bazel
- DevOps engineers optimizing build and test cycle times
- Platform engineers standardizing build tooling across an organization
Learning Outcomes
After completing this training, participants will be able to:
- Design monorepo package structures with visibility boundaries and dependency policies
- Integrate Bazel with GitHub Actions, Jenkins, and BuildKite CI systems
- Implement incremental testing using affected target detection with bazel query
- Execute migrations from Maven, Gradle, and Make build systems to Bazel
- Use Buildifier, Buildozer, and Gazelle for automated code maintenance
- Configure ibazel for rapid local development with file watching
Detailed Agenda
Day 1: Monorepo Architecture and Developer Tooling
Module 1: Monorepo Architecture Patterns
- Monorepo philosophy: Google (billions of lines), Stripe, Uber, Pinterest, Dropbox
- Repository structure: top-level packages, service boundaries, shared libraries
- Code ownership patterns: CODEOWNERS, BUILD file ownership, review policies
- Directory depth and package granularity: fine-grained vs coarse-grained targets
- Monorepo vs polyrepo trade-offs with Bazel
- Hands-on: Design a monorepo layout for a microservices architecture with shared libraries, API contracts, and internal tools
Module 2: Visibility and Package Design
- default_visibility at package level: public, private, package_group
- package_group: defining visibility domains across package hierarchies
- exports_files for exposing individual files from packages
- Layered visibility: public API packages, internal implementation packages
- Detecting and preventing unwanted cross-team dependencies
- Hands-on: Implement a layered visibility model with public API, internal implementation, and test-only packages across team boundaries
Module 3: Dependency Management at Scale
- Strict deps: --strict_java_deps, --incompatible_strict_action_env
- Unused deps detection: unused_deps aspect, buildozer-based cleanup
- Circular dependency prevention: package boundary design, interface packages
- Third-party dependency management: vendor/ directory patterns, version pinning
- Dependency convergence: ensuring consistent versions across the monorepo
- Hands-on: Audit a project for unused and undeclared dependencies, clean them up with Buildozer, enforce strict deps
Module 4: Developer Tool Ecosystem
- Buildifier: formatting and linting BUILD, WORKSPACE, and .bzl files
- Buildozer: programmatic BUILD file refactoring (add deps, remove targets, rename)
- Gazelle: automatic BUILD file generation for Go, Python, and extensible to other languages
- ibazel: incremental watcher for build-test-reload workflows (live reload for development)
- Unused deps: aspects and tools for detecting dead dependencies
- Hands-on: Format a repository with Buildifier, refactor BUILD files with Buildozer commands, generate BUILD files with Gazelle, set up ibazel for live development
Day 2: CI/CD Integration and Migration
Module 5: CI/CD Pipeline Design with Bazel
- GitHub Actions: bazelbuild/setup-bazel action, caching with actions/cache
- Jenkins: Bazel plugin, agent configuration, workspace management
- BuildKite: Bazel CI rules, pipeline configuration, parallelism
- .bazelrc profiles: build:ci for CI-specific flags (--remote_cache, --bes_backend, --config=remote)
- Artifact staging: bazel-bin outputs to deployment pipelines
- Hands-on: Build a GitHub Actions pipeline with remote caching, test result reporting, and artifact publishing
Module 6: Migration Strategies
- Maven to Bazel: rules_jvm_external, pom.xml analysis, migration-tooling
- Gradle to Bazel: Gradle-to-Bazel migration tools, build comparison testing
- Make to Bazel: genrule wrappers, incremental rule replacement
- Incremental migration: hybrid build period, build comparison validation
- Migration verification: ensuring build output equivalence between old and new systems
- Hands-on: Migrate a Maven-based Java project to Bazel: convert pom.xml dependencies to rules_jvm_external, create BUILD files, validate output equivalence
Module 7: Incremental Testing and Affected Targets
- Affected target detection: bazel query "rdeps(//..., set(changed_files))"
- Git integration: computing changed files between commits for targeted testing
- Test suite optimization: test_suite, manual tag for expensive tests
- Flaky test management: --flaky_test_attempts, flaky test quarantine patterns
- Test result caching: remote cache for test actions, --cache_test_results
- Hands-on: Implement an affected-targets script that computes changed files from Git, queries Bazel for impacted targets, and runs only affected tests
Module 8: Capstone — Production Monorepo Pipeline
- End-to-end CI/CD architecture: commit to deployment with Bazel
- Pre-submit pipeline: affected tests, Buildifier lint, visibility checks
- Post-submit pipeline: full test suite, artifact publishing, deployment triggers
- Developer experience: IDE integration, fast local iteration, remote cache hits
- Operational monitoring: build time trends, cache hit rates, flaky test tracking
- Hands-on: Capstone project — set up a complete monorepo with three services and shared libraries, implement GitHub Actions CI with remote caching, affected target testing, Buildifier enforcement, and deploy OCI images to a registry
Prerequisites
- Bazel Fundamentals training and at least one advanced Bazel training (or equivalent experience)
- Experience with CI/CD systems (GitHub Actions, Jenkins, or BuildKite)
- Familiarity with at least one build system being migrated from (Maven, Gradle, or Make)
- Understanding of Git workflows and branching strategies
Delivery Formats
| Format | Description |
|---|---|
| In-Person | On-site at your company's location, hands-on with direct interaction |
| Live Online | Interactive virtual sessions with screen sharing and real-time labs |
| Hybrid | Combination of on-site and remote sessions, flexible scheduling |
All formats include hands-on labs, course materials, and post-training support.
Prerequisites
- Bazel Fundamentals and at least one advanced Bazel training
- Experience with CI/CD systems (GitHub Actions, Jenkins, or BuildKite)
Ready to get started?
Request a training quote for your team — in-person, live-online, or hybrid.