-
Notifications
You must be signed in to change notification settings - Fork 89
Fix crash in xcode manager if no user is provided #919
Conversation
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.
While the code changes look good to me, I have a comment on the purpose of this method.
I would recommend instead of having a state-changing behavior inside this method, I think it would be preferable to return the apple_id
or raise an error and set @apple_id
in the initializer.
@snatchev that's a great point, setting things at initialization and not mutating is 🔑 |
Okay, we have the Right now, we only set the value during init time, as we don't have a UI/API yet to set a default Apple ID, but in the future this will be possible. Either way is fine for me. I'd propose to go ahead and merge this PR assuming this is still a problem, and create an issue to discuss this further |
I think I might not have explained my initial suggestion. Basically, I propose we have a method that returns the def apple_id(user:)
apple_id = Services.apple_id_service.apple_ids.find { |a| a.user == user } if user
if apple_id.nil?
# Think about the user flow on how this would be shown, we probably want to check
# for the existance of the Apple ID earlier, and then not even show the button,
# or make the button redirect to the Apple ID login instead
raise "No registered Apple ID found with user #{user}, make sure to add your Apple account to fastlane.ci"
end
return apple_id
end and we set I also didn't see any calls to |
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.
I totally mis-understood the purpose of this method, and my feedback is non-applicable.
LGTM!
Alright, would hit the merge button now, but @taquitos would tap on shoulder and slap on finger, please merge as soon as CI is ready again |
No description provided.