Repository navigation
[deliver] keep an explicitly set platform when a pkg is present - #30224
Conversation
iBotPeaches
left a comment
There was a problem hiding this comment.
Thanks! Take a look at this PR to see an alternative approach to the chdir so our parallel tests don't stomp on themselves - #30221
|
@anandghegde BTW one of the PR builds had failed. It caught an unrelated test stability issue we just fixed in #30225. I relaunched it to get it green. |
… specs Use an around block with Dir.mktmpdir and the block form of Dir.chdir, as in fastlane#30221, instead of a before/after chdir pair. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
|
@iBotPeaches thanks, switched the @lacostej thanks for relaunching the build. |
Move the check for whether an option was passed in, set through an environment variable or read from the config file into Configuration, next to fetch, so deliver can call options.specified?(:platform). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
There was a problem hiding this comment.
Hey @anandghegde 👋
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 🚀"
There was a problem hiding this comment.
Congratulations! 🎉 This was released as part of fastlane 2.240.1 🚀
Credit to @Loupv for the detailed report and root-cause analysis in #30213.
Checklist
bundle exec rspecfrom the root directory to see all new and existing tests passbundle exec rubocop -ato ensure the code style is validMotivation and Context
Deliver::DetectValues#find_platformsetsplatformtoosxwheneverpkgis set.pkgdefaults to any*.pkgin the current directory, so a metadata-only iOS lane run from a folder that happens to contain a pkg gets its explicitplatform: "ios"replaced withosx. deliver then creates a macOS version on the app record, skips release notes as "first version of the app", and exits 0.Resolves #30213
Description
The fix suggested in the issue (
options[:platform] ||= 'osx') doesn't work on its own:platformhasdefault_value: "ios", sooptions[:platform]is never nil and||=would never pickosx. That would break macOS uploads that rely on the pkg to infer the platform, e.g.upload_to_app_storeaftergymbuilds a pkg.Instead,
find_platformnow only infersosxfrom the pkg when the user hasn't set a platform. "Set" means passed in directly, set throughDELIVER_PLATFORM, or set in the Deliverfile, which are the non-default sourcesConfiguration#fetchreads from.The ipa branch is unchanged, and it still takes precedence when both an ipa and a pkg are present.
Testing Steps
Added
find_platformspecs indeliver/spec/detect_values_spec.rb. Each one builds realDeliver::Optionsin a temp dir that contains aMyApp.pkgorMyApp.ipa:osxplatform: 'ios'passed ->ios(fails on master)DELIVER_PLATFORM=ios->ios(fails on master)platform('ios')in Deliverfile ->iosiosI also tried the plain
||=change, and the "no platform -> osx" example fails with it.Run in a
ruby:3.3container:bundle exec rspec deliver/spec/detect_values_spec.rb: 14 examples, 0 failuresbundle exec rspec deliver: 243 examples, 0 failuresbundle exec rubocopon the two changed files: no offensesbundle exec rspecfrom the root: 7861 examples, 2 failures. Both are infastlane/spec/plugins_specs/plugin_generator_spec.rb(the generated plugin's rubocop/rake checks) and fail the same way on unmodified master in the same container.