-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[scan] fix scan regression caused by not setting slack_default_payloads
option
#17923
Conversation
Reason was just consistency. The ConfigurationHelper was pretty much only used in this file, while Configuration.create is being used in over 300+ occurrences - seems the better way to do it.
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.
Looks good, thank you for the fix. Unit tests too 馃挭馃殌
Looks good for us 馃憤 |
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.
Nice fix! I suggested how to test the change otherwise LGTM.
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.
Well done馃憤
@rogerluan thanks for fixing this. Is there an estimated time of when this will be released? :) |
Can we get this merged ASAP please? With the upcoming Feb deadline for enabling 2FA on apple developer accounts, we need this to be working. |
@mathaeus @rockshassa Hi. Sorry for the inconvenience馃檱 @joshdholtz is responsible for final checks and release a new version in the core team's flow but he is busy due to a personal circumstances at this moment馃懚 So please bear with us for a while. In the meantime, if you really need this change, you can still use this PR's branch in your project. Use below line in your Gemfile. I guess this is the best part of using an OSS project, right? 馃槢 gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "rogerluan-fix-scan-slack-integration" |
Will get this merged and released tomorrow! Sorry about that |
Thanks for the follow up @ainame and @joshdholtz. And congrats @joshdholtz 馃懚 !! |
yup, thanks for the quick response @ainame and congrats @joshdholtz ! 馃檹 |
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 love this fix! Thank you so much for another awesome contribution 鉂わ笍
Hey @rogerluan 馃憢 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 馃憤 |
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.
Congratulations! 馃帀 This was released as part of fastlane 2.172.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 #17915
Resolves #17898
This PR fixes a regression introduced in #17866
This PR supersedes #17919 (also please do read the comments there, for extra context!)
Description
By passing
nil
in scan'sslack_default_payloads
option (or omitting), then slack action (called down the road within scan) would crashes.Slack action's
default_payloads
option is non-null and has a default value. Theoretically, if you pass nil to it, it should pick up the default value and just work.However, in this very specific scenario, scan was calling the Slack action without invoking the options initializer - it was just passing a raw hash to Slack's runner. Naturally, by not invoking the options initializer, the default values wouldn't be loaded into Slack's options.
So the fix for this issue is just the first commit, where I modify how scan invokes Slack action.
The subsequent commits are meant to improve code by making it more consistent, by swapping
Fastlane::ConfigurationHelper.parse
withFastlaneCore::Configuration.create
. The former was pretty much only used in this file, while the latter is being used in over 300+ occurrences - seems just like the right way to do it 馃槉I also cleaned up the test I had written earlier.
NOTE: I'm not too happy with the changes I had to made here 3e80113 - not sure if what we had before is an anti-pattern, or if what I did is an anti-pattern, but neither looks/feels great 馃槵 I appreciate any and every feedback wrt these specs 馃檹
Testing Steps
Demo project, kindly provided by @crazymanish: Demo.zip
Before (as of master):
cd into the demo project, run
bundle install
, thenbundle exec fastlane test
. It will crash withundefined method
map' for nil:NilClass` error.Now (in this branch):
To test this branch, modify your demo project's Gemfile as:
And run
bundle install
to apply the changes.Now if you run
bundle exec fastlane test
, it will still fail, but it's because we're providing a fake slack_url 馃槆If you test this branch in your own project, it should succeed 馃憤
cc @crazymanish 馃