-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor ios_check_beta_deps
action to make it more resilient & detect Pods referenced by commit/branch
#557
Conversation
Allow detection of Pods referenced by commits and branches Make detection more resilient by using Podfile.lock instead of Podfile
ios_check_beta_deps
action to make it more resilientios_check_beta_deps
action to make it more resilient & detect Pods referenced by commit/branch
lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb
Outdated
Show resolved
Hide resolved
non_stable_pods = {} # Key will be pod name, value will be reason for flagging | ||
|
||
# Find pods referenced by commit and branch to a repo | ||
yaml['EXTERNAL SOURCES'].each do |pod, 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.
I just realized that some Podfile.lock
files might not have this section at all (if they don't have any external dependency), so better cover for the nil
case.
yaml['EXTERNAL SOURCES'].each do |pod, options| | |
yaml['EXTERNAL SOURCES']&.each do |pod, options| |
Ideally we should add a spec example to cover that too—the one from Simplenote-macOS can serve as a fixture for that case.
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.
@spencertransier I've fixed this (and added test coverage for it) via dc5992f + b1a13d9, so PR is now ready for review again 🙇
ALL_PODS_STABLE_MESSAGE = 'All pods are pointing to a stable version. You can continue with the code freeze.'.freeze | ||
NON_STABLE_PODS_MESSAGE = "Please create a new stable version of those pods and update the Podfile to the newly released version before continuing with the code freeze:\n".freeze |
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.
Why declare these constants here instead of at the top of the run
method?
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.
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.
While we couldn't move them at the top of the run
method, I've moved them at the top of the class
definition in 25420dd, at least
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.
Ah, got it. Thank you!
Generated by 🚫 Danger |
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 refactor and tests look great to me. The logic makes sense and this will be a huge improvement to the code freeze automation. 👏
And move test about invalid regex closer to other regex-related tests
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.
With tests, too 👨🍳 💋
ALL_PODS_STABLE_MESSAGE = 'All pods are pointing to a stable version. You can continue with the code freeze.'.freeze | ||
NON_STABLE_PODS_MESSAGE = "Please create a new stable version of those pods and update the Podfile to the newly released version before continuing with the code freeze:\n".freeze |
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.
Nitpick. These messages assume the action runs as part of the code freeze. That is true in practice, and the action name sort of suggests it, too. Still, I'd suggest removing the code freeze mention to make it agnostic.
regex = begin | ||
Regexp.new(version_pattern) | ||
rescue RegexpError | ||
UI.user_error!("Invalid regex pattern: `#{version_pattern}`") |
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.
Side note. I wanted to share appreciation for this kind of error handling where the things that's wrong is clearly reported in the error message. Recently, I've bump my head against some vague error messages; seeing this is encouraging. Thanks!
What does it do?
Note
See discussion in p1712630806132789-slack-CC7L49W13
-beta
, but not pods referenced by commit/branch)Podfile.lock
instead of thePodfile
, thus addressing Makeios_check_beta_deps
usePodfile.lock
#216buildkite_annotate(message: result[:message])
to make the warning more visible in Buildkite.Testing
Gemfile
ofwoocommerce-ios
to point therelease-toolkit
to this branchbundle install && bundle exec fastlane run ios_check_beta_deps
Podfile.lock
wordpress-ios
repo, and got a green light:Checklist before requesting a review
bundle exec rubocop
to test for code style violations and recommendationsspecs/*_spec.rb
) if applicablebundle exec rspec
to run the whole test suite and ensure all your tests passCHANGELOG.md
file to describe your changes under the appropriate existing###
subsection of the existing## Trunk
section.MIGRATION.md
file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.