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

Add support for provisioning profile templates #9912

Merged
merged 1 commit into from Aug 30, 2017
Merged

Add support for provisioning profile templates #9912

merged 1 commit into from Aug 30, 2017

Conversation

thelvis4
Copy link
Contributor

@thelvis4 thelvis4 commented Aug 1, 2017

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation 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.
provisioning_profile_template

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 nils), 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 work

Tests: Tests were updated to handle the new feature.

@thelvis4
Copy link
Contributor Author

thelvis4 commented Aug 30, 2017

@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.
Thank you! 🙌

Copy link
Member

@KrauseFx KrauseFx left a 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 ❤️

@KrauseFx KrauseFx merged commit 4f5200c into fastlane:master Aug 30, 2017
@thelvis4 thelvis4 deleted the provisioning-profile-template branch August 30, 2017 18:00
@fastlane-bot
Copy link

Hey @thelvis4 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.55.0 🚀

@chongj615
Copy link

Thank you, confirm fastlane sigh is now working with the template options!

@fastlane fastlane locked and limited conversation to collaborators Nov 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants