dongjoon-hyun commented on code in PR #60261:
URL: https://github.com/apache/spark/pull/60261#discussion_r4543870843
##########
dev/merge_spark_pr.py:
##########
@@ -1046,7 +1081,7 @@ def _do_cherry_pick(pr_num, merge_hash, pick_ref):
git.run("git fetch %s %s:%s" % (PUSH_REMOTE_NAME, pick_ref,
pick_branch_name))
git.run("git checkout %s" % pick_branch_name)
pick_head = git.run("git rev-parse HEAD").strip()
- skip_post_merge_ci = should_skip_post_merge_ci(pick_ref)
+ skip_post_merge_ci = should_skip_post_merge_ci(pick_ref,
force_post_merge_ci)
Review Comment:
**[8] Following up on @spark-test's
[P3](https://github.com/apache/spark/pull/60261#discussion_r4519768875): on the
cherry-pick path, the rerun hint can leave the JIRA with an extra fix
version.** This call runs after the merge into `master` has been pushed, so an
off-interval `branch-4.x` pick prints the same "add the %r label to the PR and
rerun this script" hint (L918-921). The checkout is safe there, as the P3 says,
but the JIRA update is not. Answering N at "Pick complete ... Push to apache?"
(L1125) calls `fail()`, and the `finally` in `main()` (L3429-3443) still asks
"Would you like to update an associated JIRA?" with `master` alone. If the
committer answers y, the ticket is resolved with `5.0.0`. The rerun is a
backport run, so `resolve_jira_issue` keeps `5.0.0` and adds `4.4.0` (L1786,
the doctest at L408-409), and the ticket ends with both instead of the `4.4.0`
alone that a one-run merge records. Could the hint on the cherry-pick path also
say to decline the JIRA update
before the rerun? If the P3's "answer N at the push prompt" wording goes into
this shared message, it would lead committers straight here.
##########
dev/merge_spark_pr.py:
##########
@@ -3203,6 +3247,7 @@ def main():
url = pr["url"]
title = pr["title"]
+ force_post_merge_ci = any(label["name"] == POST_MERGE_CI_FORCE_LABEL for
label in pr["labels"])
Review Comment:
**[10] Nit: the label match is case-sensitive.** GitHub looks label names up
case-insensitively: `GET /repos/apache/spark/labels/DO-NOT-SKIP-CI` returns
`do-not-skip-ci`. If the label is ever renamed in place, e.g. to
`Do-Not-Skip-CI`, every labeled PR shows the new name, this `==` becomes False,
and those PRs get `skip-checks: true` while committers expect post-merge CI.
Could this compare `label["name"].lower()`?
##########
dev/merge_spark_pr.py:
##########
@@ -3203,6 +3247,7 @@ def main():
url = pr["url"]
title = pr["title"]
+ force_post_merge_ci = any(label["name"] == POST_MERGE_CI_FORCE_LABEL for
label in pr["labels"])
Review Comment:
**[9] Minor: a label added during the run is ignored for the rest of it.**
`force_post_merge_ci` is read once here and passed down through `merge_pr`,
`cherry_pick` and `_do_cherry_pick`. If a committer sees the hint at the
`master` merge, keeps the skip there, and adds `do-not-skip-ci` so that the
`branch-4.x` pick runs post-merge CI, that pick still gets `skip-checks: true`.
Could `should_skip_post_merge_ci` read the PR's labels (`/issues/<pr>/labels`)
only when it is about to skip? `merge_pr` and `_do_cherry_pick` already have
`pr_num`, so this would also replace the argument that item 3 made required.
--
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]