Skip to content

[None][infra] add error hints to PR title check#15604

Open
tburt-nv wants to merge 2 commits into
NVIDIA:mainfrom
tburt-nv:user/tburt/title_hints
Open

[None][infra] add error hints to PR title check#15604
tburt-nv wants to merge 2 commits into
NVIDIA:mainfrom
tburt-nv:user/tburt/title_hints

Conversation

@tburt-nv

@tburt-nv tburt-nv commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Added stricter pull request title validation to catch formatting issues earlier.
    • Improved error messages so invalid titles explain what needs to be corrected.
    • Updated automated checks to use the new validation flow in CI.
  • Tests

    • Added coverage for valid and invalid pull request title formats, including whitespace, ticket syntax, and summary rules.

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
@tburt-nv tburt-nv requested review from a team as code owners June 24, 2026 22:19
Signed-off-by: Tyler Burt <195370667+tburt-nv@users.noreply.github.com>
@tburt-nv tburt-nv force-pushed the user/tburt/title_hints branch from f778211 to 08fdeb5 Compare June 24, 2026 22:20
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a local Python PR title validator, wires it into the PR-check workflow, and adds unit tests for accepted and rejected title formats.

Changes

PR title validation flow

Layer / File(s) Summary
Format rules and diagnostics
.github/scripts/pr_title_check.py
Defines the title format constants, allowed ticket patterns, and ticket-segment diagnostic messages.
Title validator and CLI
.github/scripts/pr_title_check.py
Validates the PR title structure, formats validation output, and exits nonzero on failure.
Workflow wiring and tests
.github/workflows/pr-check.yml, tests/unittest/scripts/test_pr_title_check.py
Runs the script from the PR check job and adds unit tests for accepted and rejected title formats.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is still the placeholder template and lacks an actual issue/solution summary and test coverage details. Replace the template placeholders with a short description of the change and add concrete test coverage or validation steps.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is clearly related to the change, highlighting the PR title check improvements and added error hints.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@tburt-nv tburt-nv changed the title [None][infra] add error hints to PR title check [None][infra] add error hints to PR title check Jun 24, 2026
@tburt-nv tburt-nv changed the title [None][infra] add error hints to PR title check [None][infra] add error hints to PR title check Jun 24, 2026
@tburt-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "A10-PyTorch-1, A10-PyTorch-2"

@tburt-nv

Copy link
Copy Markdown
Collaborator Author

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Coverage is good for parser logic but insufficient for CLI path.

tests/unittest/scripts/test_pr_title_check.py should also test main() (env input, stdout/stderr messages, and nonzero exit on invalid titles), since .github/workflows/pr-check.yml runs the script entrypoint, not just validate_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 | 🟠 Major

Scope the workflow token and disable persisted checkout credentials. Add explicit permissions: contents: read and set persist-credentials: false on both actions/checkout steps 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1047091 and 08fdeb5.

📒 Files selected for processing (3)
  • .github/scripts/pr_title_check.py
  • .github/workflows/pr-check.yml
  • tests/unittest/scripts/test_pr_title_check.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55604 [ run ] triggered by Bot. Commit: 08fdeb5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55604 [ run ] completed with state SUCCESS. Commit: 08fdeb5
/LLM/main/L0_MergeRequest_PR pipeline #44521 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants