Reproducer improvements - #770
Conversation
lbarcziova
left a comment
There was a problem hiding this comment.
overall LGTM, just these from Claude might be relevant to check:
- 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.
- 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>
650eb60 to
27747a0
Compare
|
@lbarcziova fixed. |
No description provided.