From 74050b02807f06cc45fafb0bf5a1a3b915c02468 Mon Sep 17 00:00:00 2001 From: e Date: Mon, 27 Sep 2021 17:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=A1=8Ccheck=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=BB=9F=E8=AE=A1issue=E7=9A=84status?= =?UTF-8?q?=EF=BC=8Crelease=20=E5=A2=9E=E5=8A=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=9A=84=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javcra/cli/commands/checkpart.py | 32 ++++++++++++++----- .../javcra/cli/commands/releasepart.py | 20 ++++++++++-- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/release-assistant/javcra/cli/commands/checkpart.py b/release-assistant/javcra/cli/commands/checkpart.py index 79f182e..afff87e 100644 --- a/release-assistant/javcra/cli/commands/checkpart.py +++ b/release-assistant/javcra/cli/commands/checkpart.py @@ -168,15 +168,30 @@ class CheckCommand(BaseCommand): Args: params: Command line parameters - Returns: - True or False + Raises: + ValueError: throw an exception when the function call returns false """ - status_res = self.issue(params).check_issue_state() + issue = self.issue(params) + check_issue = self.check_issue(params) + + # check whether all the issue status is incomplete + status_res = issue.check_issue_state() if not status_res: - print("[ERROR] failed to update status in check part.") - return False + raise ValueError("failed to update status in check part.") print("[INFO] successfully update status in check part.") - return True + + # statistics of the status of all issues + count_res = issue.count_issue_status() + if not count_res: + raise ValueError("the status of the issue is not all completed, please complete first") + print("[INFO] All issues are completed, the next test platform test") + + # send repo info + resp = check_issue.send_repo_info() + if not resp: + print("[ERROR] failed to send repo info.") + return + print("[info] to send repo info success") def requires_operation(self, params): """ @@ -347,5 +362,6 @@ class CheckCommand(BaseCommand): return try: getattr(self, "{}_operation".format(params.type))(params) - except ValueError: - print("not allowed operate type: %s in check part." % params.type) + except ValueError as error: + print("during the operation %s, a failure occurred, " + "and the cause of the error was %s" % (params.type, error)) diff --git a/release-assistant/javcra/cli/commands/releasepart.py b/release-assistant/javcra/cli/commands/releasepart.py index cf5e317..8c7383a 100644 --- a/release-assistant/javcra/cli/commands/releasepart.py +++ b/release-assistant/javcra/cli/commands/releasepart.py @@ -125,6 +125,21 @@ class ReleaseCommand(BaseCommand): epol_transfer_res = publish_rpms(obs_prj, "EPOL") self.create_comment("transfer epol rpm jenkins res", epol_transfer_res, issue) + def cvrfok_operation(self, params): + """ + Description: operation for cvrf ok + Args: + params: Command line parameters + + Returns: + + """ + + release_resp = IssueOperation.release_announcement(params.publishuser, params.publishkey) + if not release_resp: + raise ValueError("failed to publish announcement") + print("successful announcement") + def do_command(self, params): """ Description: Executing command @@ -155,5 +170,6 @@ class ReleaseCommand(BaseCommand): try: getattr(self, "{}_operation".format(params.type))(params) - except ValueError: - print("not allowed operate type: %s in release part." % params.type) + except ValueError as error: + print("during the operation %s, a failure occurred, " + "and the cause of the error was %s" % (params.type, error)) -- Gitee