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

[spaceship] Add ability to create a beta group to Spaceship #16180

Merged
merged 2 commits into from Mar 18, 2020

Conversation

chrisjwindisch
Copy link
Contributor

@chrisjwindisch chrisjwindisch commented Mar 17, 2020

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

The Spaceship::TestFlight::Group endpoint is no longer being maintained since the conversion to the ConnectAPI. As a result there's no way to create beta groups for test flight using Spaceship.

#15810
Though I couldn't find documentation, the method Spaceship::ConnectAPI::App.find("YOUR_BUNDLE_ID").get_beta_groups works to list the groups, but you can't create a new group, which is what this commit enables.

Description

I've created a method that creates a beta test group for TestFlight.

To do this, I've added a create_beta_group() method to the Spaceship::ConnectAPI::App object which calls another new method called Spaceship::ConnectAPI::create_beta_group(), which makes a post request to https://api.appstoreconnect.apple.com/v1/betaGroups
(https://developer.apple.com/documentation/appstoreconnectapi/create_a_beta_group#http-body)

The group_name must be provided, publicLinkEnabled defaults to false, publicLinkLimit defaults to the max of 10_000, publicLinkLimitEnabled defaults to false. I'm not sure these are the right defaults, please give me your feedback if I should change them.

Finally, I've added a test case and fixture to stubb the api call.

Note: I did not update any documentation. If there's a place to show examples for Spaceship please point me to it and I'll update it.

I've added a test case that can be run with

bundle exec rspec spaceship

The easiest way to test it on an actual app is from the spaceship playground. From your app's project directory run:

bundle exec fastlane spaceship

From the resulting prompt run:

Spaceship::ConnectAPI::App.find("YOUR_BUNDLE_ID").create_beta_group(group_name: "New Test Group")

You can verify the group was created from the Apple Developer portal by:

  1. Navigate to https://appstoreconnect.apple.com/
  2. Click My Apps
  3. Click the app corresponding to YOUR_BUNDLE_ID
  4. Click "TestFlight" from the navigation menu
  5. Verify "New Test Group" was created as seen under "Testers & Groups" in the left sidebar.

You can also check that the group was created from the spaceship playground:

Spaceship::ConnectAPI::App.find("YOUR_BUNDLE_ID").get_beta_groups

Testing Steps

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@chrisjwindisch
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@janpio janpio changed the title Add ability to create a beta group to Spaceship [spaceship] Add ability to create a beta group to Spaceship Mar 17, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@joshdholtz
Copy link
Member

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! I added a commit to change the name of the arguments to be named with _. Appreciate the contribution ❤️

@joshdholtz joshdholtz merged commit f24b542 into fastlane:master Mar 18, 2020
@fastlane-bot
Copy link

Hey @chrisjwindisch 👋

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 🚀

Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

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

@fastlane fastlane locked and limited conversation to collaborators May 23, 2020
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