Skip to content

Conversation

segiddins
Copy link
Member

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

gem_name = (gem_spec && gem_spec.name) || File.basename(file, '.rb')
end

UI.message "- #{gem_name_lambda.call}" do
Copy link
Member

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.

@alloy
Copy link
Member

alloy commented Nov 14, 2014

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 users paste their output for us to read. E.g.

- Running Slather hooks
  - Defined at `/Library/Ruby/Gems/2.0.0/gems/Slather-1.2.3/lib/cocoapods_plugin.rb:42`

@segiddins
Copy link
Member Author

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.

  • Running Slather hooks
    • Defined at /Library/Ruby/Gems/2.0.0/gems/Slather-1.2.3/lib/cocoapods_plugin.rb:42

      Reply to this email directly or view it on GitHub.

@alloy
Copy link
Member

alloy commented Nov 14, 2014

Hmm, so what was that initial issue then? :)

@kylef Didn’t leave a motivation in his ticket #2639, but as it mentions --verbose I assumed it was for debugging purposes.

@kylef
Copy link
Contributor

kylef commented Nov 14, 2014

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 --verbose output.

@kylef
Copy link
Contributor

kylef commented Nov 14, 2014

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.

@segiddins
Copy link
Member Author

While I'm at it, I'm just going to implement #2640.

@segiddins segiddins force-pushed the seg-hooks-plugin-name branch from 62dc3ea to 626dc3c Compare November 15, 2014 01:56
@segiddins
Copy link
Member Author

Instead of simplifying things, I just decided to add a whole new feature 😜

@segiddins
Copy link
Member Author

I have no clue how my changes couldve broken the integration specs. @AliSoftware any ideas?

@AliSoftware
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@segiddins segiddins force-pushed the seg-hooks-plugin-name branch from 626dc3c to cf9d6f6 Compare November 15, 2014 19:32
@segiddins
Copy link
Member Author

@kylef can we scope this for 0.36?

@kylef kylef added this to the 0.36.0 milestone Nov 19, 2014
@kylef
Copy link
Contributor

kylef commented Nov 19, 2014

@segiddins Yes, I was already thinking this would go into 0.36.

@kylef
Copy link
Contributor

kylef commented Nov 21, 2014

Depends on #2819

@kylef kylef self-assigned this Nov 21, 2014
…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
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”
kylef added a commit that referenced this pull request Nov 22, 2014
[HooksManager] Show the name of the source for each hook that is run in verbose mode
@kylef kylef merged commit de33fb2 into master Nov 22, 2014
@kylef kylef deleted the seg-hooks-plugin-name branch November 22, 2014 12:17
@alloy
Copy link
Member

alloy commented Nov 24, 2014

@segiddins @kylef Just to be sure, the extra output is only shown in --verbose mode, right?

@kylef
Copy link
Contributor

kylef commented Nov 24, 2014

@alloy Correct, it uses UI.message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to latest CLAide Explicit plugins and plugin configuration pod install --verbose should indicate what post_install hooks it's installing
5 participants