Skip to content

[CELEBORN-2437][INFRA] Fix JIRA fix version suggestion in merge_pr.py - #3818

Open
pan3793 wants to merge 2 commits into
apache:mainfrom
pan3793:CELEBORN-2437
Open

[CELEBORN-2437][INFRA] Fix JIRA fix version suggestion in merge_pr.py#3818
pan3793 wants to merge 2 commits into
apache:mainfrom
pan3793:CELEBORN-2437

Conversation

@pan3793

@pan3793 pan3793 commented Aug 20, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

When resolving a JIRA after merging a PR, the suggested fix version for main was the first unreleased version returned by the JIRA API, which is ordered by creation time rather than version number. As a result, main could suggest an old unreleased version (e.g. 0.3.3) instead of the next main release (e.g. 1.0.0).

This PR follows the version inference approach of SPARK-56865 in dev/merge_spark_pr.py: suggested fix versions are picked by semantic version, with main contributing the greatest unreleased N.0.0 and branch-M.N contributing the greatest unreleased M.N.x. It also requires JIRA version names to be exactly x.y.z, excluding malformed entries such as the current 0.5.2, 0.4.3, 0.6.0.

Why are the changes needed?

The default suggestion was wrong for PRs merged to main, requiring committers to correct it manually.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

python3 -m py_compile dev/merge_pr.py, plus manual checks of compute_default_fix_versions against the current unreleased CELEBORN versions: main + branch-0.7 now suggests 1.0.0,0.7.1 instead of 0.3.3,0.7.1.

Assisted-by: deepseek-v4-pro

Suggested fix versions for main used the first version returned by the JIRA API, which is ordered by creation time, so it could suggest an old unreleased version (e.g. 0.3.3) instead of the next main release (e.g. 1.0.0). Sort unreleased versions by semantic version: main maps to the greatest unreleased N.0.0, and branch-M.N maps to the greatest unreleased M.N.x version. Version names are now required to be exactly x.y.z to exclude non-semver entries.

Assisted-by: deepseek-v4-pro
@pan3793

pan3793 commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

cc @SteNicholas @zaynt4606

@SteNicholas SteNicholas 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.

LGTM.

@SteNicholas
SteNicholas requested a lite review from Copilot August 20, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR fixes how dev/merge_pr.py suggests default JIRA fix versions after a PR merge by selecting versions based on semantic version ordering (instead of JIRA API creation order), and by requiring strictly-formed x.y.z version names.

Changes:

  • Add semantic-version max helper and a dedicated compute_default_fix_versions(...) function.
  • Filter unreleased JIRA versions using re.fullmatch to exclude malformed version names.
  • Replace inline fix-version selection logic in resolve_jira_issue with the new helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dev/merge_pr.py
Comment on lines +274 to +275
chosen = _semver_max_version(
[n for n in unreleased_version_names if n.startswith(prefix)]
Comment thread dev/merge_pr.py
def _semver_max_version(names):
if not names:
return None
parsed = [(tuple(int(p) for p in n.split(".")), n) for n in names]
Match branch-M.N fix versions with a dot boundary so 0.70.1 is not considered for branch-0.7, and skip malformed version names in _semver_max_version instead of raising ValueError.

Assisted-by: deepseek-v4-pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants