Skip to content

Commit d433ffc

Browse files
authored
GH-50336: [Release][Archery] Fix archery GitHub integration for release scripts (#50337)
### Rationale for this change The source verification and binary verification scripts comment to the Verification PR were failing due to the last updates to archery in order to use a single dependency. ### What changes are included in this PR? Add required base and head branches to be used when looking for a PR. Use create_issue_comment on PRs instead of create_comment which tries to create a review comment which requires more arguments. ### Are these changes tested? Yes, I've tested them locally in isolation in order to add comments on the verification PR. ### Are there any user-facing changes? No * GitHub Issue: #50336 Authored-by: Raúl Cumplido <raulcumplido@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent ebde321 commit d433ffc

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

dev/archery/archery/crossbow/cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def verify_release_candidate(obj, base_branch, create_pr,
208208
for flag, group in zip(verify_flags, verify_groups):
209209
if flag:
210210
job_groups += f" --group {group}"
211-
response.create_comment(
211+
response.create_issue_comment(
212212
f"{command} {job_groups} --param " +
213213
f"release={version} --param rc={rc}")
214214

@@ -300,6 +300,10 @@ def asset_callback(task_name, task, asset):
300300

301301

302302
@crossbow.command()
303+
@click.option('--base-branch', default='main',
304+
help='Set base branch for the PR.')
305+
@click.option('--head-branch', default=None,
306+
help='Set head branch for the PR.')
303307
@click.option('--arrow-remote', '-r', default=None,
304308
help='Set GitHub remote explicitly, which is going to be cloned '
305309
'on the CI services. Note, that no validation happens '
@@ -313,7 +317,8 @@ def asset_callback(task_name, task, asset):
313317
@click.option('--pr-title', required=True,
314318
help='Track the job submitted on PR with given title')
315319
@click.pass_obj
316-
def report_pr(obj, arrow_remote, crossbow, fetch, job_name, pr_title):
320+
def report_pr(obj, base_branch, head_branch, arrow_remote, crossbow,
321+
fetch, job_name, pr_title):
317322
arrow = obj['arrow']
318323
queue = obj['queue']
319324
if fetch:
@@ -322,11 +327,12 @@ def report_pr(obj, arrow_remote, crossbow, fetch, job_name, pr_title):
322327

323328
report = CommentReport(job, crossbow_repo=crossbow)
324329
target_arrow = Repo(path=arrow.path, remote_url=arrow_remote)
325-
pull_request = target_arrow.github_pr(title=pr_title,
330+
pull_request = target_arrow.github_pr(base=base_branch, head=head_branch,
331+
title=pr_title,
326332
github_token=queue.github_token,
327333
create=False)
328334
# render the response comment's content on the PR
329-
pull_request.create_comment(report.show())
335+
pull_request.create_issue_comment(report.show())
330336
click.echo(f'Job is tracked on PR {pull_request.html_url}')
331337

332338

dev/release/03-binary-submit.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ version_with_rc="${version}-rc${rc}"
3434
crossbow_job_prefix="release-${version_with_rc}"
3535
release_tag="apache-arrow-${version}-rc${rc}"
3636
rc_branch="release-${version_with_rc}"
37+
maint_branch="maint-${version}"
3738

3839
: ${ARROW_REPOSITORY:="apache/arrow"}
3940
: ${ARROW_BRANCH:=${release_tag}}
@@ -57,5 +58,7 @@ job_name=$(archery crossbow latest-prefix --no-fetch ${crossbow_job_prefix})
5758
archery crossbow report-pr \
5859
--no-fetch \
5960
--arrow-remote "https://github.com/${ARROW_REPOSITORY}" \
61+
--base-branch ${maint_branch} \
62+
--head-branch ${rc_branch} \
6063
--job-name ${job_name} \
6164
--pr-title "WIP: [Release] Verify ${rc_branch}"

0 commit comments

Comments
 (0)