Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: review submission creation error handling #236

Merged
merged 4 commits into from
Jun 1, 2022

Conversation

priitlatt
Copy link
Contributor

Action app-store-connect builds submit-to-app-store relies on creating ReviewSubmission resource for Build on App Store Connect.

As there can only be one review submission associated with any single build, then there is a graceful error handling for review submission creation that checks whether the creation request failed with error saying there already exists review submission for this build.

The check for such error is faulty as it does not check whether such an error exists, but rather whether there are any errors at all. And then None value is possibly treated as a re.Match instance. Stacktrace:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/codemagic/tools/_app_store_connect/action_groups/builds_action_group.py" line 215 in submit_to_app_store [args] [locals]
    return self._submit_to_app_store(
File "/usr/local/lib/python3.8/site-packages/codemagic/tools/_app_store_connect/action_groups/builds_action_group.py" line 259 in _submit_to_app_store [args] [locals]
    review_submission = self._create_review_submission(app, platform)
File "/usr/local/lib/python3.8/site-packages/codemagic/tools/_app_store_connect/action_groups/builds_action_group.py" line 290 in _create_review_submission [args] [locals]
    existing_review_submission_id = ResourceId(existing_submission_matches[0].group(1))
AttributeError: 'NoneType' object has no attribute 'group'

To fix it, find first error whose message matches the predefined pattern and use that one to obtain the existing review submission, or fail the action normally with AppStoreConnectError as expected.

Updated actions

  • app-store-connect builds submit-to-app-store

@priitlatt priitlatt added the bug Something isn't working label Jun 1, 2022
@priitlatt priitlatt marked this pull request as ready for review June 1, 2022 14:32
@priitlatt priitlatt merged commit 22c42d6 into master Jun 1, 2022
@priitlatt priitlatt deleted the bugfix/review-submission-creation-error-handling branch June 1, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant