Skip to content

Commit 7fede00

Browse files
committed
ARROW-8064: [Dev] Implement Comment bot via Github actions
See it in action: kszucs#16 (comment) Main drawback that is is much slower than ursabot, but we can optimize it by: - porting crossbow to only depend on pygithub instead of libgit2 (will consume the rate limit, but should fit in) - use caching or docker Theoretically CROSSBOW_GITHUB_TOKEN is set as a github actions secret, see https://issues.apache.org/jira/browse/INFRA-19954 We can trigger a build once this is merged into master. Closes #6571 from kszucs/master and squashes the following commits: 7a604a8 <Krisztián Szűcs> note that the license is BSD2 8586eb7 <Krisztián Szűcs> add license reference def8724 <Krisztián Szűcs> RAT a96e7e2 <Krisztián Szűcs> flake8 6f5da63 <Krisztián Szűcs> add requirements to docker whitelist 6678c2e <Krisztián Szűcs> update archery dependencies 33f65d4 <Krisztián Szűcs> revert removing the rest of the workflows a82b879 <Krisztián Szűcs> test dep 06a7716 <Krisztián Szűcs> responses test dep ba25229 <Krisztián Szűcs> fix archery workflow syntax 9352ee0 <Krisztián Szűcs> run archery unittests deb857f <Krisztián Szűcs> checkout@v2 and fetch tags 215495a <Krisztián Szűcs> fix result path 748832f <Krisztián Szűcs> message formatter ea1b7c8 <Krisztián Szűcs> no dry run 6c83b0c <Krisztián Szűcs> dry run 4789ac5 <Krisztián Szűcs> response ormatter 1b0b15d <Krisztián Szűcs> cleanup 2270a35 <Krisztián Szűcs> validate 035024f <Krisztián Szűcs> validate callback e791c62 <Krisztián Szűcs> diag 641227f <Krisztián Szűcs> diab b22b204 <Krisztián Szűcs> token d95e86b <Krisztián Szűcs> path to event payload 3e9a279 <Krisztián Szűcs> pygithub ca1592d <Krisztián Szűcs> typo 3c1358e <Krisztián Szűcs> triger event handler 55e65fa <Krisztián Szűcs> crossbow command 92568eb <Krisztián Szűcs> first draft of bot 99ea0c2 <Krisztián Szűcs> cat 3c0f16d <Krisztián Szűcs> remove all other workflows 1f8f21d <Krisztián Szűcs> diag event handling 2f613dd <Krisztián Szűcs> Check event handling (#15) Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com> Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
1 parent 29e1e47 commit 7fede00

34 files changed

+3386
-3
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# include explicitly
2828
!ci/**
2929
!c_glib/Gemfile
30+
!dev/archery/requirements*.txt
3031
!python/requirements*.txt
3132
!python/manylinux1/**
3233
!python/manylinux2010/**

.github/workflows/archery.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Archery
19+
20+
on:
21+
push:
22+
paths:
23+
- '.github/workflows/archery.yml'
24+
- 'dev/archery/**'
25+
pull_request:
26+
paths:
27+
- '.github/workflows/archery.yml'
28+
- 'dev/archery/**'
29+
30+
jobs:
31+
32+
archery:
33+
name: Archery Unittests
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout Arrow
37+
uses: actions/checkout@v1
38+
with:
39+
submodules: true
40+
- name: Setup Python
41+
uses: actions/setup-python@v1
42+
with:
43+
python-version: '3.7'
44+
- name: Install
45+
working-directory: dev/archery
46+
run: pip install pytest responses ruamel.yaml -e .
47+
- name: Test
48+
working-directory: dev/archery
49+
run: pytest -v archery

.github/workflows/comment_bot.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Comment Bot
19+
20+
on:
21+
# TODO(kszucs): support pull_request_review_comment
22+
issue_comment:
23+
types:
24+
- created
25+
- edited
26+
27+
jobs:
28+
29+
debug:
30+
name: Debug
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout Arrow
34+
uses: actions/checkout@v2
35+
with:
36+
path: arrow
37+
# in order to generate version number based on git we need the tags
38+
# fetched but checkout@v2 doesn't do that by default
39+
- name: Featch Arrow tags
40+
working-directory: arrow
41+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
42+
# because libgit2 is a dependency of crossbow so prefer conda
43+
- name: Setup Conda
44+
uses: s-weigand/setup-conda@v1
45+
with:
46+
update-conda: true
47+
python-version: 3.7
48+
conda-channels: conda-forge
49+
- name: Instal Archery and Crossbow dependencies
50+
run: |
51+
conda install -y --file arrow/ci/conda_env_crossbow.txt pygithub
52+
pip install -e arrow/dev/archery
53+
- name: Handle Github comment event
54+
env:
55+
ARROW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
CROSSBOW_GITHUB_TOKEN: ${{ secrets.CROSSBOW_GITHUB_TOKEN }}
57+
run: |
58+
archery trigger-bot \
59+
--event-name ${{ github.event_name }} \
60+
--event-payload ${{ github.event_path }}
61+
62+

LICENSE.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,36 @@ OR OTHER DEALINGS IN THE SOFTWARE.
967967

968968
--------------------------------------------------------------------------------
969969

970+
The projects includes code from the Ursabot project under the dev/archery
971+
directory.
972+
973+
License: BSD 2-Clause
974+
975+
Copyright 2019 RStudio, Inc.
976+
977+
Redistribution and use in source and binary forms, with or without
978+
modification, are permitted provided that the following conditions are met:
979+
980+
1. Redistributions of source code must retain the above copyright notice, this
981+
list of conditions and the following disclaimer.
982+
983+
2. Redistributions in binary form must reproduce the above copyright notice,
984+
this list of conditions and the following disclaimer in the documentation
985+
and/or other materials provided with the distribution.
986+
987+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
988+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
989+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
990+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
991+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
992+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
993+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
994+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
995+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
996+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
997+
998+
--------------------------------------------------------------------------------
999+
9701000
This project include code from CMake.
9711001

9721002
* cpp/cmake_modules/FindGTest.cmake is based on code from CMake.

ci/conda_env_archery.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
click
19+
pygithub
20+
ruamel.yaml

ci/docker/conda-integration.dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ ARG node=11
2525
ARG jdk=8
2626
ARG go=1.12
2727

28+
COPY ci/conda_env_archery.yml /arrow/ci/
2829
RUN conda install -q \
30+
--file arrow/ci/conda_env_archery.yml \
2931
numpy \
3032
maven=${maven} \
3133
nodejs=${node} \

ci/docker/linux-apt-lint.dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ RUN rustup install ${rust} && \
5555
# Use python3 by default in scripts
5656
RUN ln -s /usr/bin/python3 /usr/local/bin/python && \
5757
ln -s /usr/bin/pip3 /usr/local/bin/pip
58-
RUN pip install flake8 cmake_format==0.5.2 click
58+
59+
COPY dev/archery/requirements.txt \
60+
dev/archery/requirements-lint.txt \
61+
/arrow/dev/archery/
62+
RUN pip install \
63+
-r arrow/dev/archery/requirements.txt \
64+
-r arrow/dev/archery/requirements-lint.txt
5965

6066
ENV LC_ALL=C.UTF-8 \
6167
LANG=C.UTF-8

0 commit comments

Comments
 (0)