Skip to content

Conversation

@JmPotato
Copy link
Member

@JmPotato JmPotato commented Jan 14, 2026

What problem does this PR solve?

Issue Number: ref #10206.

What is changed and how does it work?

Introduce `AGENTS.md`, a centralized playbook detailing repository-wide
guidelines for human and automated contributors. The document consolidates
best practices for build, test workflows, linting, code style, error handling,
concurrency, metrics, and security standards.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive PD Agent Guide covering scope and override behavior, a detailed playbook with quick facts, build/test commands and environments, linting/static analysis, test matrices, failpoints discipline, flags/env guidance, coding conventions, error handling, logging, concurrency, performance, security, telemetry, UI/dashboard notes, dependency/tool guidance, PR/commit standards, and a final contributor checklist.

✏️ Tip: You can customize this high-level summary in your review settings.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. labels Jan 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Adds AGENTS.md, a new PD Agent Guide documenting repository scope, build/test commands, coding standards, lint/test matrices, runtime flags/env, error/logging/concurrency practices, security/dependency guidance, contributor/PR checklist, and related operational guidance (159 lines added).

Changes

Cohort / File(s) Summary
Documentation & Agent Guide
AGENTS.md
New comprehensive PD Agent Guide covering scope, override behavior, build/test shortcuts, client module guidance, lint/static analysis, test matrices, failpoint rules, runtime flags/env, imports/formatting, code style, error handling, logging, concurrency, collections, API/docs, metrics/telemetry, performance, security, dependencies/tools, dashboard/UI notes, repository hygiene, PR/commit conventions, microservices guidance, external interactions, and a final contributor checklist.
Manifest Summary
(repo metadata)
Manifest reports +159 lines added (documentation-heavy change).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I hopped through pages, neat and bright,
Notes for builders, tests, and light,
Shortcuts pinned and rules in tow,
A tidy path for agents to grow. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: add comprehensive AGENTS.md' clearly and concisely summarizes the main change—adding a new documentation file with guidelines for contributors.
Description check ✅ Passed The PR description is mostly complete with an issue reference and commit message, but lacks checklist clarity regarding test applicability and has incomplete test selection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.59%. Comparing base (6dbd9cd) to head (dd1a0cc).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10147      +/-   ##
==========================================
+ Coverage   78.56%   78.59%   +0.03%     
==========================================
  Files         520      520              
  Lines       69676    69720      +44     
==========================================
+ Hits        54739    54797      +58     
+ Misses      10990    10973      -17     
- Partials     3947     3950       +3     
Flag Coverage Δ
unittests 78.59% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jan 14, 2026

@liyishuai: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Signed-off-by: JmPotato <github@ipotato.me>
Signed-off-by: JmPotato <github@ipotato.me>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@AGENTS.md`:
- Line 131: Update the documentation text in AGENTS.md that references GitHub so
the product name is capitalized correctly; locate the line containing "Follow
`.github/pull_request_template.md`; include `Issue Number: close|ref #...`
line." and change any instance of "github" or "GitHub" with incorrect casing to
"GitHub" to match the official capitalization.
🧹 Nitpick comments (2)
AGENTS.md (2)

91-91: Consider noting Go 1.22+ loop variable semantics.

While the guidance to avoid capturing loop variables by pointer is sound defensive practice, Go 1.22+ changed loop variable semantics to make each iteration have its own variable. Since the project targets Go 1.25, this advice serves as defense-in-depth but the specific footgun it addresses may be less common.


156-156: Clarify PD_EDITION usage.

The checklist mentions "Ensure PD_EDITION set correctly" but this is the only reference to this environment variable in the entire document. Consider adding context about what values are valid, when it's required, and what it controls.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f571fa7 and dd1a0cc.

📒 Files selected for processing (1)
  • AGENTS.md
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[uncategorized] ~5-~5: The official name of this software platform is spelled with a capital “H”.
Context: ....cursorrules. - Copilot rules: none in .github/copilot-instructions.md`. - Purpose: Gi...

(GITHUB)


[uncategorized] ~131-~131: The official name of this software platform is spelled with a capital “H”.
Context: ...ss required. ## PRs & Commits - Follow .github/pull_request_template.md; include `Iss...

(GITHUB)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: tso-function-test
  • GitHub Check: chunks (6, Tools Test)
  • GitHub Check: chunks (9, Microservice Integration(!TSO))
  • GitHub Check: chunks (4, Tests(1))
  • GitHub Check: chunks (8, TSO Integration Test)
  • GitHub Check: chunks (7, Client Integration Test)
  • GitHub Check: chunks (10, Microservice Integration(TSO))
  • GitHub Check: chunks (3, Unit Test(3))
  • GitHub Check: chunks (1, Unit Test(1))
  • GitHub Check: chunks (2, Unit Test(2))
  • GitHub Check: chunks (5, Tests(2))
  • GitHub Check: chunks
  • GitHub Check: statics
🔇 Additional comments (7)
AGENTS.md (7)

13-24: Comprehensive build guidance.

The build shortcuts section provides clear, actionable commands for various build scenarios. This is helpful for both human and automated contributors.


52-56: Important failpoints discipline guidance.

This section provides critical guidance on failpoint management, helping prevent common mistakes like committing generated files or leaving failpoints enabled. This is valuable for both humans and automated contributors.


80-82: Good security-conscious logging guidance.

The reminder to never log secrets or PII is an essential security practice that helps prevent accidental data leaks.


101-103: Valuable observability guidance.

The warning about high-cardinality labels is particularly important, as this is a common source of metrics database performance issues.


5-5: Fix capitalization: "GitHub" (minor documentation issue).

The official name is "GitHub" with a capital "H".

📝 Proposed fix
-- Copilot rules: none in `.github/copilot-instructions.md`.
+- Copilot rules: none in `.github/copilot-instructions.md`.

Likely an incorrect or invalid review comment.


38-38: The depguard configuration in .golangci.yml accurately reflects all documented package bans. The banned packages (github.com/pkg/errors, go.uber.org/atomic, math/rand) and the preference for math/rand/v2 are correctly specified in the configuration file.


116-116: No issues found. The version golangci-lint v2.6.0 is correctly pinned in the Makefile and accurately documented in AGENTS.md.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

- Avoid committing generated artifacts (junitfile, coverage, dashboard caches) unless required.

## PRs & Commits
- Follow `.github/pull_request_template.md`; include `Issue Number: close|ref #...` line.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix capitalization: "GitHub" (minor documentation issue).

The official name is "GitHub" with a capital "H".

📝 Proposed fix
-- Follow `.github/pull_request_template.md`; include `Iss...
+- Follow `.github/pull_request_template.md`; include `Iss...
🧰 Tools
🪛 LanguageTool

[uncategorized] ~131-~131: The official name of this software platform is spelled with a capital “H”.
Context: ...ss required. ## PRs & Commits - Follow .github/pull_request_template.md; include `Iss...

(GITHUB)

🤖 Prompt for AI Agents
In `@AGENTS.md` at line 131, Update the documentation text in AGENTS.md that
references GitHub so the product name is capitalized correctly; locate the line
containing "Follow `.github/pull_request_template.md`; include `Issue Number:
close|ref #...` line." and change any instance of "github" or "GitHub" with
incorrect casing to "GitHub" to match the official capitalization.

@JmPotato
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 16, 2026
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liyishuai, okJiang, rleungx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 16, 2026
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jan 16, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-01-16 05:00:26.37592921 +0000 UTC m=+124453.989886056: ☑️ agreed by okJiang.
  • 2026-01-16 05:47:23.816952963 +0000 UTC m=+127271.430909819: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot bot merged commit 896c3f5 into tikv:master Jan 16, 2026
33 of 36 checks passed
@JmPotato JmPotato deleted the add_AGENTS.md branch January 16, 2026 05:52
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jan 20, 2026
ref tikv#4399

Introduce `AGENTS.md`, a centralized playbook detailing repository-wide
guidelines for human and automated contributors. The document consolidates
best practices for build, test workflows, linting, code style, error handling,
concurrency, metrics, and security standards.

Signed-off-by: JmPotato <github@ipotato.me>
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jan 21, 2026
ref tikv#4399

Introduce `AGENTS.md`, a centralized playbook detailing repository-wide
guidelines for human and automated contributors. The document consolidates
best practices for build, test workflows, linting, code style, error handling,
concurrency, metrics, and security standards.

Signed-off-by: JmPotato <github@ipotato.me>
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jan 22, 2026
ref tikv#4399

Introduce `AGENTS.md`, a centralized playbook detailing repository-wide
guidelines for human and automated contributors. The document consolidates
best practices for build, test workflows, linting, code style, error handling,
concurrency, metrics, and security standards.

Signed-off-by: JmPotato <github@ipotato.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants