Apache DataFusion SQL Query Engine
ARROW-8102: [Dev] Crossbow's version detection doesn't work in the comment bot's scenario
Krisztián Szűcs9e96e0b07a6c
diff --git a/dev/archery/archery/bot.py b/dev/archery/archery/bot.pyindex e15ff21dde..55f8579a86 100644--- a/dev/archery/archery/bot.py+++ b/dev/archery/archery/bot.py@@ -277,16 +277,29 @@ def submit(obj, task, group, dry_run):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))+ # clone arrow and checkout the pull request's branch+ git.clone(pr.base.repo.clone_url, str(arrow))+ git.fetch('origin', 'pull/{}/head:{}'.format(pr.number, pr.head.ref),+ git_dir=str(arrow))+ git.checkout(pr.head.ref, git_dir=str(arrow))++ # clone crossbowgit.clone(crossbow_url, str(queue))# submit the crossbow tasksresult = Path('result.yml').resolve()xbow = Crossbow(str(arrow / 'dev' / 'tasks' / 'crossbow.py'))- xbow.run('--queue-path', str(queue),- '--output-file', str(result),- 'submit', *args)+ xbow.run(+ '--queue-path', str(queue),+ '--output-file', str(result),+ 'submit',+ '--job-prefix', 'actions',+ # don't rely on crossbow's remote and branch detection, because+ # it doesn't work without a tracking upstream branch+ '--arrow-remote', pr.head.repo.clone_url,+ '--arrow-branch', pr.head.ref,+ *args+ )# parse the result yml describing the submitted jobyaml = YAML()diff --git a/dev/archery/archery/utils/git.py b/dev/archery/archery/utils/git.pyindex d90b7097a2..0d83f79c90 100644--- a/dev/archery/archery/utils/git.py+++ b/dev/archery/archery/utils/git.py@@ -50,6 +50,10 @@ class Git(Command):def clone(self, *argv, **kwargs):return self.run_cmd(*argv, **kwargs)+ @git_cmd+ def fetch(self, *argv, **kwargs):+ return self.run_cmd(*argv, **kwargs)+@git_cmddef checkout(self, *argv, **kwargs):return self.run_cmd(*argv, **kwargs)