Skip to content

Fix modular duplicate detection to compare streams, not just boolean - #756

Open
fila43 wants to merge 2 commits into
packit:mainfrom
fila43:modular
Open

Fix modular duplicate detection to compare streams, not just boolean#756
fila43 wants to merge 2 commits into
packit:mainfrom
fila43:modular

Conversation

@fila43

@fila43 fila43 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stream-aware duplicate detection: _check_duplicate_tracker() previously used is_modular() which only returned a boolean (modular vs non-modular). This caused false duplicate matches between issues with different module streams (e.g. postgresql:16 vs postgresql:18). Replaced with parse_module_stream() which compares the full (module, stream) tuple.
  • Generalized modular summary regex: MODULAR_SUMMARY_PREFIX had a CVE-specific optional prefix (?:CVE-\d{4}-\d+\s+)? that would fail on summaries with multiple CVEs or non-CVE prefixes. Replaced with generic (?:\S+\s+)* that skips any tokens before the module:stream/ pattern.
  • Shared parse_module_stream() utility: Extracted stream-parsing logic into version_utils.py so both jira.py and triage_agent.py use the same function.

Supersedes the stream-comparison gap left by #743.

Test plan

  • Unit tests: 822 passed across all three test suites (privileged tools, common, agents) in containers
  • New tests for stream-aware dedup: same stream = dup, different stream = not dup, modular vs non-modular, mixed streams
  • New tests for parse_module_stream() including multi-CVE prefix
  • Manual dry-run against real modular ticket RHEL-241451 (postgresql:16/postgis) completed successfully

Made with Cursor

@fila43
fila43 force-pushed the modular branch 2 times, most recently from 1bc2edb to 14c71e7 Compare August 15, 2026 15:59
fila43 and others added 2 commits August 15, 2026 18:11
_check_duplicate_tracker() used is_modular() which only returned a
boolean, causing false duplicate matches between issues with different
module streams (e.g. postgresql:16 vs postgresql:18).

Extract parse_module_stream() into version_utils as a shared utility
and use it in both jira.py (duplicate detection) and triage_agent.py
(branch mapping), replacing the private _parse_module_summary wrapper.

Also generalises MODULAR_SUMMARY_PREFIX to skip arbitrary tokens before
the module:stream/ pattern instead of only optional CVE prefixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

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

I like this. Although couple more test cases for strings that should result in None return from parse_module_stream would be nice.

@jpodivin
jpodivin requested review from lbarcziova and nforro August 17, 2026 10:12
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