Skip to content

Reproducer improvements - #770

Merged
TomasKorbar merged 2 commits into
packit:mainfrom
TomasKorbar:reproducer_improvements
Aug 20, 2026
Merged

Reproducer improvements#770
TomasKorbar merged 2 commits into
packit:mainfrom
TomasKorbar:reproducer_improvements

Conversation

@TomasKorbar

Copy link
Copy Markdown
Collaborator

No description provided.

@lbarcziova lbarcziova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

overall LGTM, just these from Claude might be relevant to check:

  1. Multi-CVE bracket format breaks MR matching (confirmed bug)

_build_mr_title emits [CVE-A, CVE-B] for multiple CVEs, but _REPRODUCER_MR_BRACKET_CVE = re.compile(r"[(CVE-\d{4}-\d+)]") only matches a single CVE inside brackets — findall returns [] on a multi-CVE
title. So _reproducer_mr_title_tags → _match_open_reproducer_mr silently fails for multi-CVE packages, and orchestration creates a duplicate MR instead of updating the existing one. No unit test covers the
roundtrip.


  1. Dead code in _resolve_reproducer_mr_target (confirmed)

reproducer_agent.py lines 351–354: the if result.adapted_existing and result.existing_mr_url: guard and the unconditional return below it produce the exact same tuple — fallback_branch is computed once and
nothing between the two statements mutates result.existing_mr_url. The conditional is unreachable dead code. The practical consequence is that when matched is None but the agent reported an
existing_mr_url, the caller gets matched_mr=None, so _build_mr_title can't accumulate existing JIRA tags into a regression MR title.

…ings

Previously, the reproducer agent matched existing MRs by searching for
CVE/issue mentions anywhere in the title and description, which caused
false matches and duplicate MRs when descriptions mentioned unrelated
CVEs. The reproducer lock for non-CVE bugs used per-issue keys, so
Z-stream clones of the same Y-stream issue could race on the same MR.

Title-based MR matching:
- Introduce canonical bracket tags in MR titles: `[CVE-…]` for security
  reproducers (stable across streams), `[RHEL-…]` for regression tests
  (accumulated when sibling streams adapt the same MR).
- Match MRs exclusively by parsing `[CVE-…]` / `[RHEL-…]` tags from
  titles; ignore description text entirely.
- Add `_match_regression_sibling_mr()` to find the sole open regression
  MR when the current issue is not yet in the title.
- Replace inline `_resolve_update_branch()` closure with module-level
  `_resolve_reproducer_mr_target()` that returns the matched MR metadata,
  enabling `_build_mr_title()` to merge Jira keys.

Clone-root lock for non-CVE bugs:
- Walk Jira Cloners issuelinks to find the root issue of a clone chain
  (e.g. RHEL-300 → RHEL-200 → RHEL-100). All clones serialize on the
  root issue's lock key instead of their own.
- Add `resolve_clone_root()` and `resolve_reproducer_lock_id()` to
  `reproducer_lock.py`; CVE jobs skip the walk entirely.
- Add `fetch_jira_issue_issuelinks()` to `jira.py` for minimal
  issuelinks-only API queries during lock resolution.
- Graceful fallback: if Jira is unreachable or the clone chain cannot be
  resolved, the lock degrades to per-issue (pre-existing behavior).

Branch preparation:
- `_prepare_reproducer_branch()` now fetches and checks out the existing
  MR source branch whenever `existing_mr_url` is set (not only when
  `adapted_existing` is already true), preventing force-push from
  dropping sibling commits.

Prompt and skill updates:
- Instruct the agent to append `link: - verifies:` entries to main.fmf
  when adapting existing tests for additional streams.
- Document cross-stream CVE workflow and bracket-tag MR title convention.

Tests:
- Add unit tests for clone-root resolution, clone-parent detection,
  Cloners link parsing, and fallback on Jira errors.
- Add unit tests for bracket-tag MR matching, title building with
  accumulated Jira keys, and regression sibling MR discovery.
- All 55 reproducer-related unit tests pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TomasKorbar
TomasKorbar force-pushed the reproducer_improvements branch from 650eb60 to 27747a0 Compare August 20, 2026 14:33
@TomasKorbar

Copy link
Copy Markdown
Collaborator Author

@lbarcziova fixed.

@lbarcziova lbarcziova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@TomasKorbar
TomasKorbar merged commit bb6cb30 into packit:main Aug 20, 2026
11 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.

2 participants