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
Fix issue that uploading aab with mapping file #12856
Fix issue that uploading aab with mapping file #12856
Conversation
# Only update tracks if we have version codes | ||
# Updating a track with empty version codes can completely clear out a track | ||
update_track(apk_version_codes) unless apk_version_codes.empty? | ||
return [client.upload_bundle(aab_path)] |
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.
Isn't updating tracks still necessary here? (Random drive by comment, but I'm curious as to why this function differs from the logic in the newly split upload_apks)
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.
Same thoughts/concern there ^
@tmtrademarked Thanks for drive by commenting 😊
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.
The original logic sequence is below.
If uploading binary is apks
- Upload apks
- Upload mapping files
- Update track
- Upload bundle (not executed)
- Update track (not executed because of empty apk version codes)
If uploading binary is bundle
- Upload apks (not executed)
- Upload mapping (error caused by empty apk version codes)
- Update track (not executed because of empty apk version codes)
- Upload bundle
- Update track
Update track should be executed after upload apks or bundle and only once.
So, I split upload mapping and updating track function to execute after uploading both apk and bundle.
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.
After fixing,
- Upload apks if upload type is apks
- Upload bundle if upload type is bundle
- Upload mapping
- Update track
I think that uploading logic order is not changed 😃
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.
@chibatching Thanks for the explanation! I think the confusing thing was this diff removed update_track
but never re-added it in back in. But looking at the whole file it looks like it its actually in the upload_mapping
method - https://github.com/chibatching/fastlane/blob/49e2b1d6373efe9156ad7a3ad82932c043bf30fc/supply/lib/supply/uploader.rb#L146-L148
Thoughts on moving that to line 30 under the call to upload_mapping
? I think that would make things easier to follow in this file since I don't think it has anything to do with mapping 😊
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.
Thank you comments and I agree with you 😄
I fixed at b7e91f0!
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.
@joshdholtz Could you review this?
# Only update tracks if we have version codes | ||
# Updating a track with empty version codes can completely clear out a track | ||
update_track(apk_version_codes) unless apk_version_codes.empty? | ||
return [client.upload_bundle(aab_path)] |
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.
Same thoughts/concern there ^
@tmtrademarked Thanks for drive by commenting 😊
supply/lib/supply/uploader.rb
Outdated
return apk_version_codes | ||
end | ||
|
||
def upload_binaries(apk_version_codes) |
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.
Can we rename this to upload_mapping
? "mapping" seems more appropriate then "binary" here 🙃
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 fixed at 49e2b1d 😃
# Only update tracks if we have version codes | ||
# Updating a track with empty version codes can completely clear out a track | ||
update_track(apk_version_codes) unless apk_version_codes.empty? | ||
return [client.upload_bundle(aab_path)] |
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.
@chibatching Thanks for the explanation! I think the confusing thing was this diff removed update_track
but never re-added it in back in. But looking at the whole file it looks like it its actually in the upload_mapping
method - https://github.com/chibatching/fastlane/blob/49e2b1d6373efe9156ad7a3ad82932c043bf30fc/supply/lib/supply/uploader.rb#L146-L148
Thoughts on moving that to line 30 under the call to upload_mapping
? I think that would make things easier to follow in this file since I don't think it has anything to do with mapping 😊
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 looks great! Thanks for making those changes 😊
Hey @chibatching 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.101.0 🚀 |
Fixes #12900
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
When I uploaded app bundle file with mapping.txt, I got error
Google Api Error: Invalid request
.This is caused that supply upload mapping.txt before app bundle file.
I tested this PR with lane to supply app bundle and mapping file and got successfully upload.
Description
At
upload_binaries
, upload apks and mapping.txt after thatupload_bundles
would upload aab file.But when we upload aab and mapping file,
apk_version_codes
is not supplied yet.So, we have to upload mapping file after both apks uploadind and aab uploading.
I split
upload_binaries
to apk upload and mapping upload. And call mapping upload process after apk and aab uploading.