-
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
[fastlane_core] use randomly generated filename(s) for -assetFile when uploading binaries to Testflight/App Store #19716
Conversation
…aries with non-alphanumeric filename to Testflight/App Store
[deliver][pilot] use copied ipa/pkg for -assetFile when uploading binaries with non-alphanumeric filename to Testflight/App Store
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 did not realize this side effect 😱 I'm sorry for the issue!
I think instead of changing this in deliver and pilot, we could probably change this in https://github.com/fastlane/fastlane/blob/master/fastlane_core/lib/fastlane_core/itunes_transporter.rb#L504-L506
tmp_asset_path = File.join(Dir.tmpdir, File.basename(asset_path))
to
require 'securerandom' # place at top of file
new_file_name = "#{SecureRandom.uuid}#{File.extname(asset_path)}"
tmp_asset_path = File.join(Dir.tmpdir, new_file_name)
I didn't run this but I think this should do it 🙃
@joshdholtz Thanks for the comment! I'll take this change and test to see how it changes the behavior in |
@dokimyj Perfect! Let me know if you need anything from me 😊 Thanks! |
[test] fl-suggestion
Changed Fastlane core part instead(itms transporting portion) and it works perfect! It seems far more clear & works perfect! Logs for `upload_to_testflight`
and Thanks for correcting tests! I thought I gotta change the code to work only when non-alphanumeric filename comes. |
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 finding this issue and debugging this! Excited to get this one out 😊
Congratulations! 🎉 This was released as part of fastlane 2.200.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
Resolves #19708
When trying to upload ipa file to Testflight / App Store, the upload process fails if the name of the ipa file is in multibytes.
(The error message shows the name of the ipa/pkg file as blank.)
You can reproduce the error by building your app with
output_name: <multibytechar>.ipa
and trying uploading it to Testflight / App Store.This changed behavior would make deliver/pilot use .ipa/.pkg derived from
copy_ipa/copy_pkg
methods, which will be found from thepackage_path
:.itmsp
.If there is no
.ipa
/.pkg
file in.itmsp
path, deliver/pilot will useupload_ipa
/upload_pkg
as is.copy_ipa
copy_pkg
Description
SecureRandom
to randomize the name of asset file(s) to be uploaded.asset_path
exists and.itmsp
is not forced.Acceptance test result: #19716 (comment)
Obsolete explanations (for fixing deliver/pilot collectively)
deliver/runner.rb
, replaced the value of variableipa_path
/pkg_path
with the one(s) in theitmsp
file.pilot/build_manager
, replaced the value of variableoptions[:ipa]
/options[:pkg]
the same way above.upload_ipa
/upload_pkg
, not to change the values inside the hashoptions
.options[:ipa/pkg]
values if there is no file forasset_file
in.itmsp
.I tested the way I could reproduce the problem the related issue undergone, and succeeded
upload_to_testflight
.Testing Steps
bundle exec rspec fastlane_core