ワンクリックで
bazel-bridge
Import, test, and export upstream Gerrit CLs or GitHub PRs in the Bazel workspace.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Import, test, and export upstream Gerrit CLs or GitHub PRs in the Bazel workspace.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Runs pre-flight checks and deep code reviews on local commits of a feature branch before push or PR creation.
Post-merge cleanup protocol for Dart SDK Bazel thread task worktrees, beads issue closing, and remote sync.
MANDATORY skill when working on Bazel thread tasks (sdk-5m4.*, etc.), updating task status in beads, managing PR alignment lifecycle, or syncing the Dolt task DB.
Orchestrates long-running or recurring patrols of the Dart SDK Bazel test completion matrix. Discovers test targets, runs automated watchdog timers (default 5m/300s), bypasses blocking test suites or configs, regenerates canonical completion reports (TEST_COMPLETION_MATRIX.md), and synchronizes findings with the Beads issue backlog. Use when the user asks to run all Bazel tests, check test completion matrix health, audit migration test gaps, or leave overnight test patrols running.
| name | bazel_bridge |
| description | Import, test, and export upstream Gerrit CLs or GitHub PRs in the Bazel workspace. |
Use this skill to import, test, and export upstream changes (Gerrit CLs or GitHub PRs) using the Bazel developer bridge tools. This workflow allows developers and agents to test upstream patches in the hermetic Bazel build environment and export the validated non-Bazel core SDK changes back to an upstream-ready branch.
The bridge workflow uses two main Dart scripts located in the repository:
tools/bazel/bridge/import.dart: For importing and applying upstream changes to a new Bazel branch.tools/bazel/bridge/export.dart: For extracting, filtering, and exporting core SDK changes back to a clean branch.To import an upstream Gerrit CL or GitHub PR into the local Bazel workspace, run the import.dart script:
dart tools/bazel/bridge/import.dart <cl-number-or-pr-url> [options]
505900https://dart-review.googlesource.com/c/sdk/+/505900https://dart-review.googlesource.com/c/sdk/+/505900/1https://github.com/dart-lang/sdk/pull/123-b, --base <branch>: The base branch to branch off. Defaults to bazel-fork/main.-n, --name <name>: An explicit name for the created branch. If omitted, a default name like gerrit-<cl-number> or github-pr-<pr-number> is used.-p, --patchset <number>: A specific Gerrit patchset to import. If omitted, the script automatically queries the Gerrit API to find and use the latest patchset.--no-sync: Skip running gclient sync after importing. By default, the script will run gclient sync to align all dependencies.-v, --verbose: Enable verbose logging to see the underlying git commands.refs/changes/... for Gerrit or refs/pull/.../head for GitHub).bazel-fork/main).BUILD.gn or .gni files were modified, it warns you that you may need to run the translator (tools/bazel/translate_gn_desc.py) to update the Bazel build files.gclient sync to align the workspace.If the cherry-pick/apply step fails due to conflicts:
2, leaving you on the new feature branch in the middle of a cherry-pick.git add <file>git cherry-pick --continuegit cherry-pick --abortOnce the change is imported and any conflicts or build-file translation issues are resolved:
Verify the Build:
bazel build //runtime/bin:dartvm
bazel build //sdk:create_sdk
Run the Test Suite:
Use the standard test runner with the --bazel flag. Be sure to target the correct architecture (e.g., arm64 if on Apple Silicon, or x64 if on Intel/Linux):
python3 tools/test.py --bazel -n vm-release-arm64 <path-to-test>
Example:
python3 tools/test.py --bazel -n vm-release-arm64 corelib/list_test
Debug Failures: Fix any issues found in the core SDK or Bazel configuration. Feel free to make multiple commits on your feature branch as you work.
Once the changes are fully validated and ready to be submitted back to the upstream Core SDK, use the export.dart script to surgically extract and package the core changes, leaving all Bazel-specific files behind:
dart tools/bazel/bridge/export.dart [options]
git format-patch for all commits on the current branch since the base branch (default: bazel-fork/main), or for a single specific commit.tools/bazel/ (Bazel-specific tools and the bridge itself)*.bzl (Starlark rules)BUILD.bazel / BUILD (Bazel build files)WORKSPACE / WORKSPACE.bazel / MODULE.bazel (Workspace configs).bazelrc (Bazel configuration)
Any commits that only modified these files are automatically and silently dropped, ensuring the exported history is completely clean and contains only Core SDK modifications.origin/main). The branch is named export-<timestamp> or a custom name if specified.git am. This reconstructs the commit history, preserving the original author, date, and commit messages.--upload flag is provided, the script automatically runs git cl upload, allowing you to upload the clean CL directly to the Gerrit code review system.-b, --base <branch>: The Bazel base branch to compare the current branch against. Defaults to bazel-fork/main.-c, --commit <hash>: Export only a single specific commit instead of the entire branch history.--target-base <branch>: The Core SDK base branch to branch off of for the export. Defaults to origin/main.-n, --name <name>: Custom name for the newly created export branch.-u, --upload: Automatically run git cl upload after a successful export.-v, --verbose: Enable verbose logging to see the details of the patch generation and application.git am failures)If git am fails to apply the patch due to conflicts:
am session.git add <file>), and run git am --continue.git am --abort and switch back to your original development branch:
git checkout <your-dev-branch>