Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit b421300

Browse files
peat-psuwitUniversalSuperBox
authored andcommitted
Update the script to work with the new PR repo scheme
This is the follow-up to ubports/build-tools#29 & ubports/build-tools#32 which changes how packages from a PR is published in the repository. This commit: - make sure the correct apt repo name is used - corrects how GitHub repo name is processed to accomodate the recent job structure change in Jenkins.
1 parent 09ed5af commit b421300

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ubports-qa

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ def get_jenkins_build(repo, ref):
167167

168168

169169
def get_issue_status(repo, ref):
170-
build = get_jenkins_build(repo, ref)["latestRun"]
170+
# Prepend "ubports/" because all CI jobs start with it.
171+
build = get_jenkins_build("ubports/" + repo, ref)["latestRun"]
171172
LOG.debug(build)
172173
if build["result"] == "SUCCESS":
173174
return Status.SUCCESS
@@ -186,17 +187,18 @@ def die(error_message):
186187
def install_command(args):
187188
"""Install a PPA or Pull Request"""
188189
if args.pr is not NO_PR:
189-
args.repo.replace("ubports/", "")
190+
# Support both with or without ubports/ prefix.
191+
github_repo = args.repo.replace("ubports/", "")
190192
ref = "PR-" + str(args.pr)
191193
LOG.debug(
192-
"Checking repository ubports/" + args.repo + " for PR #" + str(args.pr)
194+
"Checking repository ubports/" + github_repo + " for PR #" + str(args.pr)
193195
)
194-
status = get_issue_status(args.repo, ref)
196+
status = get_issue_status(github_repo, ref)
195197
if status == Status.FAILED:
196198
die("Issue failed to build")
197199
if status == Status.BUILDING:
198200
die("Issue is currently building")
199-
repository_name = ref
201+
repository_name = "PR_{repo}_{pr_num}".format(repo=github_repo, pr_num=args.pr)
200202
else:
201203
repository_name = args.repo
202204
LOG.debug("No PR set, installing " + repository_name)

0 commit comments

Comments
 (0)