-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[regression][pilot] Fix upload using api_key_path + apple_id
input options
#18771
Conversation
Ubuntu failing unit-tests is so random and created little noise in this PR git-commits 😅 |
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.
Thanks for making this fix! This does fix it but I think the root of this issue is that the login
method isn’t being called after any of the Pilot::BuildManager.new
calls 🤔 in https://github.com/fastlane/fastlane/blob/master/pilot/lib/pilot/commands_generator.rb
I think if we add the login
call that this should fix the issue without duplicating any code for the token creation 🤷♂️ Thoughts?!
Yes, |
pilot/lib/pilot/build_manager.rb
Outdated
# Ensure that `Spaceship::ConnectAPI.token` is set correctly, if required | ||
login |
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.
Instead of here, I am thinking can we start upload with login
always in this line?
# from this...
# Only need to login before upload if no apple_id was given
# 'login' will be deferred until before waiting for build processing
should_login_in_start = options[:apple_id].nil?
start(options, should_login: should_login_in_start)
# to this...
start(options, should_login: true)
# If we go with approach then the login code will be in one place and maintenance will be easy too...
# I also notice, Deliver always do login on start so it will bring consistency too 😇
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 deleted my thought because it was in your comment 😛 I’m going to make that change, push it out, and release it!
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 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 ℹ️ Googlers: Go here for more info. |
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 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 ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
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.
This is 🔥 now! Took a lot to get here but thank you for working through this ❤️
# Ensure that user is authenticated | ||
start(options) |
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.
Hi @joshdholtz
I think, this will not perform login and will early exit in this line see here
because
@ config
is already set by the upload
method without login when apple_id is given
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.
Congratulations! 🎉 This was released as part of fastlane 2.185.0 🚀
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
api_key_path + apple_id
input optionsMore details:
apple_id
input option is given...please see hereapi_key_path
input param does not setSpaceship::ConnectAPI.token
same as app_store_connect_api_key actionNow, the problem is: When pilot is trying to upload binary, there is no Token for ItunesTransporter, and pilot is not trying to generate a new token using the given
api_key_path
input option which is exactly happening in #18767and
User doesn't see this problem when apple_id not given because in that case, pilot
always do login
and sets theSpaceship::ConnectAPI.token
at the starting itself...see hereDescription
Testing Steps
bundle install
with