Skip to content

fix(review): resolve full ticket IDs despite shared numeric suffixes - #5167

Merged
IsmaelMartinez merged 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:fix/review-resolve-named-tickets-with-shared-numbers
Nov 26, 2026
Merged

IsmaelMartinez merged 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:fix/review-resolve-named-tickets-with-shared-numbers

Conversation

@PeterDaveHello

@PeterDaveHello PeterDaveHello commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

User description

Problem

Chunked /review results can refer to the same linked ticket by its full URL in one chunk and its tracker key in another. If two tickets share a numeric suffix (e.g. ABC-12 and XYZ-12), the existing ambiguity guard prevents resolving even these distinct full keys.

This splits compliance requirements across duplicate entries, can produce inconsistent compliance verdicts, and may leave ticket links pointing to bare identifiers. Linear URLs with title slugs also cannot reliably be resolved by comparing the identifier with the last URL segment.

Changes

  • Index explicit named ticket_id values separately from numeric references, allowing unique full keys to resolve case-insensitively to their canonical URLs.
  • Keep genuinely ambiguous keys unresolved, including identical keys from different trackers, while accepting repeated records for the same URL.
  • Preserve existing numeric ambiguity checks and full/abbreviated URL resolution behavior.

This extends #4139 and #4662 without changing ticket retrieval, prompts, configuration, or provider APIs.

Regression coverage

Added cases for shared numeric suffixes across Jira and Linear, mixed-case keys, named IDs resolving to slugged Linear URLs, ambiguous cross-tracker keys, repeated ticket records, and hash-prefixed numeric IDs.


PR Type

Bug fix, Tests


Description

  • Resolve full ticket keys despite shared numbers.

  • Support case-insensitive keys and slugged Linear URLs.

  • Preserve ambiguous keys and numeric collision safeguards.

  • Add regression coverage for ticket resolution.


Diagram Walkthrough

flowchart LR
  records["Related ticket records"]
  index["URL, full-key, and numeric indexes"]
  chunks["Chunk ticket references"]
  resolve["Resolve unambiguous canonical URLs"]
  merge["Merge compliance entries by ticket"]
  records --> index
  index --> resolve
  chunks --> resolve
  resolve --> merge
Loading

File Walkthrough

Relevant files
Bug fix
review_merge.py
Resolve named ticket keys independently of numeric suffixes

pr_agent/algo/review_merge.py

  • Index explicit named ticket_id values case-insensitively,
    independently of numeric suffixes.
  • Resolve unique full keys to canonical URLs, including slugged Linear
    URLs.
  • Leave keys associated with different URLs unresolved while accepting
    repeated identical records.
  • Update index consumers and defaults while preserving numeric and URL
    resolution safeguards.
+15/-11 
Tests
test_review_chunk_merge.py
Cover named ticket resolution and ambiguity safeguards     

tests/unittest/test_review_chunk_merge.py

  • Test merging full URLs and mixed-case keys sharing numeric suffixes
    across Jira and Linear.
  • Verify ambiguous cross-tracker keys remain unchanged and repeated
    records still resolve.
  • Extend numeric collision coverage to hash-prefixed ticket IDs.
+48/-2   


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 6,592 in / 358 out / 6,950 total
  • Time cost: 8.8s
  • AI calls: 1

Chunked reviews can report the same linked ticket by its URL or by
its tracker key. Numeric suffix collisions prevent distinct full keys
from resolving, leaving duplicate compliance entries with split
requirements and potentially unusable ticket links.

Index the supplied named IDs separately from numeric references,
resolving only unambiguous keys. This also handles IDs whose canonical
Linear URLs end in title slugs without weakening the existing URL
identity or numeric ambiguity checks.

Cover shared suffixes, cross-tracker key collisions, repeated ticket
records, and hash-prefixed numeric IDs.
Copilot AI balanced review requested due to automatic review settings November 26, 2026 16:56
@github-actions github-actions Bot added the bug label Nov 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the chunked ticket-resolution changes.

No open issues 🎉

What changed in this PR

This PR extends chunked /review ticket merging so distinct full tracker keys resolve to canonical URLs even when they share a numeric suffix, building on #4139 and #4662.

Changes:

  • Index named ticket IDs separately for case-insensitive resolution, including Linear URLs with title slugs.
  • Keep ambiguous keys unresolved while accepting repeated records for the same URL.
  • Add regression coverage for shared suffixes, mixed-case keys, cross-tracker ambiguity, and hash-prefixed numeric IDs.
File Description
tests/​unittest/​test_review_chunk_merge.py Adds full-key resolution and ambiguity regression cases.
pr_agent/​algo/​review_merge.py Adds a full-key index and uses it during canonical ticket URL resolution.

Review effort: Balanced

@the-pr-agent-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
⚠️ Risk level: Low
✅ Merge recommendation: No concerns found
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 14,459 in / 203 out / 14,662 total
  • Time cost: 7.4s
  • AI calls: 1

@the-pr-agent-bot

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 6,596 in / 131 out / 6,727 total
  • Time cost: 5.9s
  • AI calls: 1

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, full ticket keys now resolve correctly when numbers collide, and the ambiguous cases stay unresolved.

@IsmaelMartinez
IsmaelMartinez merged commit 8f673d3 into The-PR-Agent:main Nov 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants