tidb-bazel-prepare-gate

Determines whether make bazel_prepare is required before TiDB build or test commands.

40.5k|6.2k|Updated Sep 6, 2015
One-click install
npx skills add https://github.com/pingcap/tidb --skill tidb-bazel-prepare-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tidb-bazel-prepare-gate
Source: https://github.com/pingcap/tidb/tree/main/.agents/skills/tidb-bazel-prepare-gate
Command: npx skills add https://github.com/pingcap/tidb --skill tidb-bazel-prepare-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In the TiDB repository, running make bazel_prepare unnecessarily slows down the coding loop, but skipping it when required causes stale Bazel build files and confusing build or test failures. This Skill inspects local git changes and applies the decision rules from AGENTS.md to decide whether make bazel_prepare must run before build or test commands.

Core Features & Use Cases

  • Local Change Inspection: Runs git status, diff, and untracked-file commands from the repository root to gather evidence about modified files.
  • Rule-Based Decision: Compares changes against the trigger conditions defined in AGENTS.md, including new top-level test functions in *_test.go files and import-section changes in Go files.
  • Use Case: After adding func TestNewFeature(t *testing.T) to an existing test file, use this Skill to detect the added test function in the diff output and confirm that make bazel_prepare must run before bazel test.

Quick Start

Check my current uncommitted changes in the TiDB repository and tell me whether I need to run make bazel_prepare before building.

Frequently Asked Questions about tidb-bazel-prepare-gate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I know if I need to run make bazel_prepare in TiDB?

Run git status and git diff to inspect local changes, then compare them against the trigger conditions in AGENTS.md under Build Flow. New top-level test functions in existing *_test.go files and import-section changes in Go files require running make bazel_prepare.

When is make bazel_prepare required before bazel test?

It is required when local changes match the trigger rules in AGENTS.md, such as adding a function like func TestXxx(t *testing.T) to an existing test file or modifying import statements in Go files. If no rule matches, you can skip it.

Can I skip make bazel_prepare for normal code changes?

Yes, in normal coding loops you skip it unless a decision-rule trigger is present. The Skill inspects git diff output for added test functions and import changes, and only recommends running make bazel_prepare when a trigger condition matches.

Why does my TiDB Bazel build fail after adding a test function?

Adding a top-level test function to an existing *_test.go file changes what Bazel needs to generate, so stale build files cause failures. Run make bazel_prepare to regenerate the Bazel configuration before building or testing.

What git commands check for bazel_prepare triggers?

Use git status --short, git diff --name-status, git diff --name-status --cached, git ls-files --others --exclude-standard, and git diff -U0 for Go files. These reveal added test functions and import changes that trigger the requirement.