[None][infra] add error hints to PR title check#15604
Conversation
Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
f778211 to
08fdeb5
Compare
📝 WalkthroughWalkthroughAdds a local Python PR title validator, wires it into the PR-check workflow, and adds unit tests for accepted and rejected title formats. ChangesPR title validation flow
Sequence Diagram(s)sequenceDiagram
participant check_pr_title_job as "check-pr-title job"
participant actions_checkout as "actions/checkout@v6"
participant actions_setup_python as "actions/setup-python@v6"
participant pr_title_check_py as "pr_title_check.py"
participant validate_pr_title as "validate_pr_title"
check_pr_title_job->>actions_checkout: checkout repository
check_pr_title_job->>actions_setup_python: install Python 3.10
check_pr_title_job->>pr_title_check_py: run with PR_TITLE
pr_title_check_py->>validate_pr_title: validate PR_TITLE
validate_pr_title-->>pr_title_check_py: errors or success
pr_title_check_py-->>check_pr_title_job: print result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
Comment |
|
/bot run --stage-list "A10-PyTorch-1, A10-PyTorch-2" |
|
Example error message: https://github.com/NVIDIA/TensorRT-LLM/actions/runs/28133389467/job/83314707712?pr=15604 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/unittest/scripts/test_pr_title_check.py (1)
28-71: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winCoverage is good for parser logic but insufficient for CLI path.
tests/unittest/scripts/test_pr_title_check.pyshould also testmain()(env input, stdout/stderr messages, and nonzero exit on invalid titles), since.github/workflows/pr-check.ymlruns the script entrypoint, not justvalidate_pr_title().As per path instructions, “Act as a QA engineer reviewing test changes and coverage for TensorRT-LLM. Keep feedback actionable … and whether coverage is sufficient, insufficient, or needs follow-up outside the PR.”
🤖 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 `@tests/unittest/scripts/test_pr_title_check.py` around lines 28 - 71, Coverage is insufficient because the tests only exercise validate_pr_title() and do not verify the script entrypoint used by the workflow. Add tests for main() in test_pr_title_check.py that cover reading the title from the expected environment input, writing the success/error messages to stdout/stderr, and returning a nonzero exit code for invalid titles. Use the existing mod fixture and validate_pr_title() behavior to drive main() assertions so the CLI path is covered end-to-end.Source: Path instructions
.github/workflows/pr-check.yml (1)
23-38: 🔒 Security & Privacy | 🟠 MajorScope the workflow token and disable persisted checkout credentials. Add explicit
permissions: contents: readand setpersist-credentials: falseon bothactions/checkoutsteps in.github/workflows/pr-check.yml.🤖 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/pr-check.yml around lines 23 - 38, The PR check workflow needs tighter security defaults. Update the workflow job that contains `check-pr-title` in `.github/workflows/pr-check.yml` to add explicit `permissions: contents: read`, and set `persist-credentials: false` on each `actions/checkout` step used in the workflow. Keep the change scoped to the existing checkout and title-validation setup so the job still runs the same checks with reduced token exposure.Source: Linters/SAST tools
🤖 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.
Outside diff comments:
In @.github/workflows/pr-check.yml:
- Around line 23-38: The PR check workflow needs tighter security defaults.
Update the workflow job that contains `check-pr-title` in
`.github/workflows/pr-check.yml` to add explicit `permissions: contents: read`,
and set `persist-credentials: false` on each `actions/checkout` step used in the
workflow. Keep the change scoped to the existing checkout and title-validation
setup so the job still runs the same checks with reduced token exposure.
In `@tests/unittest/scripts/test_pr_title_check.py`:
- Around line 28-71: Coverage is insufficient because the tests only exercise
validate_pr_title() and do not verify the script entrypoint used by the
workflow. Add tests for main() in test_pr_title_check.py that cover reading the
title from the expected environment input, writing the success/error messages to
stdout/stderr, and returning a nonzero exit code for invalid titles. Use the
existing mod fixture and validate_pr_title() behavior to drive main() assertions
so the CLI path is covered end-to-end.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3f378258-e18f-4917-abf2-fb474ad7dbc2
📒 Files selected for processing (3)
.github/scripts/pr_title_check.py.github/workflows/pr-check.ymltests/unittest/scripts/test_pr_title_check.py
|
PR_Github #55604 [ run ] triggered by Bot. Commit: |
|
PR_Github #55604 [ run ] completed with state |
Summary by CodeRabbit
Bug Fixes
Tests
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.