Running any pod command displays news updates #1961

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@lazerwalker

This is for issue #1780.

Any (non-failing, non-"--version") pod commmand will now display the title of each blog post on the CocoaPods blog tagged 'important' as a warning.

I'd imagine this should eventually display the body of each post as well, but right now they're coming through as formatted HTML; I figured just displaying the title was a good start to this to see if it's at all useful.

Similarly, right now this is using the same UI hooks and end-user experience as any warnings generated by a command. Eventually this might want to be split off from that so it can be visually distinct, but, again, I figured just getting something up and running was best.

@lazerwalker lazerwalker changed the title from Running any pod command displays news updates [#1780] to Running any pod command displays news updates Mar 29, 2014
@lazerwalker lazerwalker Running any pod command checks the blog for news
Any (non-failing, non-"--version") `pod` commmand will now display the
title of any blog post tagged 'important' as a warning.
952bc6c
Member
Kapin commented Mar 30, 2014

I feel like this would be much better suited to a plugin. However, I'll wait for others to weigh in.

Owner
alloy commented Mar 30, 2014

It is a very interesting idea at the very least!

I will have to defer being able to think about this until I have a clearer mind, though :)

/cc @irrationalfab

I'm not familiar enough with the codebase to know exactly what 'plugin' means in context of CocoaPods. I agree that where I shoved my code right now feels a bit ham-fisted; if there's a more modular way to get this sort of functionality still tied to every single pod command and included for every CocoaPods user automatically, I'm all ears!

Owner

I'm not familiar enough with the codebase to know exactly what 'plugin' means in context of CocoaPods. I agree that where I shoved my code right now feels a bit ham-fisted; if there's a more modular way to get this sort of functionality still tied to every single pod command and included for every CocoaPods user automatically, I'm all ears!

To read more about plugins you can refer to this blog post

Having said that I'm on the fence about this being implemented in a plug-in. I like the idea and I think that this feature should ship with CocoaPods. So a plug-in should be used only if it makes more sense from the architectural point of view imo (factoring out code).

One question will this display only important pods which I haven't seen or will it display all the posts every time that I run pod install. This later alternative seems the case from the my overview and I consider it less desirable.

Owner
alloy commented Apr 2, 2014

Yeah I think that if we want this a plugin isn’t really helpful, because we can pretty much assume that people won’t have the plugin installed. (Especially if they’re also not up-to-date on the blog ;))

@irrationalfab Yeah, only showing news items the user hasn't seen yet seems sensible. I'm assuming you're imagining that being scoped to the user's global CocoaPods installation rather than individual projects? e.g. if I pod install in one project on my computer and see a news item, and then switch to a different Pod-enabled project in a different directory and run it again, I won't see the same news item the second time?

Presumably, the simplest way to do that is to store a timestamp of the last item the user saw, and only show items with a later publish date. Is there any sort of precedent for where that state should be persisted? A config file in the user's ~/.cocoapods folder, perhaps?

Owner

Alternative we could display a notice for a given period of time... i.e. display only and do so for say 3 days. As this tag would be reserved to very important messages.

I think the question is what sort of important information you've historically had to disseminate. For messages like "The server's down for maintenance at this time", always displaying it for a set period of time seems like a better solution. For things like the specs repo breakage, making sure all users see it at least once seems more important.

Owner
orta commented Apr 3, 2014

Announcements would tend to orient towards

  • "Xcode 5.1 has changed something" which it did,
  • to the "Specs repo is broke"
  • to maybe even "CocoaPods now supports authentication for libraries, learn more"

I mean trunk is a major change, I don't think we've ever had planned maintenance :D

Owner

I consider this proposal very clever and interesting. However after re-reading the discussion and keeping in mind that I'm not satisfied with the current performance of CocoaPods I don't like the idea of having a synchronous network call. This could be worked around by performing the call at the end of the execution of the command. However the additional complexity (including the missing logic which handles for how much to show the notice) is a bit too much for a non core feature.

@lazerwalker: I hate to say to this to a well though contribution but I changed my opinion to not merge. I'm leaving 24h to the rest of the @CocoaPods/core team to weight in. After that I will close the PR.

👍. Seems fair / makes sense to me.

Owner
orta commented Aug 11, 2014

I trust @irrationalfab's word on the asynchronicity, and the rest of the argument is sound from my perspective. 🔥

Owner

Ok closing. Thanks @lazerwalker 🍷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment