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

Improvement: Show error message if devices are not provided on development or ad-hoc profile creation #256

Merged
merged 6 commits into from
Aug 29, 2022

Conversation

VeArnold
Copy link
Contributor

@VeArnold VeArnold commented Aug 26, 2022

When creating development and ad hoc provisioning profiles, Apple requires the existence of suitable test devices on the Apple Developer Portal.

Previous implementations did not check whether appropriate devices were included in the API call.

This lead to 409 responses from App Store Connect API Create Profile endpoint. For example a POST request to the https://api.appstoreconnect.apple.com/v1/profiles endpoint with the following content:

{
   "data":{
      "type":"profiles",
      "attributes":{
         "name":"profile name",
         "profileType":"IOS_APP_DEVELOPMENT"
      },
      "relationships":{
         "certificates":{
            "data":[
               {
                  "id":"13CO2HS7YE",
                  "type":"certificates"
               }
            ]
         },
         "devices":{},
         "bundleId":{
            "data":{
               "type":"bundleIds",
               "id":"22JL9M6NPV"
            }
         }
      }
   }
}

Results in the following response:

{
  "errors" : [ {
    "id" : "97c1dc61-f853-43c1-9996-36997eff095d",
    "status" : "409",
    "code" : "ENTITY_ERROR.RELATIONSHIP.REQUIRED",
    "title" : "Relationship is required but was not provided.",
    "detail" : "The relationship 'devices' is required but was not provided with this request.",
    "source" : {
      "pointer" : "data/relationships/devices"
    }
  } ]
}

@VeArnold VeArnold requested a review from priitlatt August 26, 2022 14:39
src/codemagic/apple/resources/enums.py Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
src/codemagic/apple/resources/enums.py Outdated Show resolved Hide resolved
@VeArnold VeArnold merged commit 58a7836 into master Aug 29, 2022
@VeArnold VeArnold deleted the improvement/disallow-empty-device-list branch August 29, 2022 09:33
@priitlatt priitlatt added the enhancement New feature or request label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants