[deliver] Initial App Preview (video) upload support for iPhone and iPad#29831
Conversation
- add missing IPHONE_61 preview type - add video parsing util - rspec tests, deliver options - update docs and screenshots
- add missing IPHONE_61 preview type - add video parsing util - rspec tests, deliver options - update docs and screenshots
There was a problem hiding this comment.
I couldn't find an existing good gem that parses video data and didn't want to add ffmpeg as a (transitive) dependency to fastlane, therefore we have this video parser code. I'm open for suggestions if you can find something better than this 🙂
(the code is working, it's just that people might find is scary and hard to maintain)
There was a problem hiding this comment.
this loosely follows the structure of sync_screenshots.rb
There was a problem hiding this comment.
if needed, we can further reduce the size of these mock videos with gzip. But then we won't be able to directly play/preview them anymore (in Finder or any other player).
|
Nice! I don't think I have the day to day usage to test this, but I'll add Copilot to help with code review and see if I can recruit someone that works more with deliver to review this. |
There was a problem hiding this comment.
Pull request overview
This PR adds initial support for uploading localized App Preview videos for iPhone and iPad devices to App Store Connect via the deliver tool. The implementation includes video file validation, concurrent upload handling, ordering, and overwrite capabilities.
Key Changes
- New
Deliver::SyncAppPreviewsuploader with validation for size (≤500MB), duration (15-30s), and resolution - New
FastlaneCore::VideoUtilspure Ruby MP4/MOV parser for reading video metadata without external dependencies - Extended
AppPreviewSetmodel with resolution validation and filename-based device type inference - Three new CLI options:
app_previews_path,preview_frame_time_code, andoverwrite_preview_videos
Reviewed changes
Copilot reviewed 11 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| spaceship/lib/spaceship/connect_api/models/app_preview_set.rb | Added IPHONE_61 constant, validation methods for video resolution, and filename-based preview type inference |
| fastlane_core/lib/fastlane_core/video_utils.rb | New pure Ruby MP4/MOV container parser for reading video resolution and duration |
| deliver/lib/deliver/sync_app_previews.rb | New uploader class handling video discovery, validation, concurrent upload, and ordering |
| deliver/lib/deliver/runner.rb | Integration of app preview uploads into the delivery workflow |
| deliver/lib/deliver/options.rb | Added three new configuration options for app preview uploads |
| deliver/lib/deliver/detect_values.rb | Extended folder detection to include app-previews directory |
| fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb | Updated documentation to describe app preview upload feature |
| deliver/spec/* | Comprehensive test coverage for new functionality including edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks for checking this out! The PR is ready for review if you can find someone willing to have a look 🙂 |
|
Hey @iBotPeaches, any news on adding this on someones review radar? |
|
Apologies - I've had no bites. I was trying to get eyes for both this and the other larger app clips PR - #29738 |
|
I would love for this to be merged 👀 |
|
hey @iBotPeaches, any chance that you or one of our fastlane friends can have a look at this? (I checked #29738 and that's tackling a different problem) |
|
So here is my plan. I want to review this again a bit more slowly and figure out how isolated this change is. If we are pretty confident that these changes are isolated to the people opting into this new feature - that would be swell. At that point, much like some other tools, we evolve it in releases as folks opt in. So we could merge as-is. My fear is some cross contamination breaks something else so need to confirm that. |
iBotPeaches
left a comment
There was a problem hiding this comment.
I reviewed this + Copilot. Its opt-in, and no code paths seem to cross for those not opting into it. Managing our own tiny video code is probably a pita, but better than requiring ffmpeg.
Going forward with merge.
There was a problem hiding this comment.
Hey @ccaruceru 👋
Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a month, and your PR will be included in the next one.
Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀"
|
Thanks a lot for the speedy review! I'll start using the master (or next release) version and keep an eye on this feature, but after I come back from holiday (2-3 weeks). |
There was a problem hiding this comment.
Congratulations! 🎉 This was released as part of fastlane 2.233.0 🚀
Checklist
bundle exec rspecfrom the root directory to see all new and existing tests passbundle exec rubocop -ato ensure the code style is validci/circlecibuilds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
This adds initial support for uploading localized App Preview videos with
deliverfor iPad and iPhone, which includes validation, ordering, and overwrite handling.Related to #19948, #15515, #15879, #14535, #9775
Description
In this PR:
deliverapp_previews_pathto point to localized App Preview videos.preview_frame_time_codeto set the still frame (default: 00:00:05:00 like on ASC).overwrite_preview_videosto clear existing previews before upload.Deliver::SyncAppPreviewsapp-previews/<locale>/..mp4,.mov,.m4v.IPHONE_67_*.mp4).FastlaneCore::QueueWorker.fastlane_coreFastlaneCore::VideoUtils: pure Ruby parsing of MP4/MOV container headers to read resolution and duration.spaceshipAppPreviewSet:PreviewType::IPHONE_61.validate_video_resolution(width, height)for accepted portrait resolutions. Currently for iPhone and iPad.preview_type_from_filename(name)to infer preview type from a filename token. Currently for iPhone and iPad.deliverdocs to include App Preview uploads, usage, and folder structure.Future work
fastlane deliver download app-previewscommand and support forfastlane deliver initTesting Steps
mkdir -p fastlane/app-previews/en-USen-USfolder that have the device type in their filename (seeAppPreviewSet)generate video
[bundle exec] fastlane deliver [...]- should upload videos and skip existing on second run[bundle exec] fastlane deliver [...] --overwrite_preview_videos true- should always upload from scratch[bundle exec] fastlane deliver [...] --preview_frame_time_code 00:00:10:00- should additionally set the preview frame to 10s