sarutak opened a new pull request, #59708:
URL: https://github.com/apache/spark/pull/59708
### What changes were proposed in this pull request?
`dev/merge_spark_pr.py` extracts the JIRA ID(s) associated with a PR from
its title. Previously it scanned the entire title with
`re.findall("SPARK-[0-9]{4,5}", title)` in three places:
- `resolve_jira_issues` (resolves the ticket on merge),
- the revert path in `update_jira_for_pr` (reopens/reverts the ticket), and
- the Epic/Umbrella blocker and JIRA-match check in `main()`.
Because it matched anywhere in the title, a `SPARK-NNNNN` that appears in
the title *body* — e.g. a reference to a related ticket — was mistaken for the
ticket the PR resolves.
This PR adds `Title.jira_ids()` and a small `leading_jira_ids()` helper that
return only the `SPARK-NNNNN` ids appearing as *leading* bracket tags, reusing
the existing `Title.parse()` that already distinguishes leading tags from body
text, and switches the three call sites to use it.
### Why are the changes needed?
A PR title may legitimately mention another ticket in its body. For example
[#59587](https://github.com/apache/spark/pull/59587):
```
[SPARK-60328][SQL][TESTS] Use a unique jar copy in the HiveDDLSuite
SPARK-34261 test
```
The old code extracted `['SPARK-60328', 'SPARK-34261']`, so merging the PR
would also try to resolve the unrelated `SPARK-34261` and would prompt to
verify it as a linked ticket. Only the leading tag `SPARK-60328` is the ticket
this PR resolves.
### Does this PR introduce _any_ user-facing change?
No. This only affects the committer-side merge script; it is not part of any
released artifact.
### How was this patch tested?
- Added doctests for `Title.jira_ids()` and `leading_jira_ids()`, including
the body-reference case. All existing doctests continue to pass (`python3 -m
doctest dev/merge_spark_pr.py`).
- Verified against the title of #59587: the helper returns `['SPARK-60328']`
whereas the old `re.findall` returned `['SPARK-60328', 'SPARK-34261']`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Kiro CLI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]