chore: optimize AI code review configuration (Copilot & CodeRabbit)#938
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughEnables CodeRabbit knowledge-base guidance and path-scoped review rules in ChangesCode Review Workflow & Guidance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR aligns the repository’s AI-assisted review workflow and configuration so GitHub Copilot and CodeRabbit can be evaluated side-by-side using a shared standards baseline (without duplicating rulebooks).
Changes:
- Updates contributor-facing documentation (README/CONTRIBUTING/PR template) to describe the dual Copilot + CodeRabbit review workflow and CLA-safe handling of AI suggestions.
- Refactors
.github/copilot-instructions.mdto focus on agent-sandbox-specific context and “gotchas” (API groups, controller-runtime constraints, structured logging, docs site mounts, Python SDK conventions). - Adds a
.coderabbit.yamlconfiguration to ingest the shared knowledge base and apply path-specific review guidance while excluding generated/vendor content.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates the documented AI review workflow to include Copilot + CodeRabbit and interaction guidance. |
| CONTRIBUTING.md | Updates contribution rules to include CodeRabbit alongside Copilot and reiterates CLA-safe application of AI suggestions. |
| .github/pull_request_template.md | Updates PR template AI review bullets to mention both tools and the CLA constraint. |
| .github/copilot-instructions.md | Replaces generic reviewer persona text with project-specific context and conventions/gotchas. |
| .coderabbit.yaml | Adds CodeRabbit v2 config: shared knowledge base inputs, path filters, and path-scoped instructions. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/copilot-instructions.md:
- Line 1: The document starts with bold text ("**Project Context:**") instead of
a proper markdown top-level heading; replace or precede that line with a single
H1 heading (for example "# Copilot Review Instructions" or "# Code Review
Guidelines") so the file has a proper top-level heading and resolves the
markdown/linter warning, keeping the existing bold "Project Context:" content
below the new heading.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f49b13f1-bdd3-4327-a6c2-948bbf5d1e96
📒 Files selected for processing (5)
.coderabbit.yaml.github/copilot-instructions.md.github/pull_request_template.mdCONTRIBUTING.mdREADME.md
25e8d35 to
df49c76
Compare
df49c76 to
1bc9363
Compare
TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4
1bc9363 to
5fbb18d
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.coderabbit.yaml (1)
22-45: ⚡ Quick winConsider adding path instructions for
clients/go/SDK.The configuration includes detailed path instructions for the Python SDK (
clients/python/) but not for the hand-written Go SDK atclients/go/. According toAGENTS.md,clients/go/is also a hand-written, editable public SDK that wraps lifecycle operations and connectivity features.Adding path-scoped instructions for
clients/go/would ensure consistent review focus on SDK-specific concerns like API stability, idiomatic Go client patterns, and example correctness.📦 Proposed addition for Go SDK path instructions
- path: "clients/python/agentic-sandbox-client/**/*.py" instructions: | Review against Python 3.10+ idioms. Enforce Pydantic models for data structures. Ensure strict sync and async parity (every sync method must have an async sibling). Do not apply Go conventions here. + - path: "clients/go/**/*.go" + instructions: | + Focus on idiomatic Go client patterns, API stability, and clear examples. This is a hand-written public SDK wrapping SandboxClaim lifecycle and connectivity features. Ensure error handling is robust and the API surface remains backward-compatible. + - path: "docs/**/*.md" instructions: | Focus on technical accuracy, clarity, and markdown formatting. Verify that code snippets and configuration examples match current CRD definitions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.coderabbit.yaml around lines 22 - 45, The path_instructions block in .coderabbit.yaml lacks an entry for the hand-written Go SDK; add a new path_instructions entry targeting "clients/go/**" that mirrors the Python entry but for Go: emphasize idiomatic Go client patterns, API stability/semver guarantees, context propagation and concurrency safety, pointer vs value decisions, godoc comments and examples, backwards-compat checks, and CI/test coverage for the SDK; reference the existing path_instructions symbol and AGENTS.md as the rationale and ensure the new entry aligns with other SDK instructions for consistent review behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.coderabbit.yaml:
- Around line 22-45: The path_instructions block in .coderabbit.yaml lacks an
entry for the hand-written Go SDK; add a new path_instructions entry targeting
"clients/go/**" that mirrors the Python entry but for Go: emphasize idiomatic Go
client patterns, API stability/semver guarantees, context propagation and
concurrency safety, pointer vs value decisions, godoc comments and examples,
backwards-compat checks, and CI/test coverage for the SDK; reference the
existing path_instructions symbol and AGENTS.md as the rationale and ensure the
new entry aligns with other SDK instructions for consistent review behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 89a4e329-e51a-4b96-b72c-349c2b63d83b
📒 Files selected for processing (2)
.coderabbit.yaml.github/copilot-instructions.md
✅ Files skipped from review due to trivial changes (1)
- .github/copilot-instructions.md
…instructions TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4
…le-level architectural parity TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aditya-shantanu, janetkuo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
| - "AGENTS.md" | ||
|
|
||
| reviews: | ||
| request_changes_workflow: true |
There was a problem hiding this comment.
I tried this as I really didn't like it.
I guess it will approve the PRs if the changes are good from coderabbit side. I disabled it for jobset/kueue because I find the approval from coderabbit to be odd.
| - "!**/*_generated*.go" | ||
| - "!**/zz_generated.*.go" | ||
| - "!vendor/**" | ||
|
|
There was a problem hiding this comment.
One thing I added in mine was to forbid reviews if the PR has a label "needs-ok-to-test" or the PR is in draft stage.
auto_review:
enabled: true
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
drafts: false
base_branches:
- "main"
labels:
- "!needs-ok-to-test"
…ubernetes-sigs#938) * chore: optimize AI code review configuration (Copilot & CodeRabbit) TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4 * fix: correct Python SDK async parity description and add Go SDK path instructions TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4 * fix: refine Python SDK sync/async parity description to focus on module-level architectural parity TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4
…ubernetes-sigs#938) * chore: optimize AI code review configuration (Copilot & CodeRabbit) TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4 * fix: correct Python SDK async parity description and add Go SDK path instructions TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4 * fix: refine Python SDK sync/async parity description to focus on module-level architectural parity TAG=agy CONV=39249a7a-100d-4cfa-9e07-c8c02c8850d4
What this PR does / why we need it:
The Kubernetes organization recently enabled
coderabbitaifor AI-assisted code reviews in this repository. This PR establishes a unified configuration strategy to evaluate both GitHub Copilot and CodeRabbit side-by-side, ensuring both tools enforce identical project standards without duplicating markdown rulebooks.Specifically, this PR:
.github/copilot-instructions.md:Project Contextwith explicit API groups (agents.x-k8s.io/v1beta1,extensions...), CRD names, and Go module paths borrowed fromAGENTS.md.logr), error wrapping, Hugo docs site mounts, and Python SDK conventions..coderabbit.yaml:.github/copilot-instructions.mdandAGENTS.mdas the shared knowledge base.path_filtersto exclude generated code (zz_generated*.go,clients/k8s/**,k8s/crds/**).path_instructionstailored toagent-sandbox's repository layout (CRD API rules, controller-runtime constraints, and Python SDK parity).Which issue(s) this PR is related to:
NONE
Release Note
Summary by CodeRabbit
Chores
Documentation