Skip to content

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

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

rok wants to merge 5 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.

What changes are included in this PR?

  • .github/boring-cyborg.yml: for a pull request to main, the Boring Cyborg app writes Closes #XXX to the GitHub Issue: line of the description, so GitHub closes the issue on merge. It leaves Refs #XXX on that line alone: that keeps the issue open for a partial fix. The "PR Title" status no longer accepts WIP: GH-XXX titles. It doesn't block the merge.
  • .github/workflows/dev_pr_merged.yml (new): does the rest of the issue update of the merge script. On a push to main with a GH-XXX: ... commit title, if GitHub closed the issue, it assigns the issue to the commit author if nobody is assigned and sets the next major release as the milestone if the issue has none.
  • dev/release/post-04-website.sh: "Patch Committers" is counted from who merged each pull request on GitHub. Button merges don't have the Signed-off-by: trailers it used.
  • Documentation: describes the merge button. The merge script still works and isn't changed.

Are these changes tested?

CI passes, but it doesn't run the new workflow: that can only run once this is on main. Locally, I ran the workflow step against apache/arrow with the writes printed instead of executed, checked the new patterns of the Boring Cyborg configuration against sample titles and descriptions, and compared the new committer count for 25.0.0..26.0.0 with the old one (395 merges, 390 from the trailers).

Are there any user-facing changes?

No.

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.

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 Outdated
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

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.

We could have post merge script push a message into the PR about bad title or even amend the commit?

Comment thread docs/source/developers/release.rst Resolved
Comment thread dev/release/post-10-bump-versions.sh Resolved
Comment thread .github/boring-cyborg.yml Resolved
Comment thread .github/workflows/dev_pr_merged.yml Outdated
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.

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.

Changed. There's still some gh use for the milestone, but title etc comes form the commit message now.

Address review comments:

* The "PR Title" status isn't a required status check of main. The
  Boring Cyborg app may be down when we need to merge.
* Direct pushes to main work again, so the changes of
  dev/release/post-10-bump-versions.sh and the "Bump versions" step
  of the release guide are reverted.
* The "Dev PR merged" workflow reads the issue and the pull request
  from the title of the pushed commit, "GH-XXX: ... (#YYY)", instead
  of asking GitHub for the pull request of the commit. The milestone
  of the pull request isn't used anymore.
* dev/release/post-04-website.sh asks GitHub who merged the pull
  requests for "Patch Committers". Commits merged with the merge
  button don't have "Signed-off-by:" trailers.
Copilot AI balanced review requested due to automatic review settings November 18, 2026 10:46

This comment was marked as low quality.

@rok

rok commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

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})

Yes, singed-off-by and authored-by will no longer be written. We could amend commits after merge, but I'd avoid that.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 11:19

This comment was marked as resolved.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 11:39

This comment was marked as low quality.

@rok
rok force-pushed the gh-55475-merge-button branch from 0d158a5 to fab6257 Compare November 18, 2026 11:47
Copilot AI balanced review requested due to automatic review settings November 18, 2026 11:47

This comment was marked as low quality.

# Count the pull requests of the commits in ${git_range} by who merged
# them. We ask GitHub because commits merged with the merge button
# don't have "Signed-off-by:" trailers.
list_committers() {

@rok rok Nov 18, 2026 •

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.

New committer count proposal @raulcd

@jorisvandenbossche

Copy link
Copy Markdown
Member

On the community meeting, it was mentioned that the top description is actually no longer up to date:

Boring Cyborg checks ... On PRs to main it fills the GitHub Issue: line with a native closing reference. For a partial fix, change that line to Refs and the issue number; the bot preserves it. Committers should check the issue line before merging, particularly for existing PRs. GitHub owns closure and records the resolving PR on the issue.

However, personally I think it is simpler to just rely on github's auto-closing of issues based on a "closes #.." (or equivalent). IMO it is simpler (for the maintainer, because that is in general how github works, and you don't have to know all details of our custom workflows) and avoids having additional custom workflow logic (it also allows the maintainer for whatever reason to not close the issue by merging the PR, or if we in the future want to use this practice more)

@jorisvandenbossche

Copy link
Copy Markdown
Member

And while we are touching the merge workflow, is there appetite in discussing what the commit message should be?
Currently, the docs in this PR say:

The pull request description is what you want as the commit
message. Remove leftovers of the pull request template in the
merge dialog if needed. You must remove CI directives such as
[skip ci]: GitHub doesn't run the workflow below for a commit
with them and you need to close the issue manually.

Would we be fine with just using the title (any co-authored-by lines as needed)?
Very often the PR description is very long (and often also not entirely up to date with the latest review round changes ... )

rok added 2 commits November 19, 2026 00:26
dev/release/post-04-website.sh published a partial count if one of
the GitHub requests failed. Also document that the script needs an
authenticated gh.
Address review comments: rely on GitHub closing the issue from a
closing keyword in the pull request description.

* The Boring Cyborg app writes "Closes #XXX" to the "GitHub Issue:"
  line of a pull request to main. It leaves "Refs #XXX" alone: that
  is for a partial fix, which keeps the issue open.
* The "Dev PR merged" workflow doesn't close the issue or comment on
  it anymore. It only assigns the issue and sets its milestone, and
  only if GitHub closed the issue. It doesn't need the "(#YYY)"
  suffix of the commit title anymore.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:00

This comment was marked as low quality.

@rok

rok commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

On the community meeting, it was mentioned that the top description is actually no longer up to date:

Boring Cyborg checks ... On PRs to main it fills the GitHub Issue: line with a native closing reference. For a partial fix, change that line to Refs and the issue number; the bot preserves it. Committers should check the issue line before merging, particularly for existing PRs. GitHub owns closure and records the resolving PR on the issue.

However, personally I think it is simpler to just rely on github's auto-closing of issues based on a "closes #.." (or equivalent). IMO it is simpler (for the maintainer, because that is in general how github works, and you don't have to know all details of our custom workflows) and avoids having additional custom workflow logic (it also allows the maintainer for whatever reason to not close the issue by merging the PR, or if we in the future want to use this practice more)

Changed to use "closes #" 5619a5b. I like it's the github way of doing thing, but not sure either way.

@rok

rok commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

And while we are touching the merge workflow, is there appetite in discussing what the commit message should be? Currently, the docs in this PR say:

The pull request description is what you want as the commit
message. Remove leftovers of the pull request template in the
merge dialog if needed. You must remove CI directives such as
[skip ci]: GitHub doesn't run the workflow below for a commit
with them and you need to close the issue manually.

Would we be fine with just using the title (any co-authored-by lines as needed)? Very often the PR description is very long (and often also not entirely up to date with the latest review round changes ... )

Why would we not store a long message and keep git as the canonical history record (even if sometimes wildly wrong). It's possible to reduce verbosity of git log and other history viewers...

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.

5 participants