You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "raulcd (via GitHub)" <gi...@apache.org> on 2023/02/13 14:37:25 UTC

[GitHub] [arrow] raulcd opened a new pull request, #34161: GH-33977: [Dev] PR Workflow automation bot

raulcd opened a new pull request, #34161:
URL: https://github.com/apache/arrow/pull/34161

   ### Rationale for this change
   
   As discussed on the [mailing list](https://lists.apache.org/thread/1rhsd8ovy4bfr8hcdohn0vh65frw0ggk) is quite difficult to understand the current state of a PR whether it requires further review, it has gone stale or new changes have been added. This allows us to have a set of labels based on the state of the PR.
   
   
   ```mermaid
   flowchart TD
       A([New PR]):::creator
       A -- by non-committer --> B[Awaiting review]:::anyone
       A -- by committer --> C[Awaiting commiter review]:::committer
       B & C -- new review by\nanother non-committer --> C
       C & B & E  -- new committer review\nrequests changes --> D[Awaiting changes]:::creator
       D -- changes by creator --> E[Awaiting change review]:::committer
       C & E & B -- new committer review\napproves ---> F[Awaiting merge]:::committer
   classDef creator stroke:#CC0;
   classDef anyone stroke:#00C;
   classDef committer stroke:#0C0;
   classDef triager stroke:#C0C;
   linkStyle 0,1,7 stroke:#CC0,color:auto;
   linkStyle 2,3 stroke:#00C,color:auto;
   linkStyle 4,5,6,8,9,10 stroke:#0C0,color:auto;
   ```
   ### What changes are included in this PR?
   
   New workflow to trigger archery bot on the required actions. New PR Workflow bot implementation on archery that manages the GitHub events and state.
   New fixtures and tests.
   
   ### Are these changes tested?
   
   There are unit tests and has been tested on my fork. Some transition examples on this PR:
   https://github.com/raulcd/arrow/pull/74
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34161:
URL: https://github.com/apache/arrow/pull/34161#issuecomment-1428048946

   * Closes: #33977


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1116247266


##########
dev/archery/archery/bot.py:
##########
@@ -82,6 +87,121 @@ def parse_args(self, ctx, args):
 group = partial(click.group, cls=Group)
 
 
+LABEL_PREFIX = "awaiting"
+
+
+@enum.unique
+class PullRequestState(enum.Enum):
+    """State of a pull request."""
+
+    review = f"{LABEL_PREFIX} review"
+    committer_review = f"{LABEL_PREFIX} committer review"
+    changes = f"{LABEL_PREFIX} changes"
+    change_review = f"{LABEL_PREFIX} change review"
+    merge = f"{LABEL_PREFIX} merge"
+
+
+COMMITTER_ROLES = {'OWNER', 'MEMBER'}
+
+
+class PullRequestWorkflowBot:
+
+    def __init__(self, event_name, event_payload, token=None):
+        self.github = github.Github(token)
+        self.event_name = event_name
+        self.event_payload = event_payload
+
+    @cached_property
+    def pull(self):
+        """
+        Returns a github.PullRequest object associated with the event.
+        """
+        return self.repo.get_pull(self.event_payload['pull_request']['number'])
+
+    @cached_property
+    def repo(self):
+        return self.github.get_repo(self.event_payload['repository']['id'], lazy=True)
+
+    def handle(self):
+        current_state = None
+        try:
+            current_state = self.get_current_state()
+        except EventError:
+            # In case of error (more than one state) we clear state labels
+            # only possible if a label has been manually added.
+            self.clear_current_state()
+        new_state = self.get_target_state(current_state)
+        if current_state != new_state.value:
+            if current_state:
+                self.clear_current_state()
+            self.set_state(new_state)
+
+    def get_current_state(self):
+        """
+        Returns a string with the current PR state label
+        based on label starting with LABEL_PREFIX.
+        If more than one label is found raises EventError.
+        If no label is found returns None.
+        """
+        states = [label.name for label in self.pull.get_labels()
+                  if label.name.startswith(LABEL_PREFIX)]
+        if len(states) > 1:
+            raise EventError(f"PR cannot be on more than one states - {states}")
+        elif states:
+            return states[0]
+
+    def clear_current_state(self):
+        """
+        Removes all existing labels starting with LABEL_PREFIX
+        """
+        for label in self.pull.get_labels():
+            if label.name.startswith(LABEL_PREFIX):
+                self.pull.remove_from_labels(label)
+
+    def get_target_state(self, current_state):

Review Comment:
   Sorry for my ambiguous suggestion. I wanted to suggest `s/get_target_state/transit_state/g` or `s/get_target_state/compute_next_state/g`.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] assignUser commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1106026583


##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    permissions:
+      contents: read
+      pull-requests: write
+      issues: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow

Review Comment:
   and add ` persist-credentials: false` or we could install archery via git? unless you require some auxiliary files outside of archery.



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    permissions:
+      contents: read
+      pull-requests: write
+      issues: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow

Review Comment:
   Please specify ref and repository here to make sure the default branch is checked out and not the PR state as otherwise we would run untrusted code by the PR creator.  As we cannot test changes of this workflow in PRs it does not make a difference for that (pr target triggered workflows have to be on the default branch to run).



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1115080264


##########
.github/workflows/pr_review_trigger.yml:
##########
@@ -0,0 +1,32 @@
+# 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: "Label when reviewed"
+on: pull_request_review
+
+jobs:
+  # due to GitHub actions permissions we can't change labels on the pull_request_review

Review Comment:
   ```suggestion
     # due to GitHub Actions permissions we can't change labels on the pull_request_review
   ```



##########
dev/archery/archery/bot.py:
##########
@@ -82,6 +87,121 @@ def parse_args(self, ctx, args):
 group = partial(click.group, cls=Group)
 
 
+LABEL_PREFIX = "awaiting"
+
+
+@enum.unique
+class PullRequestState(enum.Enum):
+    """State of a pull request."""
+
+    review = f"{LABEL_PREFIX} review"
+    committer_review = f"{LABEL_PREFIX} committer review"
+    changes = f"{LABEL_PREFIX} changes"
+    change_review = f"{LABEL_PREFIX} change review"
+    merge = f"{LABEL_PREFIX} merge"
+
+
+COMMITTER_ROLES = {'OWNER', 'MEMBER'}
+
+
+class PullRequestWorkflowBot:
+
+    def __init__(self, event_name, event_payload, token=None):
+        self.github = github.Github(token)
+        self.event_name = event_name
+        self.event_payload = event_payload
+
+    @cached_property
+    def pull(self):
+        """
+        Returns a github.PullRequest object associated with the event.
+        """
+        return self.repo.get_pull(self.event_payload['pull_request']['number'])
+
+    @cached_property
+    def repo(self):
+        return self.github.get_repo(self.event_payload['repository']['id'], lazy=True)
+
+    def handle(self):
+        current_state = None
+        try:
+            current_state = self.get_current_state()
+        except EventError:
+            # In case of error (more than one state) we clear state labels
+            # only possible if a label has been manually added.
+            self.clear_current_state()
+        new_state = self.get_target_state(current_state)
+        if current_state != new_state.value:
+            if current_state:
+                self.clear_current_state()
+            self.set_state(new_state)
+
+    def get_current_state(self):
+        """
+        Returns a string with the current PR state label

Review Comment:
   How about returning `PullRequestState` instead of string?
   If we return `PullRequestState` here, we can consider all `state`s are `PullRequestState` instead of `PullRequestState` or string.



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,97 @@
+# 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: "Workflow label bot"
+on:
+  pull_request_target:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+      - synchronize
+  workflow_run:
+    workflows: ["Label when reviewed"]
+    types: ['completed']
+
+permissions:
+  contents: read
+  pull-requests: write
+  issues: write
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          repository: apache/arrow
+          ref: main
+          persist-credentials: false
+          # fetch the tags for version number generation
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8
+      - name: Install Archery and Crossbow dependencies
+        run: pip install -e arrow/dev/archery[bot]
+      - name: 'Download PR review payload'
+        id: 'download'
+        if: github.event_name == 'workflow_run'
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const run_id = "${{ github.event.workflow_run.id }}";
+            let artifacts = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: run_id,
+            });
+            let pr_review_artifact = artifacts.data.artifacts.filter((artifact) => {
+              return artifact.name == "pr_review_payload"
+            })[0];
+            let pr_review_download = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: pr_review_artifact.id,
+              archive_format: 'zip',
+            });
+            var fs = require('fs');
+            fs.writeFileSync('${{github.workspace}}/pr_review.zip', Buffer.from(pr_review_download.data));
+      - name: Extract artifact
+        id: extract
+        if: github.event_name == 'workflow_run'
+        run: |
+          unzip pr_review.zip
+          echo "pr_review_path=$(pwd)/event.json" >> $GITHUB_OUTPUT
+      - name: Handle PR workflow event
+        env:
+          ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          if ${{ github.event_name == 'workflow_run' }}; then

Review Comment:
   How about using normal shell condition instead of GitHub Actions expression? `if true; then`/`if false; then` work as expected but it's not straightforward. They work because there are `/usr/bin/true` and `/usr/bin/false`.
   
   ```suggestion
             if [ "${GITHUB_EVENT_NAME}" = "workflow_run" ]; then
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34161:
URL: https://github.com/apache/arrow/pull/34161#issuecomment-1428049043

   :warning: GitHub issue #33977 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] assignUser commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1115142054


##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,97 @@
+# 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: "Workflow label bot"
+on:
+  pull_request_target:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+      - synchronize
+  workflow_run:
+    workflows: ["Label when reviewed"]
+    types: ['completed']
+
+permissions:
+  contents: read
+  pull-requests: write
+  issues: write
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          repository: apache/arrow
+          ref: main
+          persist-credentials: false
+          # fetch the tags for version number generation
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8
+      - name: Install Archery and Crossbow dependencies
+        run: pip install -e arrow/dev/archery[bot]
+      - name: 'Download PR review payload'
+        id: 'download'
+        if: github.event_name == 'workflow_run'
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const run_id = "${{ github.event.workflow_run.id }}";
+            let artifacts = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: run_id,
+            });
+            let pr_review_artifact = artifacts.data.artifacts.filter((artifact) => {
+              return artifact.name == "pr_review_payload"
+            })[0];
+            let pr_review_download = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: pr_review_artifact.id,
+              archive_format: 'zip',
+            });
+            var fs = require('fs');
+            fs.writeFileSync('${{github.workspace}}/pr_review.zip', Buffer.from(pr_review_download.data));
+      - name: Extract artifact
+        id: extract
+        if: github.event_name == 'workflow_run'
+        run: |
+          unzip pr_review.zip
+          echo "pr_review_path=$(pwd)/event.json" >> $GITHUB_OUTPUT
+      - name: Handle PR workflow event
+        env:
+          ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          if ${{ github.event_name == 'workflow_run' }}; then
+            # workflow_run is executed on PR review. Update to original event.
+            archery trigger-bot \
+              --event-name "pull_request_review" \
+              --event-payload ${{ steps.extract.outputs.pr_review_path }}

Review Comment:
   ```suggestion
                 --event-payload "${{ steps.extract.outputs.pr_review_path }}"
   ```
   These should always be quoted when used to avoid the danger of script injection.



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,97 @@
+# 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: "Workflow label bot"
+on:
+  pull_request_target:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+      - synchronize
+  workflow_run:
+    workflows: ["Label when reviewed"]
+    types: ['completed']
+
+permissions:
+  contents: read
+  pull-requests: write
+  issues: write
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          repository: apache/arrow
+          ref: main
+          persist-credentials: false
+          # fetch the tags for version number generation
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8
+      - name: Install Archery and Crossbow dependencies
+        run: pip install -e arrow/dev/archery[bot]
+      - name: 'Download PR review payload'
+        id: 'download'
+        if: github.event_name == 'workflow_run'
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const run_id = "${{ github.event.workflow_run.id }}";
+            let artifacts = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: run_id,
+            });
+            let pr_review_artifact = artifacts.data.artifacts.filter((artifact) => {
+              return artifact.name == "pr_review_payload"
+            })[0];
+            let pr_review_download = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: pr_review_artifact.id,
+              archive_format: 'zip',
+            });
+            var fs = require('fs');
+            fs.writeFileSync('${{github.workspace}}/pr_review.zip', Buffer.from(pr_review_download.data));
+      - name: Extract artifact
+        id: extract
+        if: github.event_name == 'workflow_run'
+        run: |
+          unzip pr_review.zip
+          echo "pr_review_path=$(pwd)/event.json" >> $GITHUB_OUTPUT
+      - name: Handle PR workflow event
+        env:
+          ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          if ${{ github.event_name == 'workflow_run' }}; then
+            # workflow_run is executed on PR review. Update to original event.
+            archery trigger-bot \
+              --event-name "pull_request_review" \
+              --event-payload ${{ steps.extract.outputs.pr_review_path }}
+          else
+            archery trigger-bot \
+              --event-name ${{ github.event_name }} \
+              --event-payload ${{ github.event_path }}

Review Comment:
   ```suggestion
                 --event-name "${{ github.event_name }}" \
                 --event-payload "${{ github.event_path }}"
   ```
   same as above here but as it's the github context it is not strictly necessary but it also doesn't hurt :D



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,97 @@
+# 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: "Workflow label bot"
+on:
+  pull_request_target:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+      - synchronize
+  workflow_run:
+    workflows: ["Label when reviewed"]
+    types: ['completed']
+
+permissions:
+  contents: read
+  pull-requests: write
+  issues: write
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          repository: apache/arrow
+          ref: main
+          persist-credentials: false
+          # fetch the tags for version number generation
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8
+      - name: Install Archery and Crossbow dependencies
+        run: pip install -e arrow/dev/archery[bot]
+      - name: 'Download PR review payload'
+        id: 'download'
+        if: github.event_name == 'workflow_run'
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const run_id = "${{ github.event.workflow_run.id }}";
+            let artifacts = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: run_id,
+            });
+            let pr_review_artifact = artifacts.data.artifacts.filter((artifact) => {
+              return artifact.name == "pr_review_payload"
+            })[0];
+            let pr_review_download = await github.rest.actions.downloadArtifact({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              artifact_id: pr_review_artifact.id,
+              archive_format: 'zip',
+            });
+            var fs = require('fs');
+            fs.writeFileSync('${{github.workspace}}/pr_review.zip', Buffer.from(pr_review_download.data));
+      - name: Extract artifact
+        id: extract
+        if: github.event_name == 'workflow_run'
+        run: |
+          unzip pr_review.zip
+          echo "pr_review_path=$(pwd)/event.json" >> $GITHUB_OUTPUT
+      - name: Handle PR workflow event
+        env:
+          ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          if ${{ github.event_name == 'workflow_run' }}; then

Review Comment:
   interesting, I wasn't aware of that. Sounds good.



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,97 @@
+# 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: "Workflow label bot"
+on:
+  pull_request_target:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+      - synchronize
+  workflow_run:
+    workflows: ["Label when reviewed"]
+    types: ['completed']
+
+permissions:
+  contents: read
+  pull-requests: write
+  issues: write
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          repository: apache/arrow
+          ref: main
+          persist-credentials: false
+          # fetch the tags for version number generation
+          fetch-depth: 0

Review Comment:
   Could you move the checkout and archery install down, after the extracting of the artifact? Because otherwise the artifact could possibly overwrite files from the repo (e.g. parts of archery) with user controlled code.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] raulcd merged pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd merged PR #34161:
URL: https://github.com/apache/arrow/pull/34161


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] raulcd commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1115558161


##########
dev/archery/archery/bot.py:
##########
@@ -82,6 +87,121 @@ def parse_args(self, ctx, args):
 group = partial(click.group, cls=Group)
 
 
+LABEL_PREFIX = "awaiting"
+
+
+@enum.unique
+class PullRequestState(enum.Enum):
+    """State of a pull request."""
+
+    review = f"{LABEL_PREFIX} review"
+    committer_review = f"{LABEL_PREFIX} committer review"
+    changes = f"{LABEL_PREFIX} changes"
+    change_review = f"{LABEL_PREFIX} change review"
+    merge = f"{LABEL_PREFIX} merge"
+
+
+COMMITTER_ROLES = {'OWNER', 'MEMBER'}
+
+
+class PullRequestWorkflowBot:
+
+    def __init__(self, event_name, event_payload, token=None):
+        self.github = github.Github(token)
+        self.event_name = event_name
+        self.event_payload = event_payload
+
+    @cached_property
+    def pull(self):
+        """
+        Returns a github.PullRequest object associated with the event.
+        """
+        return self.repo.get_pull(self.event_payload['pull_request']['number'])
+
+    @cached_property
+    def repo(self):
+        return self.github.get_repo(self.event_payload['repository']['id'], lazy=True)
+
+    def handle(self):
+        current_state = None
+        try:
+            current_state = self.get_current_state()
+        except EventError:
+            # In case of error (more than one state) we clear state labels
+            # only possible if a label has been manually added.
+            self.clear_current_state()
+        new_state = self.get_target_state(current_state)
+        if current_state != new_state.value:
+            if current_state:
+                self.clear_current_state()
+            self.set_state(new_state)
+
+    def get_current_state(self):
+        """
+        Returns a string with the current PR state label
+        based on label starting with LABEL_PREFIX.
+        If more than one label is found raises EventError.
+        If no label is found returns None.
+        """
+        states = [label.name for label in self.pull.get_labels()
+                  if label.name.startswith(LABEL_PREFIX)]
+        if len(states) > 1:
+            raise EventError(f"PR cannot be on more than one states - {states}")
+        elif states:
+            return states[0]
+
+    def clear_current_state(self):
+        """
+        Removes all existing labels starting with LABEL_PREFIX
+        """
+        for label in self.pull.get_labels():
+            if label.name.startswith(LABEL_PREFIX):
+                self.pull.remove_from_labels(label)
+
+    def get_target_state(self, current_state):

Review Comment:
   you mean calling `transit_state` the method/variable for what I've called `current_state`? `s/get_current_state/transit_state`?
   plus `s/get_target_state/compute_next_state`



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1115091984


##########
dev/archery/archery/bot.py:
##########
@@ -82,6 +87,121 @@ def parse_args(self, ctx, args):
 group = partial(click.group, cls=Group)
 
 
+LABEL_PREFIX = "awaiting"
+
+
+@enum.unique
+class PullRequestState(enum.Enum):
+    """State of a pull request."""
+
+    review = f"{LABEL_PREFIX} review"
+    committer_review = f"{LABEL_PREFIX} committer review"
+    changes = f"{LABEL_PREFIX} changes"
+    change_review = f"{LABEL_PREFIX} change review"
+    merge = f"{LABEL_PREFIX} merge"
+
+
+COMMITTER_ROLES = {'OWNER', 'MEMBER'}
+
+
+class PullRequestWorkflowBot:
+
+    def __init__(self, event_name, event_payload, token=None):
+        self.github = github.Github(token)
+        self.event_name = event_name
+        self.event_payload = event_payload
+
+    @cached_property
+    def pull(self):
+        """
+        Returns a github.PullRequest object associated with the event.
+        """
+        return self.repo.get_pull(self.event_payload['pull_request']['number'])
+
+    @cached_property
+    def repo(self):
+        return self.github.get_repo(self.event_payload['repository']['id'], lazy=True)
+
+    def handle(self):
+        current_state = None
+        try:
+            current_state = self.get_current_state()
+        except EventError:
+            # In case of error (more than one state) we clear state labels
+            # only possible if a label has been manually added.
+            self.clear_current_state()
+        new_state = self.get_target_state(current_state)
+        if current_state != new_state.value:
+            if current_state:
+                self.clear_current_state()
+            self.set_state(new_state)
+
+    def get_current_state(self):
+        """
+        Returns a string with the current PR state label
+        based on label starting with LABEL_PREFIX.
+        If more than one label is found raises EventError.
+        If no label is found returns None.
+        """
+        states = [label.name for label in self.pull.get_labels()
+                  if label.name.startswith(LABEL_PREFIX)]
+        if len(states) > 1:
+            raise EventError(f"PR cannot be on more than one states - {states}")
+        elif states:
+            return states[0]
+
+    def clear_current_state(self):
+        """
+        Removes all existing labels starting with LABEL_PREFIX
+        """
+        for label in self.pull.get_labels():
+            if label.name.startswith(LABEL_PREFIX):
+                self.pull.remove_from_labels(label)
+
+    def get_target_state(self, current_state):

Review Comment:
   How about using more meaningful method name such as `transit_state` and `compute_next_state`?



##########
dev/archery/archery/bot.py:
##########
@@ -82,6 +87,121 @@ def parse_args(self, ctx, args):
 group = partial(click.group, cls=Group)
 
 
+LABEL_PREFIX = "awaiting"
+
+
+@enum.unique
+class PullRequestState(enum.Enum):
+    """State of a pull request."""
+
+    review = f"{LABEL_PREFIX} review"
+    committer_review = f"{LABEL_PREFIX} committer review"
+    changes = f"{LABEL_PREFIX} changes"
+    change_review = f"{LABEL_PREFIX} change review"
+    merge = f"{LABEL_PREFIX} merge"
+
+
+COMMITTER_ROLES = {'OWNER', 'MEMBER'}
+
+
+class PullRequestWorkflowBot:
+
+    def __init__(self, event_name, event_payload, token=None):
+        self.github = github.Github(token)
+        self.event_name = event_name
+        self.event_payload = event_payload
+
+    @cached_property
+    def pull(self):
+        """
+        Returns a github.PullRequest object associated with the event.
+        """
+        return self.repo.get_pull(self.event_payload['pull_request']['number'])
+
+    @cached_property
+    def repo(self):
+        return self.github.get_repo(self.event_payload['repository']['id'], lazy=True)
+
+    def handle(self):
+        current_state = None
+        try:
+            current_state = self.get_current_state()
+        except EventError:
+            # In case of error (more than one state) we clear state labels
+            # only possible if a label has been manually added.
+            self.clear_current_state()
+        new_state = self.get_target_state(current_state)
+        if current_state != new_state.value:
+            if current_state:
+                self.clear_current_state()
+            self.set_state(new_state)
+
+    def get_current_state(self):
+        """
+        Returns a string with the current PR state label
+        based on label starting with LABEL_PREFIX.
+        If more than one label is found raises EventError.
+        If no label is found returns None.
+        """
+        states = [label.name for label in self.pull.get_labels()
+                  if label.name.startswith(LABEL_PREFIX)]
+        if len(states) > 1:
+            raise EventError(f"PR cannot be on more than one states - {states}")
+        elif states:
+            return states[0]
+
+    def clear_current_state(self):
+        """
+        Removes all existing labels starting with LABEL_PREFIX
+        """
+        for label in self.pull.get_labels():
+            if label.name.startswith(LABEL_PREFIX):
+                self.pull.remove_from_labels(label)
+
+    def get_target_state(self, current_state):
+        """
+        Returns the expected target state based on the event and
+        the current state.
+        """
+        if (self.event_name == "pull_request_target" and
+                self.event_payload['action'] == 'opened'):
+            if (self.event_payload['pull_request']['author_association'] in
+                    COMMITTER_ROLES):
+                return PullRequestState.committer_review
+            else:
+                return PullRequestState.review
+        elif (self.event_name == "pull_request_review" and
+                self.event_payload["action"] == "submitted"):
+            review_state = self.event_payload["review"]["state"].lower()
+            is_committer_review = (self.event_payload['review']['author_association']
+                                   in COMMITTER_ROLES)
+            if not is_committer_review:
+                # Non-committer reviews cannot change state once committer has already
+                # reviewed and requested changes.
+                if current_state in (
+                        PullRequestState.change_review.value,
+                        PullRequestState.changes.value):
+                    return PullRequestState(current_state)
+                else:
+                    return PullRequestState.committer_review
+            if review_state == 'approved':
+                return PullRequestState.merge
+            elif review_state in ("changes_requested", "commented"):

Review Comment:
   Can we simplify this?
   
   ```suggestion
               else
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] assignUser commented on a diff in pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on code in PR #34161:
URL: https://github.com/apache/arrow/pull/34161#discussion_r1105967490


##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:
+

Review Comment:
   ~~we should add minimal permissions to the token, I'll have to check what is required but I guess pull_requests:write for labels +?~~



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    permissions:
+      contents: read
+      pull-requests: write
+      issues: write

Review Comment:
   Could you move this to the top so it matches the other workflows? It is easily missed ( as just happened to me xD) here



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:
+
+jobs:
+  pr-workflow-bot-job:
+    name: "PR Workflow bot"
+    permissions:
+      contents: read
+      pull-requests: write
+      issues: write
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Arrow
+        uses: actions/checkout@v3
+        with:
+          path: arrow
+          # fetch the tags for version number generation
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8
+      - name: Install Archery and Crossbow dependencies
+        run: pip install -e arrow/dev/archery[bot]
+      - name: Handle PR workflow event
+        env:
+          ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          CROSSBOW_GITHUB_TOKEN: ${{ secrets.CROSSBOW_GITHUB_TOKEN }}

Review Comment:
   do we need to expose that here?



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot

Review Comment:
   You can use normal Syntax like "Workflow Label Bot" or something in the name field, you should just quote it to avoid yaml shenanigans.



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:
+    types:
+      - opened
+      - converted_to_draft
+      - ready_for_review
+  pull_request_review:
+    types:
+      - submitted
+  push:

Review Comment:
   I would replace this with adding 'synchronize' on the `pull_request_target` trigger. That can than also be used in the python code to disambiguate via the payload key `action`. 



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:

Review Comment:
   PSA: when using `pull_request_target` (or any other trigger that has elevated privileges) make sure not to run untrusted code (aka anything from the PR)



##########
.github/workflows/pr_bot.yml:
##########
@@ -0,0 +1,58 @@
+# 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: pr-workflow-bot
+on:
+  pull_request:

Review Comment:
   we need to use `pull_request_target` here to make the correct permissions available.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] raulcd commented on pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #34161:
URL: https://github.com/apache/arrow/pull/34161#issuecomment-1439935761

   I have reproduced the workflow logic on an environment like ours. I created a copy of arrow on an organization, created a fork and did some tests with a committer/non-committer user. The full workflow with the transitions can be seen on this PR: https://github.com/te-chie-la/arrow-pr-workflow-copy/pull/17
   The full workflow implementation uses GitHub actions to trigger archery bot tasks and some logic on archery to manage the transitions. The code on archery is tested with the different events and expected transitions.
   @kou @assignUser I think this is ready for an initial round of reviews. The majority of the diff is due to a lot of fixtures with the event payloads being added for the tests.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #34161: GH-33977: [Dev] PR Workflow automation bot

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #34161:
URL: https://github.com/apache/arrow/pull/34161#issuecomment-1449402610

   Benchmark runs are scheduled for baseline = 6cf5e8984a48e70352e65112c3254fc03557767a and contender = 68e89ac9ee5bf2c0c68493eb9405554162fdfab8. 68e89ac9ee5bf2c0c68493eb9405554162fdfab8 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/2c3dada7142f4464947de18174a7fca5...96bc464914bb479ba15b1a18ac616f05/)
   [Failed :arrow_down:0.67% :arrow_up:0.0%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/06a04a525d11461aa9e81ca28f8cff62...af706fc97f6d4c56b8634bc09bb8da6d/)
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/1134b0b3418f4302a1b76d702e25e3f0...9e55b1a71dfb487594ede96fb0026e03/)
   [Finished :arrow_down:0.06% :arrow_up:0.16%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/9a11c35d71344df89f6461295424611f...a32f5b14ffa744b1a09e6c896025eb28/)
   Buildkite builds:
   [Finished] [`68e89ac9` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2449)
   [Failed] [`68e89ac9` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2479)
   [Finished] [`68e89ac9` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2447)
   [Finished] [`68e89ac9` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2470)
   [Finished] [`6cf5e898` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2448)
   [Finished] [`6cf5e898` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2478)
   [Finished] [`6cf5e898` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2446)
   [Finished] [`6cf5e898` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2469)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org