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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spaceship] update Spaceship::ConnectAPI::User model to include delete! method #20251

Merged
merged 2 commits into from May 18, 2022

Conversation

liamnichols
Copy link
Contributor

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

I've been using fastlane and Spaceship to script some batch operations for managing our App Store Connect user access since the web-ui kind of sucks for anything other than one-off changes 馃槃

While doing so, I needed to delete some old accounts but noticed that while Spaceship::ConnectAPI::Users::API defines a delete_user method, it's not exposed on Spaceship::ConnectAPI::User model like it is for UserInvitation.

# Delete existing user
def delete_user(user_id: nil)
users_request_client.delete("users/#{user_id}")
end

Description

In this change, I define a new delete! method in an almost identical way to UserInvitation.delete!

Testing Steps

N/A

Copy link
Contributor

@lucgrabowski lucgrabowski 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 adding this :) LGTM 馃敟

spaceship/lib/spaceship/connect_api/models/user.rb Outdated Show resolved Hide resolved
@joshdholtz joshdholtz changed the title Update Spaceship::ConnectAPI::User model to include delete! method [spaceship] update Spaceship::ConnectAPI::User model to include delete! method May 18, 2022
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.

This looks great! Thank you so much for adding this 馃槉

@joshdholtz joshdholtz merged commit 2d78ca2 into fastlane:master May 18, 2022
@fastlane-bot
Copy link

Congratulations! 馃帀 This was released as part of fastlane 2.206.0 馃殌

@liamnichols liamnichols deleted the ln/delete-user branch May 18, 2022 22:16
@liamnichols liamnichols changed the title [spaceship] update Spaceship::ConnectAPI::User model to include delete! method [spaceship] update Spaceship::ConnectAPI::User model to include delete! method May 18, 2022
@fastlane fastlane locked and limited conversation to collaborators Jul 18, 2022
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

4 participants