Skip to content

GH-55475: [Dev] Use merge button instead of merge script - #55484

Open
rok wants to merge 2 commits into
apache:mainfrom
rok:gh-55475-merge-button
Open

rok wants to merge 2 commits into
apache:mainfrom
rok:gh-55475-merge-button

Conversation

@rok

@rok rok commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Committers need a personal access token and dev/merge_arrow_pr.py to merge a pull request. With this change they can use the "Squash and merge" button instead, like apache/arrow-rs does.

The merge script also checks the pull request title and updates the issue. A required status check does the first before the merge and a new workflow does the second after the merge.

What changes are included in this PR?

Before the merge:

After the merge:

  • .github/workflows/dev_pr_merged.yml (new): runs on pushes to main. If the pushed commit is the merge commit of a GH-XXX: ... pull request, it:

    • assigns the issue to the pull request author if nobody is assigned,
    • sets the milestone of the issue: the milestone of the pull request if it has one, otherwise the issue keeps its milestone, otherwise the next major release without a maintenance branch (the default of the merge script),
    • closes the issue and comments "Issue resolved by pull request XXX".

    It does nothing for MINOR: ... pull requests. It's a single gh step without a checkout, custom scripts or third-party actions. It uses the push event because the ASF GitHub Actions policy disables pull_request_target for ASF repositories.

Release:

  • dev/release/post-10-bump-versions.sh: the required check rejects direct pushes to main, so the script no longer pushes to main or creates the dev tag by default (BUMP_PUSH and BUMP_TAG default to 0). This is the only direct push to main in the release scripts, the workflows, the Crossbow tasks and Archery.
  • docs/source/developers/release.rst: the "Bump versions" step now says to create a MINOR: [Release] ... pull request from the commits of the script and to tag the merged commit by hand.

Documentation:

  • dev/README.md, docs/source/developers/overview.rst, docs/source/developers/continuous_integration/overview.rst: describe the merge button and the new workflow. The merge script is documented as still available.

Not changed: the merge script and the merge button settings (apache/arrow already allows only squash merges with the pull request title and description as the commit message).

Known limitations

  • Availability: merging to main depends on the Boring Cyborg app. If it stops reporting "PR Title", nothing can be merged, including a pull request that removes the requirement. .asf.yaml accepts the status from any source, but posting it by hand as a committer has not been tried.
  • Title check: the app only checks how the title starts, so a missing [Component] and a missing : pass. Nothing checks before the merge that the issue exists and is open: the workflow updates the issue that the title names, even if it's already closed.
  • Partial fixes: the issue is always closed on merge, so a pull request that covers only a part of an issue can't keep it open.
  • Milestone: if the pull request has no milestone, a closed milestone of the issue is kept, and no milestone is set if every open major milestone already has a maintenance branch. The workflow doesn't warn in either case.
  • Commit message: button merges don't have Authored-by:/Signed-off-by: trailers (GitHub adds Co-authored-by:). "Patch Committers" in the release announcement counts Signed-off-by: in dev/release/post-04-website.sh, so it needs a follow-up. The merge script removes HTML comments and CI directives from the description; with the button the committer has to do it in the merge dialog.
  • [skip ci]: GitHub doesn't run the new workflow for a merge commit with a CI directive in its message (4 of the last 2000 commits on main). The committer must remove the directive in the merge dialog or close the issue manually.
  • Merge script: it merges through the GitHub API, so it's bound by the required check too. The new workflow also runs for its merges. The script comments without looking at the existing comments, so the issue gets "Issue resolved by pull request XXX" twice if the workflow finishes before the committer answers the prompts of the script.
  • Release: the version bump is a pull request now, so the changelog and version commits are squashed into one commit. BUMP_PUSH=1 still fails at the push.

Are these changes tested?

Only locally:

  • a dry run of the workflow step against apache/arrow (real merged commits and faked issue states, with the writes printed instead of executed),
  • the new title pattern against sample titles.

The workflow and the required check can only run once this is on main. The manual release steps in the guide have not been tried.

Are there any user-facing changes?

No. For contributors, a WIP: GH-XXX title now gets a failing "PR Title" status until WIP: is removed.

Was AI used for this PR?

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@rok rok changed the title GH-55475: [Dev] Use merge button instead of merge script WIP: GH-55475: [Dev] Use merge button instead of merge script Nov 10, 2026
@rok rok changed the title WIP: GH-55475: [Dev] Use merge button instead of merge script WIP: GH-55475: [Dev] Merge pull requests with a comment instead of the merge script Nov 10, 2026
@rok rok changed the title WIP: GH-55475: [Dev] Merge pull requests with a comment instead of the merge script WIP: GH-55475: [Dev] Use merge button instead of merge script Nov 10, 2026
@rok
rok force-pushed the gh-55475-merge-button branch from 4b8ed1c to c34e788 Compare November 10, 2026 21:02
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55475 has been automatically assigned in GitHub to PR creator.

@rok
rok force-pushed the gh-55475-merge-button branch 5 times, most recently from a681b72 to 8af40b8 Compare November 10, 2026 22:43
@rok rok changed the title WIP: GH-55475: [Dev] Use merge button instead of merge script GH-55475: [Dev] Use merge button instead of merge script Nov 10, 2026
@rok
rok force-pushed the gh-55475-merge-button branch 2 times, most recently from 96ffdb2 to 3a6799e Compare November 10, 2026 23:14
@rok
rok marked this pull request as ready for review November 10, 2026 23:24
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:24

This comment was marked as outdated.

@rok
rok force-pushed the gh-55475-merge-button branch from 3a6799e to 65e2f5a Compare November 10, 2026 23:41
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:41

This comment was marked as resolved.

@rok
rok force-pushed the gh-55475-merge-button branch from 65e2f5a to 36ac2dd Compare November 11, 2026 09:17
Copilot AI balanced review requested due to automatic review settings November 11, 2026 09:17

This comment was marked as resolved.

@rok
rok force-pushed the gh-55475-merge-button branch from 256db9b to f1c623f Compare November 11, 2026 11:25
Copilot AI balanced review requested due to automatic review settings November 11, 2026 11:25

This comment was marked as low quality.

@rok
rok force-pushed the gh-55475-merge-button branch from f1c623f to 423b612 Compare November 11, 2026 11:49
Copilot AI balanced review requested due to automatic review settings November 11, 2026 11:49

This comment was marked as low quality.

@rok
rok force-pushed the gh-55475-merge-button branch from 423b612 to 227840b Compare November 11, 2026 12:15
Copilot AI balanced review requested due to automatic review settings November 11, 2026 12:15

This comment was marked as low quality.

@rok
rok force-pushed the gh-55475-merge-button branch from 227840b to 1725e0f Compare November 11, 2026 12:21
Copilot AI balanced review requested due to automatic review settings November 11, 2026 12:21

This comment was marked as low quality.

@rok
rok force-pushed the gh-55475-merge-button branch from 1725e0f to f37b26b Compare November 11, 2026 12:49
Copilot AI balanced review requested due to automatic review settings November 11, 2026 12:49

This comment was marked as low quality.

@rok

rok commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

@Reranko05 What do you think about this? (Note this is a stacked PR, the actual change is only f37b26b).

@Reranko05 Reranko05 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I haven't looked too deeply into the logic, but I left a couple of minor documentation suggestions. Nothing major!

(Although this doesn't apply to me just yet, hopefully it will someday 😅)

Comment thread dev/README.md Resolved
Comment thread docs/source/developers/overview.rst Resolved
Copilot AI balanced review requested due to automatic review settings November 15, 2026 16:56

This comment was marked as low quality.

@rok
rok requested a review from Reranko05 November 15, 2026 17:03

@Reranko05 Reranko05 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! I looked through the workflow changes, and nothing stands out to me :)

Document the "Squash and merge" button as the way to merge pull
requests. The merge script is still available.

Before the merge, the "PR Title" status of the Boring Cyborg app is a
required status check on main: the pull request title must start with
"GH-XXX" or "MINOR: ".

The required check rejects direct pushes to main, so the release
guide tells release managers to bump versions with a pull request.

After the merge, a workflow for pushes to main assigns the issue to
the pull request author if it isn't assigned, sets its milestone,
closes it and comments which pull request resolved it.
@rok
rok force-pushed the gh-55475-merge-button branch from 34ba758 to 7c60120 Compare November 18, 2026 09:00
Copilot AI balanced review requested due to automatic review settings November 18, 2026 09:00

This comment was marked as low quality.

The "PR Title" check no longer accepts "WIP: GH-XXX" titles. They
passed the required check but the "Dev PR merged" workflow ignored
them, so the issue stayed open after the merge.

dev/release/post-10-bump-versions.sh no longer pushes to main or
creates the dev tag by default because the push is rejected by the
required check.
Copilot AI balanced review requested due to automatic review settings November 18, 2026 09:12

This comment was marked as low quality.

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

We will stop having the signed-off-by trailer on the git commit messages. This will stop working right?

committers_command_line="git shortlog -sn --group=trailer:signed-off-by ${git_range}"
contributors_command_line="git shortlog -sn ${git_range}"
committers=$(${committers_command_line})
contributors=$(${contributors_command_line})

Comment thread .asf.yaml
Comment on lines +33 to +41
required_status_checks:
# Don't require branches to be up to date before merging.
strict: false
# The title check ("verifyTitles") of the Boring Cyborg app
# in .github/boring-cyborg.yml. The merge button is disabled
# while the pull request title doesn't start with "GH-XXX"
# or "MINOR: ".
contexts:
- PR Title

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.

I think this is too restrictive and eventually there will be a time where this fails (cyborg-app is down) we have to push an expedited thing... I am sure we can't foresee it now but will happen and I'd rather not have this as a required status check. Removing this allows us to remove the changes on release bump scripts etcetera.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree boring-cyborg glitching occasionally is likely and not having this button will be annoying.
However gating the merge button here guarantees bad titles don't get merged. How problematic are bad titles for us? Should we have somesort of post merge change?

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.

I expect committers to do a quick check same as linter CI etc. I don't think is worst than linting failing or breaking other CI jobs tbh

need to push the commits to a branch, create a pull request from the
branch with a
``MINOR: [Release] Update versions for NEXT_X.NEXT_Y.NEXT_Z-SNAPSHOT``
title and merge it:

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.

I'd prefer not to change this.

Comment on lines +41 to +42
: ${BUMP_PUSH:=0}
: ${BUMP_TAG:=0}

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.

I'd revert this.

Comment thread .github/boring-cyborg.yml
titleRegexp: '^(WIP:?\s*)?GH-[0-9]+|^MINOR: '
# "PR Title" is a required status check of main in .asf.yaml. A
# "WIP: GH-XXX: ..." title must not pass: it blocks the merge until
# "WIP: " is removed.

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.

Comments are not really necessary, if we don't allow WIP :)

Comment on lines +46 to +57
pull_request=$(
gh api "repos/${GH_REPO}/commits/${COMMIT}/pulls" \
--jq "map(select(.merge_commit_sha == \"${COMMIT}\"))[0] // empty")
if [ -z "${pull_request}" ]; then
echo "${COMMIT} isn't the merge commit of a pull request."
exit 0
fi
title=$(jq -r .title <<< "${pull_request}")
if [[ ! "${title}" =~ ^GH-([0-9]+) ]]; then
echo "No GitHub issue in the title: ${title}"
exit 0
fi

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.

we can extract it from the commit message instead of playing with the PR, feels more natural and we avoid http requests to GH API here.

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