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

Support APPLE_SILICON_MAC device class on App Store Connect Device responses #437

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

priitlatt
Copy link
Contributor

App Store Connect API has started to include devices with undocumented APPLE_SILICON_MAC device class in list devices endpoint response. Such as

{
    "data": [
        {
            "type": "devices",
            "id": "2BWA3JVC8A",
            "attributes": {
                "addedDate": "2024-03-18T23:18:33.000+00:00",
                "name": "soda mac",
                "deviceClass": "APPLE_SILICON_MAC",
                "model": null,
                "udid": "00006020-0C10A7180CC1E002",
                "platform": "IOS",
                "status": "ENABLED"
            },
            "links": {
                "self": "https://api.appstoreconnect.apple.com/v1/devices/2BWA3JVC8A"
            }
        }
    ]
}

Missing definitions for this device class can fail app-store-connect fetch-signing-files with the following error

Traceback (most recent call last):
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/cli_app.py", line 243, in invoke_cli
    CliApp._running_app._invoke_action(args)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/cli_app.py", line 184, in _invoke_action
    return cli_action(**action_args)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/action.py", line 83, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/app_store_connect/actions/fetch_signing_files_action.py", line 82, in fetch_signing_files
    profiles = self._get_or_create_profiles(
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/app_store_connect/actions/fetch_signing_files_action.py", line 199, in _get_or_create_profiles
    profiles.extend(created_profiles)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/app_store_connect/actions/fetch_signing_files_action.py", line 217, in _create_missing_profiles
    device_ids = [d.id for d in devices if d.attributes.deviceClass.is_compatible(profile_type)]
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/app_store_connect/actions/fetch_signing_files_action.py", line 217, in <listcomp>
    device_ids = [d.id for d in devices if d.attributes.deviceClass.is_compatible(profile_type)]
AttributeError: 'GracefulDeviceClass' object has no attribute 'is_compatible'

Updated actions:

  • app-store-connect fetch-signing-files

@priitlatt priitlatt marked this pull request as ready for review November 7, 2024 10:44
@priitlatt priitlatt requested a review from fran-tirapu November 7, 2024 11:11
Copy link
Contributor

@fran-tirapu fran-tirapu left a comment

Choose a reason for hiding this comment

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

🚀

@priitlatt priitlatt merged commit 42fb60b into master Nov 7, 2024
11 checks passed
@priitlatt priitlatt deleted the bugfix/apple-silicon-mac-device-class branch November 7, 2024 12:50
@priitlatt priitlatt added bug Something isn't working app-store-connect labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-store-connect bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants