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
Add support for provisioning profile templates #9912
Add support for provisioning profile templates #9912
Conversation
@KrauseFx Is there anything I could help with in order to progress with this PR? @Fluzzarn, @chongj615, @wilrnh If you have an Apple Developer account supporting templates (extended entitlements), it would be very helpful if could give a try to this PR and let us know whether this works for your setup or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @thelvis4, thanks for this great PR, I love the updated docs & all the tests. I haven't tested this on my actual account, but the code looks great, let's see where this is going 🚀
Thanks for your contribution ❤️
Hey @thelvis4 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.55.0 🚀 |
Thank you, confirm fastlane sigh is now working with the template options! |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
Some developer accounts (not all) have assigned templates for provisioning profiles. Because not all accounts have templates assigned, there is just a niche of Fastlane users that will need this feature, but they will need it badly. Without it, they cannot generate, repair or update template-based provisioning profiles.
What is a provisioning profile template?
I couldn't find any official documentation about templates, but from my understanding, a template defines a set of extended entitlements (entitlements that couldn't be set from Xcode or by managing an App ID in Developer Portal) the app will support.
How does this look in Developer Portal?
For the accounts that have assigned provisioning profile templates, when creating or editing a provisioning profile, there will be an additional field called Entitlements.
Issues and other PRs
Issues: #9558 (thanks to https://github.com/Fluzzarn for the idea behind this solution), #9227, #4548, #3471
Other PR: #9649
I noticed there is another PR that addressed the same problem when I almost finished the work on this. I decided to open this PR because it adds support for repairing and updating (additionally to generating) template based provisioning profiles.
Testing
This was tested by creating and repairing provisioning profiles for iOS and tvOS apps using Sigh.
Not tested for macOS (not even sure if it's applicable).
If someone could test this in other contexts (using Match, for example), it will be greatly appreciated!
Description
This PR touches Spaceship, Sigh and Match.
Spaceship: Added
template
to the list of parameters sent to Dev Portal API when creating and updating a provisioning profile.If the data about a template-based profile doesn't contain the data about the template (usually it's a dictionary with only
nil
s), we have to make an additional API request and fetch all the data about the profile. If the profile contains needed data, that data is used to initialize provisioning profile template model. This logic was also documented in the code.Sigh, Match: Added the optional
template_name
option. Other than that, Sigh and Match just redirect the calls to Spaceship, which does all the workTests: Tests were updated to handle the new feature.