Skip to content

Commit

Permalink
Log build and its beta details after processing has completed (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
priitlatt authored Sep 15, 2023
1 parent 07fdf70 commit 1ec2992
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.44.1
-------------

**Features**
- Log out processed build and its beta detail information before submitting it to App Store or TestFlight. [PR #347](https://github.com/codemagic-ci-cd/cli-tools/pull/347)

Version 0.44.0
-------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "codemagic-cli-tools"
version = "0.44.0"
version = "0.44.1"
description = "CLI tools used in Codemagic builds"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion src/codemagic/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "codemagic-cli-tools"
__description__ = "CLI tools used in Codemagic builds"
__version__ = "0.44.0.dev"
__version__ = "0.44.1.dev"
__url__ = "https://github.com/codemagic-ci-cd/cli-tools"
__licence__ = "GNU General Public License v3.0"
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,7 @@ def _wait_until_build_is_processed(
elif build.attributes.processingState in (BuildProcessingState.FAILED, BuildProcessingState.INVALID):
raise IOError(f"Uploaded build {build.id} is {build.attributes.processingState.value.lower()}")
else:
if not is_first_attempt:
self.logger.info(Colors.BLUE("Processing build %s is completed\n"), build.id)
self.logger.info(Colors.GREEN("Processing build %s is completed"), build.id)
return build
is_first_attempt = False

Expand Down Expand Up @@ -495,12 +494,11 @@ def _wait_until_build_beta_detail_is_processed(
build_beta_detail.attributes.externalBuildState is not ExternalBetaState.PROCESSING
or build_beta_detail.attributes.internalBuildState is not InternalBetaState.PROCESSING
):
if not is_first_attempt:
self.logger.info(
Colors.BLUE("Processing build %s beta detail %s is completed\n"),
build.id,
build_beta_detail.id,
)
self.logger.info(
Colors.GREEN("Processing build %s beta detail %s is completed"),
build.id,
build_beta_detail.id,
)
return build_beta_detail

if is_first_attempt:
Expand Down Expand Up @@ -537,6 +535,8 @@ def wait_until_build_is_processed(
state are not processing anymore.
Returns updated build instance that is already processed.
"""
self.logger.info(Colors.BLUE(f"\nWait until build {build.id} and its beta details are processed"))

processing_started_at = time.time()

build = self._wait_until_build_is_processed(
Expand All @@ -545,18 +545,21 @@ def wait_until_build_is_processed(
max_processing_minutes,
retry_wait_seconds,
)
self._wait_until_build_beta_detail_is_processed(
build_beta_detail = self._wait_until_build_beta_detail_is_processed(
build,
processing_started_at,
max_processing_minutes,
retry_wait_seconds,
)

self.logger.info(Colors.GREEN("\nProcessed build and beta details are"))
self.printer.print_resource(build, True)
self.printer.print_resource(build_beta_detail, True)

return build

def _log_build_processing_message(self, build_id: ResourceId, max_processing_minutes: int):
processing_message_template = (
"\n"
"Processing of builds by Apple can take a while, "
"the timeout for waiting the processing "
"to finish for build %s is set to %d minutes."
Expand All @@ -565,7 +568,6 @@ def _log_build_processing_message(self, build_id: ResourceId, max_processing_min

def _log_build_beta_detail_processing_message(self, build_beta_detail_id: ResourceId, max_processing_minutes: int):
processing_message_template = (
"\n"
"Processing build beta detail information by Apple can take some time after "
"the build is already processed. Timeout for waiting the processing "
"to finish for build beta detail %s is set to %d minutes."
Expand Down

0 comments on commit 1ec2992

Please sign in to comment.