kou commented on code in PR #1301:
URL: https://github.com/apache/arrow-adbc/pull/1301#discussion_r1394869047


##########
.github/workflows/dev_pr/milestone.sh:
##########
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+# 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.
+
+# Assign a milestone to the given PR based on the open milestones and known
+# releases.
+
+set -euo pipefail
+
+main() {
+    local -r repo="${1}"
+    local -r pr_number="${2}"
+    echo "On ${repo} pull ${pr_number}"
+
+    local -r latest_version=$(git ls-remote --heads origin |
+                                  grep maint- |
+                                  sed -E 's/^.*maint-(.*)$/\1/' |
+                                  sort --version-sort |
+                                  tail -n1)
+    local -r milestone=$(gh api "/repos/${repo}/milestones" |
+                             jq -r '.[] | .title' |
+                             grep -E '^ADBC Libraries' |
+                             grep -v "${latest_version}" |
+                             head -n1)
+
+    echo "Latest tagged version: ${latest_version}"
+    echo "Assigning milestone: ${milestone}"
+
+    gh pr edit "${pr_number}" -m "${milestone}"

Review Comment:
   This may override already assigned milestone. Is it intentional?
   If it's not intentional, we may want to assign a milestone only when the PR 
isn't assigned to any milestone.



##########
.github/workflows/dev_pr/milestone.sh:
##########
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+# 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.
+
+# Assign a milestone to the given PR based on the open milestones and known
+# releases.
+
+set -euo pipefail
+
+main() {
+    local -r repo="${1}"
+    local -r pr_number="${2}"
+    echo "On ${repo} pull ${pr_number}"
+
+    local -r latest_version=$(git ls-remote --heads origin |
+                                  grep maint- |
+                                  sed -E 's/^.*maint-(.*)$/\1/' |

Review Comment:
   We may be able to simplify this:
   
   ```suggestion
                                     grep -o '[0-9.]*$' |
   ```



##########
.github/workflows/dev_pr.yml:
##########
@@ -38,6 +38,7 @@ jobs:
           persist-credentials: false
 
       - name: Check title for Conventional Commits format
+        continue-on-error: true

Review Comment:
   If we add this, this workflow may not report an error with unexpected 
title...



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