Skip to content

[None][fix] Improve scope conflict handling in Selector class#16181

Merged
yufeiwu-nv merged 6 commits into
NVIDIA:mainfrom
yufeiwu-nv:cbts_null_diff
Jul 10, 2026
Merged

[None][fix] Improve scope conflict handling in Selector class#16181
yufeiwu-nv merged 6 commits into
NVIDIA:mainfrom
yufeiwu-nv:cbts_null_diff

Conversation

@yufeiwu-nv

@yufeiwu-nv yufeiwu-nv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Updated the logic in the Selector class to provide clearer reasons when scopes cannot be combined. The new implementation distinguishes between forced fallbacks and actionable scopes, enhancing the feedback provided during selection failures.

Signed-off-by: yufeiwu-nv 230315618+yufeiwu-nv@users.noreply.github.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved fallback messaging when multiple rules conflict, making it clearer whether a fallback was explicitly forced or whether the selected scopes could not be combined.
    • Error details now include the specific rules or scopes involved, helping users understand why a selection did not proceed as expected.

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.

@yufeiwu-nv yufeiwu-nv requested review from a team as code owners July 9, 2026 06:50
@yufeiwu-nv yufeiwu-nv requested review from dpitman-nvda and niukuo July 9, 2026 06:50
…#16170)

Updated the logic in the Selector class to provide clearer reasons when scopes cannot be combined. The new implementation distinguishes between forced fallbacks and actionable scopes, enhancing the feedback provided during selection failures.

Signed-off-by: yufeiwu-nv <230315618+yufeiwu-nv@users.noreply.github.com>
@yufeiwu-nv yufeiwu-nv changed the title [None][fix] Improve scope conflict handling in Selector class (#16170) [None][fix] Improve scope conflict handling in Selector class Jul 9, 2026
@yufeiwu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change refines the scope-combination fallback logic in Selector.run within jenkins/scripts/cbts/main.py. It now differentiates between a forced fallback triggered by rules with scope is None (listing forcing rule names) and an incompatible-scope conflict (listing distinct actionable scopes) in the reported reason string.

Changes

Selector Fallback Reason Refinement

Layer / File(s) Summary
Conditional fallback reason reporting
jenkins/scripts/cbts/main.py
Replaces the generic "Scopes cannot be combined" message with conditional reporting: lists forcing rule names when scope is None, otherwise lists distinct non-noop scopes that conflicted.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description omits the required Description, Test Coverage, and PR checklist completion sections. Add the Description and Test Coverage sections, then complete the PR checklist item with any relevant verification details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the main change: improved scope conflict handling in Selector.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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.

🧹 Nitpick comments (1)
jenkins/scripts/cbts/main.py (1)

192-200: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Good improvement to fallback diagnostics; one style nit.

The distinction between forced-fallback and genuine scope-conflict is a clear improvement. Static analysis flags the list concatenation on line 200 — worth adopting the more idiomatic unpacking form.

🎨 Style suggestion
-            return SelectionResult(scope=None, reasons=reasons + [summary])
+            return SelectionResult(scope=None, reasons=[*reasons, summary])
🤖 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 `@jenkins/scripts/cbts/main.py` around lines 192 - 200, Update the scope=None
branch in the selection logic to use the more idiomatic unpacking form instead
of concatenating the reasons list when building SelectionResult. In the block
that constructs summary and returns SelectionResult, replace the manual list
concatenation pattern with an unpacked reasons sequence while preserving the
forced-fallback vs scope-conflict behavior.

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.

Nitpick comments:
In `@jenkins/scripts/cbts/main.py`:
- Around line 192-200: Update the scope=None branch in the selection logic to
use the more idiomatic unpacking form instead of concatenating the reasons list
when building SelectionResult. In the block that constructs summary and returns
SelectionResult, replace the manual list concatenation pattern with an unpacked
reasons sequence while preserving the forced-fallback vs scope-conflict
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 77fe4f58-a6f4-4a93-a6c9-60043802dd73

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8ec05 and c97e021.

📒 Files selected for processing (1)
  • jenkins/scripts/cbts/main.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58406 [ run ] triggered by Bot. Commit: 159b541 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58406 [ run ] completed with state SUCCESS. Commit: 159b541
/LLM/main/L0_MergeRequest_PR pipeline #47027 completed with status: 'SUCCESS'

CI Report

Link to invocation

@yufeiwu-nv yufeiwu-nv enabled auto-merge (squash) July 9, 2026 07:46
@crazydemo

Copy link
Copy Markdown
Collaborator

/bot reuse-pipeline

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58654 [ reuse-pipeline ] triggered by Bot. Commit: ead0330 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58654 [ reuse-pipeline ] completed with state SUCCESS. Commit: ead0330
Reusing PR_Github #58406 for commit ead0330

Link to invocation

@yufeiwu-nv yufeiwu-nv merged commit 10d4ae7 into NVIDIA:main Jul 10, 2026
8 checks passed
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.

4 participants