How jetbrains/bazel works
Project type and purpose
• This is an open-source integration/patch-management tool (“bazel-jetbrains-build”) that sits on top of the JetBrains build pipeline and leverages Bazel.
• It maintains a curated set of source-code patches (in the patches/ directory) and a GitHub Actions CI workflow (.github/workflows/on-push.yml) to apply those patches whenever the JetBrains code is fetched and built by Bazel.
File structure
• Top-level files:
• .editorconfig, .gitattributes – formatting and Git settings
• README.md, bazel-tag.txt – high-level documentation and versioning tag for Bazel
• Directories:
• patches/ – a sequence of numbered .patch files, each implementing a discrete change to JetBrains sources or the Bazel integration
• .github/workflows/ – CI configuration that runs on every push
• No “src” or “lib” folders for application code; the repository’s primary “function” is the management and application of patches via Bazel in CI.
README for additional insights
• The README title “bazel-jetbrains-build” signals the integration between Bazel and JetBrains build pipelines.
• No further sections are present, so we infer behavior from file names: HTTP download handlers, file watchers, credential logic, caching—these are patch areas, not internal modules of this repo.
a. Main components
• Developer Workstation
• GitHub Repository (this project)
• GitHub Actions CI Runner
• Bazel Build System
• JetBrains Source Code (external)
• Patch Application Engine (sequences the .patch files)
• Artifact Storage / Distribution (built IDE packages)
b. Relationships & interactions
1. Developer pushes code → GitHub Repo
2. GitHub Actions CI triggers on ‛push’ event
3. CI pulls JetBrains sources & Bazel tag (from bazel-tag.txt)
4. Patch Application Engine reads patches/0001…000n → applies to sources
5. CI invokes Bazel to build patched sources
6. Build artifacts are published (e.g., to GitHub Releases or internal store)
c. Architectural patterns and principles
• Single responsibility: each patch addresses one issue/feature in isolation
• Immutable builds: use explicit Bazel tag to fix source version
• CI as code: workflow defined in YAML under version control
d. Key technologies
• Git/GitHub for source hosting and patch versioning
• GitHub Actions for CI orchestration
• Bazel as the hermetic build system
• Standard UNIX patch or Git’s apply for patch steps