CI: improve PR review plan comment format#338
Conversation
|
This advisory review plan was generated from changed file names using trusted base-branch code. DeePTB PR Review PlanRisk level: Medium Touched Risk Areas
Required Maintainer Focus
Suggested AI Review
Suggested Checks
Hold Conditions To Check
Notes
|
📝 WalkthroughWalkthroughThis PR extends the PR review plan script to support a GitHub-comment-friendly bilingual output format. It adds Chinese labels for risks and areas, introduces shared rendering helpers, implements a new GitHub-comment renderer with folded detail sections, and adds a ChangesGitHub-Comment Format and Bilingual Rendering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/maintenance/pr_review_plan.md (1)
36-41: 💤 Low valueConsider clarifying that the workflow needs to be updated to use the new format.
The documentation describes the GitHub comment format and its benefits (lines 29, 61), but the workflow code (Context snippet 3) still runs
python scripts/ci/pr_review_plan.py --stdinwithout the--format github-commentflag. While the PR objectives explicitly note this, readers of the documentation might assume the GitHub comment format is already live on PRs.Consider adding a note like:
The comment workflow currently uses the default CLI format. To adopt the GitHub comment format, the workflow should add `--format github-comment` to the script invocation.🤖 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 `@docs/maintenance/pr_review_plan.md` around lines 36 - 41, Update the comment workflow to invoke the new GitHub-comment format by modifying the job step that runs the script in `.github/workflows/pr_review_plan_comment.yml` (Context snippet 3): change the command that calls `python scripts/ci/pr_review_plan.py --stdin` to include the `--format github-comment` flag so it runs `python scripts/ci/pr_review_plan.py --stdin --format github-comment` (or equivalent ordering), ensuring the workflow emits the documented GitHub comment output format instead of the default CLI format.
🤖 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 `@docs/maintenance/pr_review_plan.md`:
- Around line 36-41: Update the comment workflow to invoke the new
GitHub-comment format by modifying the job step that runs the script in
`.github/workflows/pr_review_plan_comment.yml` (Context snippet 3): change the
command that calls `python scripts/ci/pr_review_plan.py --stdin` to include the
`--format github-comment` flag so it runs `python scripts/ci/pr_review_plan.py
--stdin --format github-comment` (or equivalent ordering), ensuring the workflow
emits the documented GitHub comment output format instead of the default CLI
format.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e358e814-f404-4568-854c-0bc73f23e58e
📒 Files selected for processing (2)
docs/maintenance/pr_review_plan.mdscripts/ci/pr_review_plan.py
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/unit_test.yml (1)
7-10: ⚡ Quick winReview
paths-ignorescope in.github/workflows/unit_test.ymlforscripts/ci/**
scripts/ci/currently contains onlyscripts/ci/check_repository_hygiene.pyandscripts/ci/pr_review_plan.py. However,scripts/ci/pr_review_plan.pyconstructsuv run pytest ./dptb/tests ...command strings (used to generate which test commands other workflows run), so PRs touching onlyscripts/ci/**will skipunit_test.ymldespite affecting test selection/execution behavior elsewhere. If this is intended, document the constraint (thatscripts/ci/**must not include test-execution logic) or narrow the ignore to the specific safe files.🤖 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 @.github/workflows/unit_test.yml around lines 7 - 10, The paths-ignore in unit_test.yml currently excludes 'scripts/ci/**', which hides changes to scripts/ci/pr_review_plan.py (and thus affects test selection/execution via generated "uv run pytest ..." command strings); update the paths-ignore scope to either (a) remove 'scripts/ci/**' so any change to scripts/ci/* triggers unit_test.yml, or (b) narrow the ignore to the safe file(s) only (e.g., 'scripts/ci/check_repository_hygiene.py') so edits to scripts/ci/pr_review_plan.py will not be skipped, and/or add documentation in unit_test.yml commenting the intended constraint; locate references to paths-ignore in unit_test.yml and adjust accordingly.
🤖 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 @.github/workflows/unit_test.yml:
- Around line 7-10: The paths-ignore in unit_test.yml currently excludes
'scripts/ci/**', which hides changes to scripts/ci/pr_review_plan.py (and thus
affects test selection/execution via generated "uv run pytest ..." command
strings); update the paths-ignore scope to either (a) remove 'scripts/ci/**' so
any change to scripts/ci/* triggers unit_test.yml, or (b) narrow the ignore to
the safe file(s) only (e.g., 'scripts/ci/check_repository_hygiene.py') so edits
to scripts/ci/pr_review_plan.py will not be skipped, and/or add documentation in
unit_test.yml commenting the intended constraint; locate references to
paths-ignore in unit_test.yml and adjust accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c20ae3b2-d82e-490a-bb01-4f866ec7aaf2
📒 Files selected for processing (1)
.github/workflows/unit_test.yml
Summary
--format github-commentoutput mode forscripts/ci/pr_review_plan.pyValidation
printf "docs/index.rst\n" | python3 scripts/ci/pr_review_plan.py --stdinprintf "docs/index.rst\n" | python3 scripts/ci/pr_review_plan.py --stdin --format github-commentprintf "dptb/utils/argcheck.py\n" | python3 scripts/ci/pr_review_plan.py --stdin --format github-commentpython3 scripts/ci/check_repository_hygiene.pyNote
This PR intentionally does not modify
.github/workflows/pr_review_plan_comment.yml. The workflow needs to call--format github-commentfor the new PR-page format to appear automatically.Summary by CodeRabbit
New Features
Documentation
Chores