-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[HooksManager] Show the name of the source for each hook that is run in verbose mode #2830
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
Conversation
gem_name = (gem_spec && gem_spec.name) || File.basename(file, '.rb') | ||
end | ||
|
||
UI.message "- #{gem_name_lambda.call}" do |
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 string is always interpolated, regardless of whether or not the string will be used, so this always runs.
While I can appreciate the beauty of just a gem’s name, this will only be printed in verbose mode and verbose mode is meant to be able to easily find issues. So while the gem’s name helps a bit, it doesn’t help people that have a hard time figuring out where (on disk) that means an issue might lie. So how about just printing the full info from
|
Sure, that just wasn't in the initial issue :) -Samuel E. Giddins On Nov 14, 2014, at 1:20 AM, Eloy Durán notifications@github.com wrote: While I can appreciate the beauty of just a gem’s name, this will only be printed in verbose mode and verbose mode is meant to be able to easily find issues. So while the gem’s name helps a bit, it doesn’t help people that have a hard time figuring out where (on disk) that means an issue might lie. So how about just printing the full info from source_location instead? This means there is no time spent on finding gem names and should make things easier to debug, also when user's paste their output for us to read. E.g.
|
My motivation was purely debugging purposes. Having a strange issue where a CocoaPods plugin wasn't being fired properly on Travis and was a little difficult to figure out why. This would make it clear if the hook was registered and executed with |
I think I agree with @alloy, this can be simplified quite a bit by printing the path instead of the gem name. I initially used gem name in the existing issue because I though it would be easy to get until I looked into this. The path might even be preferred because it shows you the version and the exact location of the plugin if multiple versions are installed. |
While I'm at it, I'm just going to implement #2640. |
62dc3ea
to
626dc3c
Compare
Instead of simplifying things, I just decided to add a whole new feature 😜 |
I have no clue how my changes couldve broken the integration specs. @AliSoftware any ideas? |
Please not again! 😭 😭 I just passed hours fixing them last night… Your turn now! 😉 |
@@ -6,6 +6,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre` | |||
|
|||
## Master | |||
|
|||
##### Enhancements | |||
|
|||
* Show the name of the source for each hook that is run in verbose mode. |
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 should include the fact we only run the hooks for plugins defined in Podfile. I think we should show an example of how you would do this.
Perhaps this is now a breaking change as it breaks previous behaviour (like sources?
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.
agree on breaking, considering how few plugins use the hooks right now we could list all the known ones in there.
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.
Yeah I just never added a changelog entry.
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.
Added.
626dc3c
to
cf9d6f6
Compare
@kylef can we scope this for 0.36? |
@segiddins Yes, I was already thinking this would go into 0.36. |
Depends on #2819 |
…in verbose mode Huge thanks to @alloy for the `source_location` hint! The name calculation is wrapped in a lambda so it's not called when it won't be printed out
c10976c
to
24cc2d8
Compare
We're incorrectly comparing the hook name instead of the plugin name in the whitelist
“Register slather for post install” vs “Register for post install slather”
064cf20
to
099e338
Compare
[HooksManager] Show the name of the source for each hook that is run in verbose mode
@segiddins @kylef Just to be sure, the extra output is only shown in |
@alloy Correct, it uses |
Closes #2639.
Closes #2640.
Closes #2819.
Depends upon CocoaPods/Core#196.
Huge thanks to @alloy for the
source_location
hint! (feel free to say this all is too gross to include)\c @kylef would appreciate some help making sure this is a robust solution