abbysmal / Canopy

A git-blogging unikernel written using MirageOS
ISC License
120 stars 27 forks source link

feature request: recent activity #72

Closed hannesm closed 1 year ago

hannesm commented 8 years ago

there should be an atom feed (and/or html page) describing recent activity. data can be harvested via the commits (just needs some article option -> article option -> html/atom function afaics)

help is welcome (I won't have time to do that)

gjaldon commented 8 years ago

@hannesm I'd like to take this on. Where do you see the article option -> article option -> html/atom function being implemented?

I'm initially thinking of implementing it this way:

Will probably limit the activity list to the 10 latest commits/activities. WDYT? What did you have in mind for the content in this recent_activity page/feed?

hannesm commented 8 years ago

Great to hear!

I think this sounds good: recent_activity and recent_activity.atom (please not /atom/XXX, we might want to populate that later with atom feeds filtered by tag(s)).

10 or 20 items sounds good to me, in Canopy_store.fill_cache you already iterate over all the commits, and this is where I'd also cache the recent activity feed: before adding to the KeyMap, do a diff (where the diff needs to be implemented using roughly the signature mentioned above:

The html/atom should denote that we want to have one function which generates the content diff, and use that both for the html and for the atom case (obviously, start with either html or atom first, once that works, we can move stuff around). I'd expect that function to life in Canopy_content, calling out to Canopy_article.

gjaldon commented 8 years ago

Looks like Canopy_store.fill_cache only iterates on every file that's in the repo but not every commit. How to iterate through every commit using Irmin? Or should I use Irmin for that?

I found an article which I think might help. Not sure if I'm on the right track though.

hannesm commented 8 years ago

oh, you're right... likely somewhere hidden in here: http://docs.mirage.io/odoc/irmin/Irmin/index.html -- sorry, haven't yet used a fold/iter over the commits.. or further down http://docs.mirage.io/odoc/git/Git/index.html -- the Store.History (in Canopy_store) should have some functionality for this

gjaldon commented 8 years ago

Thanks to @samoht's help in the mirage-devel's mailing list I'm no longer stuck but need some advice on how to move forward.

So fill_cache iterates over every file in the HEAD of master(or some other remote branch specified in the remote git url). We walk through the history of commits in Canopy_store.created_updated_ids(specifically the aux fun) to get the create and update times of each file in HEAD of master. So we are unable to find out if a file was deleted or moved unless we make a bunch of changes to how fill_cache/created_updated_ids work.

I'm thinking of doing the ff:

What do you think?

gjaldon commented 8 years ago

Without any changes, compiling suddenly fails for me today with the following errors: https://gist.github.com/gjaldon/1564596a68371d5625dbfd21ce0eac66

What could have caused this? I tried doing make clean and then make again but that did not change things. Could doing an opam install package affect the building of this package?

hannesm commented 8 years ago

as mentioned on IRC, the error is due to line 100 in canopy_store... irmin 0.10 needs a value >>= fun content here, where irmin 0.11 requires value () >>= fun content. unfortunately we're not yet able to express version constraints in config.ml...

hannesm commented 1 year ago

As written in other issues, I moved on to using a static site generator and unipi. Thanks for all the work.