raulcd commented on code in PR #55484:
URL: https://github.com/apache/arrow/pull/55484#discussion_r4611719787


##########
.asf.yaml:
##########
@@ -29,7 +29,16 @@ github:
 
   protected_branches:
     # protect main against force push
-    main: {}
+    main:
+      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

Review Comment:
   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.



##########
docs/source/developers/release.rst:
##########
@@ -621,12 +621,32 @@ Be sure to go through on the following checklist:
 
    .. code-block:: Bash
 
-      # You can run the script with BUMP_TAG=0 and BUMP_PUSH=0
-      # this will avoid default pushing to main and pushing the tag
-      # but you will require to push manually after reviewing the commits.
       # dev/release/post-10-bump-versions.sh 10.0.0 11.0.0
       dev/release/post-10-bump-versions.sh X.Y.Z NEXT_X.NEXT_Y.NEXT_Z
 
+   The script only creates the commits in your local ``main``. It
+   doesn't push them and doesn't create a tag because we can't push to
+   ``main`` directly: ``main`` requires the "PR Title" status check. You
+   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:

Review Comment:
   I'd prefer not to change this.



##########
dev/release/post-10-bump-versions.sh:
##########
@@ -33,8 +33,13 @@ fi
 : ${BUMP_VERSION_POST_TAG:=${BUMP_DEFAULT}}
 : ${BUMP_DEB_PACKAGE_NAMES:=${BUMP_DEFAULT}}
 : ${BUMP_LINUX_PACKAGES:=${BUMP_DEFAULT}}
-: ${BUMP_PUSH:=${BUMP_DEFAULT}}
-: ${BUMP_TAG:=${BUMP_DEFAULT}}
+# These are disabled by default because we can't push to the default
+# branch directly: it requires the "PR Title" status check. Create a
+# pull request from the commits and tag the merged commit instead.
+# See also the "Bump versions" step in
+# docs/source/developers/release.rst.
+: ${BUMP_PUSH:=0}
+: ${BUMP_TAG:=0}

Review Comment:
   I'd revert this.



##########
.github/boring-cyborg.yml:
##########
@@ -59,7 +59,10 @@ labelPRBasedOnFilePath:
     - "**/*.Rd"
 
 verifyTitles:
-  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.

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



##########
.github/workflows/dev_pr_merged.yml:
##########
@@ -0,0 +1,110 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Dev PR merged
+
+on:
+  push:
+    branches:
+      - main
+
+permissions:
+  contents: read
+  pull-requests: read
+  issues: write
+
+jobs:
+  resolve:
+    name: Resolve
+    if: github.repository == 'apache/arrow'
+    runs-on: ubuntu-latest
+    steps:
+      # A pushed commit that isn't the merge commit of a pull request
+      # is ignored.
+      - name: Resolve issue
+        env:
+          COMMIT: ${{ github.sha }}
+          GH_REPO: ${{ github.repository }}
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          set -euo pipefail
+
+          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

Review Comment:
   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.



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

Reply via email to