Apache DataFusion SQL Query Engine
ARROW-4229: [Packaging] Set crossbow target explicitly to enable building arbitrary arrow repo
Krisztián Szűcs3951dda28d7c
diff --git a/dev/tasks/crossbow.py b/dev/tasks/crossbow.pyindex 74facf4b7f..d700384e55 100755--- a/dev/tasks/crossbow.py+++ b/dev/tasks/crossbow.py@@ -398,9 +398,10 @@ class Target:self.version = version@classmethod- def from_repo(cls, repo):+ def from_repo(cls, repo, version=None):assert isinstance(repo, Repo)- version = get_version(repo.path, local_scheme=lambda v: '')+ if version is None:+ version = get_version(repo.path, local_scheme=lambda v: '')return cls(head=str(repo.head.target),email=repo.email,branch=repo.branch.branch_name,@@ -587,17 +588,48 @@ def load_tasks_from_config(config_path, task_names, group_names):help='Task configuration yml. Defaults to tasks.yml')@click.option('--arrow-version', '-v', default=None,help='Set target version explicitly')[email protected]('--arrow-repo', '-r', default=None,+ help='Set Github repo name explicitly, e.g. apache/arrow, '+ 'kszucs/arrow, this repository is going to be cloned on '+ 'the CI services. Note, that no validation happens locally '+ 'and potentially --arrow-branch and --arrow-sha must be '+ 'defined as well')[email protected]('--arrow-branch', '-b', default='master',+ help='Give the branch name explicitly, e.g. master, ARROW-1949.'+ 'Only available if --arrow-repo is set.')[email protected]('--arrow-sha', '-t', default='HEAD',+ help='Set commit SHA or Tag name explicitly, e.g. f67a515, '+ 'apache-arrow-0.11.1. Only available if both --arrow-repo '+ '--arrow-branch are set.')@click.option('--dry-run/--push', default=False,help='Just display the rendered CI configurations without ''submitting them')@click.pass_context-def submit(ctx, task, group, job_prefix, config_path, arrow_version, dry_run):+def submit(ctx, task, group, job_prefix, config_path, arrow_version,+ arrow_repo, arrow_branch, arrow_sha, dry_run):queue, arrow = ctx.obj['queue'], ctx.obj['arrow']- target = Target.from_repo(arrow)- # explicitly set arrow version- if arrow_version:- target.version = arrow_version+ if arrow_repo is not None:+ values = {'version': arrow_version,+ 'branch': arrow_branch,+ 'sha': arrow_sha}+ for k, v in values.items():+ if not v:+ raise ValueError('Must pass --arrow-{} argument'.format(k))++ # Set repo url, branch and sha explicitly - this aims to make release+ # procedure a bit simpler.+ # Note, that the target resivion's crossbow templates must be+ # compatible with the locally checked out version of crossbow (which is+ # in case of the release procedure), because the templates still+ # contain some business logic (dependency installation, deployments)+ # which will be reduced to a single command in the future.+ remote = 'https://github.com/{}'.format(arrow_repo)+ target = Target(head=arrow_sha, branch=arrow_branch, remote=remote,+ version=arrow_version)+ else:+ # instantiate target from the locally checked out repository and branch+ target = Target.from_repo(arrow, version=arrow_version)no_rc_version = re.sub(r'-rc\d+\Z', '', target.version)params = {