Apache DataFusion SQL Query Engine
ARROW-8097: [Dev] Comment bot's crossbow command acts on the master branch
Krisztián Szűcs3b7451b9fb8b
diff --git a/.github/workflows/comment_bot.yml b/.github/workflows/comment_bot.ymlindex 4b473287f0..d501d97131 100644--- a/.github/workflows/comment_bot.yml+++ b/.github/workflows/comment_bot.yml@@ -26,19 +26,14 @@ on:jobs:- debug:- name: Debug+ listen:+ name: Listen!runs-on: ubuntu-lateststeps:- name: Checkout Arrowuses: actions/checkout@v2with:path: arrow- # in order to generate version number based on git we need the tags- # fetched but checkout@v2 doesn't do that by default- - name: Featch Arrow tags- working-directory: arrow- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*# because libgit2 is a dependency of crossbow so prefer conda- name: Setup Condauses: s-weigand/setup-conda@v1diff --git a/dev/archery/archery/bot.py b/dev/archery/archery/bot.pyindex 29204ae791..e15ff21dde 100644--- a/dev/archery/archery/bot.py+++ b/dev/archery/archery/bot.py@@ -19,6 +19,7 @@ import operatorimport shlexfrom pathlib import Pathfrom functools import partial+import tempfileimport clickimport github@@ -258,20 +259,34 @@ def submit(obj, task, group, dry_run):See groups defined in arrow/dev/tasks/tests.yml"""+ git = Git()++ # construct crossbow argumentsargs = []for g in group:args.extend(['-g', g])for t in task:args.append(t)- # clone crossbow- git = Git()- git.clone('https://github.com/{}'.format(obj['crossbow_repo']), 'crossbow')+ # pygithub pull request object+ pr = obj['pull']+ crossbow_url = 'https://github.com/{}'.format(obj['crossbow_repo'])++ with tempfile.TemporaryDirectory() as tmpdir:+ tmpdir = Path(tmpdir)+ arrow = tmpdir / 'arrow'+ queue = tmpdir / 'crossbow'++ # clone arrow, crossbow and checkout the pull request's branch+ git.clone('--branch', pr.head.ref, pr.head.repo.clone_url, str(arrow))+ git.clone(crossbow_url, str(queue))- # submit the crossbow tasks- result = Path('result.yml').resolve()- xbow = Crossbow('arrow/dev/tasks/crossbow.py')- xbow.run('--output-file', str(result), 'submit', *args)+ # submit the crossbow tasks+ result = Path('result.yml').resolve()+ xbow = Crossbow(str(arrow / 'dev' / 'tasks' / 'crossbow.py'))+ xbow.run('--queue-path', str(queue),+ '--output-file', str(result),+ 'submit', *args)# parse the result yml describing the submitted jobyaml = YAML()@@ -283,4 +298,4 @@ def submit(obj, task, group, dry_run):response = formatter.render(job)# send the response- obj['pull'].create_issue_comment(response)+ pr.create_issue_comment(response)