You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "szehon-ho (via GitHub)" <gi...@apache.org> on 2026/08/26 01:15:31 UTC

[PR] [SPARK-59017][INFRA] Merge script skips or hangs at the Fix Version prompt when no version can be inferred [spark]

szehon-ho opened a new pull request, #58300:
URL: https://github.com/apache/spark/pull/58300

   ### What changes were proposed in this pull request?
   
   Two fixes in `dev/merge_spark_pr.py`, both on the path where Fix Version inference produces nothing:
   
   1. Blank input at the Fix Version prompt with no default now exits with a message instead of re-prompting forever.
   2. On an already-resolved JIRA, `already contains all inferred fix versions` is printed only when something was in fact inferred. Otherwise the committer reaches the prompt.
   
   ### Why are the changes needed?
   
   Take a backport PR opened directly against `branch-4.2`, merged at a moment when JIRA has no unreleased `4.2.x` version -- either the line is EOL, or `4.2.2` has not been created yet after `4.2.1` shipped. Inference finds nothing and warns the committer to enter a version manually. What follows is wrong in both directions.
   
   **The linked JIRA is already resolved by the earlier master merge**, which is the normal state for a backport. Before:
   
   ```
   JIRA issue SPARK-58880 already has status 'Resolved' (Fixed)
   Check if the JIRA information is as expected (y/N): y
   Target version for branch-4.2 is not found on JIRA, it may be archived or not created. Skipping it.
   JIRA issue SPARK-58880 already contains all inferred fix versions; no update needed.
   ```
   
   The ticket has `['5.0.0']` and nothing was inferred, so the last line is false and contradicts the warning above it. The prompt never appears, and the merge records no Fix Version. After:
   
   ```
   Target version for branch-4.2 is not found on JIRA, it may be archived or not created. Skipping it.
   JIRA issue SPARK-58880 has fix version(s) ['5.0.0']; no additional fix version could be inferred.
   Enter comma-separated additional fix version(s) []:
   No fix version entered; update SPARK-58880 manually.
   ```
   
   **The JIRA is not yet resolved.** The committer reaches the prompt with an empty default, and pressing Enter never escapes, because `""` can never match a known version -- even though the retry message offers exactly that. Before:
   
   ```
   Target version for branch-4.2 is not found on JIRA, it may be archived or not created. Skipping it.
   Enter comma-separated fix version(s) []:
   Specified version(s) [] not found in the available versions, try again (or leave blank and fix manually).
   Enter comma-separated fix version(s) []:
   Specified version(s) [] not found in the available versions, try again (or leave blank and fix manually).
   Enter comma-separated fix version(s) []:
   ^C
   ```
   
   Only Ctrl-C exits, and the merge to `branch-4.2` has already been pushed by then, since the JIRA step runs in a `finally` block. After:
   
   ```
   Target version for branch-4.2 is not found on JIRA, it may be archived or not created. Skipping it.
   Enter comma-separated fix version(s) []:
   No fix version entered; update SPARK-58880 manually.
   ```
   
   In both cases the committer still has to record the Fix Version by hand. The point of the change is that the script now says so, instead of claiming the ticket is already correct or trapping them in a loop.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Committer-facing only.
   
   ### How was this patch tested?
   
   New doctests on two extracted helpers, `fix_version_additions` and `fix_versions_from_input`, which cover both failure modes directly. `fix_versions_from_input("", "")` returns `[]` where the previous inline expression produced `[""]` and looped, and `fix_version_additions` separates "nothing inferred" from "all inferred already present", which the old code could not distinguish:
   
   ```
   master  :  "".replace(" ","").split(",")             -> ['']         never a known version -> loops
   patched :  fix_versions_from_input("", "")            -> []
   
   master  :  additional_fix_versions([], ["5.0.0"])     -> []          identical to the up-to-date case
   patched :  fix_version_additions([], ["5.0.0"])       -> ([], False)
   patched :  fix_version_additions(["5.0.0"], ["5.0.0"]) -> ([], True)
   ```
   
   Doctests go from 80 to 88, and they run on every invocation of the script since `__main__` calls `doctest.testmod()` before `main()`. I also drove `resolve_jira_issue` with a stubbed JIRA client to produce the transcripts above and to confirm that the cases where a version is inferable are unchanged, including the resolved-ticket path that proposes additions and asks for confirmation.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor (Claude Opus 5)


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59017][INFRA] Prevent merge script skipping or hanging at the Fix Version prompt when no version can be inferred [spark]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #58300:
URL: https://github.com/apache/spark/pull/58300#issuecomment-5430784469

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/a0ce466faaed64663efee442a108d4abb748a9ee
   
   *Posted by `merge_spark_pr.py`*


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59017][INFRA] Prevent merge script skipping or hanging at the Fix Version prompt when no version can be inferred [spark]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho closed pull request #58300: [SPARK-59017][INFRA] Prevent merge script skipping or hanging at the Fix Version prompt when no version can be inferred
URL: https://github.com/apache/spark/pull/58300


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59017][INFRA] Prevent merge script skipping or hanging at the Fix Version prompt when no version can be inferred [spark]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #58300:
URL: https://github.com/apache/spark/pull/58300#issuecomment-5430790912

   Changed title, thanks all!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59017][INFRA] Merge script skips or hangs at the Fix Version prompt when no version can be inferred [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58300:
URL: https://github.com/apache/spark/pull/58300#issuecomment-5428870787

   Thank you @szehon-ho and @zhengruifeng!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59017][INFRA] Merge script skips or hangs at the Fix Version prompt when no version can be inferred [spark]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #58300:
URL: https://github.com/apache/spark/pull/58300#issuecomment-5419233480

   cc @zhengruifeng -- this follows on from the discussion in #58165. Both of these sit on the empty-inference path, which that PR made newly reachable from the normal merge flow, so you have the most context on whether the prompt behaviour here matches what you want for your cases 2 and 3.
   
   One open question I left out deliberately: the resolution gate added in #58165 now allows only `Fixed`. SPARK also resolved 29 tickets as `Done` and 5 as `Implemented` over the last year, against 4686 as `Fixed`. Those are hand-set resolutions that still mean the work landed, and a backport merge on one is now skipped silently where it used to prompt. Happy to widen the allowlist in a separate PR if you think it is worth it, or leave `Fixed`-only as the conservative choice.
   
   cc @Yicong-Huang as you weighed in on the resolved-ticket handling there too.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org