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

Fix: deprecate fields for App Store Connect App resource #392

Conversation

artemii-yanushevskyi
Copy link
Contributor

@artemii-yanushevskyi artemii-yanushevskyi commented Jan 18, 2024

Listing applications now fails due to the deprecation of the following fields from App Store Connect App data structure:

Details

Exception traceback for deprecated attribute
[14:59:14] ERROR > Exception traceback:
Traceback (most recent call last):
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/cli_app.py", line 243, in invoke_cli
    CliApp._running_app._invoke_action(args)
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/cli_app.py", line 184, in _invoke_action
    return cli_action(**action_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/action.py", line 83, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/tools/app_store_connect/action_groups/apps_action_group.py", line 82, in list_apps
    return self._list_resources(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/tools/app_store_connect/mixins/resource_manager_mixin.py", line 84, in _list_resources
    resources = list_resources(resource_filter=resource_filter)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/app_store_connect/apps/apps.py", line 61, in list
    return [App(app) for app in apps]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/app_store_connect/apps/apps.py", line 61, in <listcomp>
    return [App(app) for app in apps]
            ^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/resources/resource.py", line 236, in __init__
    self.attributes = self._create_attributes(api_response)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/resources/resource.py", line 221, in _create_attributes
    return cls.Attributes(**defined_fields)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: App.Attributes.__init__() missing 1 required positional argument: 'availableInNewTerritories'
Exception traceback for deprecated relationships
[15:00:42] ERROR > Exception traceback:
Traceback (most recent call last):
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/cli_app.py", line 243, in invoke_cli
    CliApp._running_app._invoke_action(args)
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/cli_app.py", line 184, in _invoke_action
    return cli_action(**action_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/cli/action.py", line 83, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/tools/app_store_connect/action_groups/apps_action_group.py", line 82, in list_apps
    return self._list_resources(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/tools/app_store_connect/mixins/resource_manager_mixin.py", line 84, in _list_resources
    resources = list_resources(resource_filter=resource_filter)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/app_store_connect/apps/apps.py", line 61, in list
    return [App(app) for app in apps]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/app_store_connect/apps/apps.py", line 61, in <listcomp>
    return [App(app) for app in apps]
            ^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/resources/resource.py", line 238, in __init__
    self.relationships = self._create_relationships(api_response)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/artemii/codemagic/cli-tools/src/codemagic/apple/resources/resource.py", line 230, in _create_relationships
    return cls.Relationships(**defined_fields)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: App.Relationships.__init__() missing 2 required positional arguments: 'availableTerritories' and 'prices'

QA

✅ Application listing works as expected

(codemagic-cli-tools-py3.11) artemii@Artemiis-iMac cli-tools % python -m codemagic.tools.app_store_connect apps list --app-name "Manifesto"
Found 1 App matching specified filters: name=Manifesto.
-- App --
Id: 6474964435
Type: apps
Bundle id: io.codemagic.Manifesto
Name: Manifesto Generator
Primary locale: en-US
Sku: io.codemagic.Manifesto
Is or ever was made for kids: False

@artemii-yanushevskyi artemii-yanushevskyi marked this pull request as ready for review January 18, 2024 13:29
Copy link
Contributor

@mohammedbabelly20 mohammedbabelly20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@artemii-yanushevskyi artemii-yanushevskyi merged commit 040b4ab into master Jan 18, 2024
7 checks passed
@artemii-yanushevskyi artemii-yanushevskyi deleted the fix/deprecate-fields-for-app-store-connect-app-resource branch January 18, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants