How do you keep track of the current events in your favourite OSS project?
Do you read commit messages? Even better: ChangeLogs? Did you ever wish ChangeLogs were to be aggregated into one big file?
Or an easy to browse archive?
Well, yeah, that's what ChangeBLogger is all about. ;-)
What does it look like?
Well, just visit the OpenGroupware.org ChangeBLog ...
Status
Everything works as expected. Codewise the changelogparser.py is far from perfect, especially the date parsing sucks big time.
The date parsing is far too badly coded, but I didn't expect it to get so complicated. It's probably
a better idea to write an own parser than to reuse the built-in modules. However, it works for OGo so
there's no direct need to do it at the moment. Anybody wanting to clean this mess up, here's an opportunity to become famous instantly!
Well, sort of. ;-)
Plan
Speed is a minor issue, but our system resources aren't exhausted at the moment so it's nothing we
really need to worry about.
Overview
Because this thing is rather a hacque™ than a sophisticated program, in order to use it for your
projects you need to adjust the config.py and the programs as well.
Basically, config.py describes some locations (filesystem paths and URLs) where to put things and where to find them.
Also, it contains the paths to the ChangeLogs you want to aggregate into an archive (or into an RDF feed or whatever you like).
Then, there's a couple of scripts:
changelogparser.py
Python library for parsing the ChangeLogs. Also, it provides a couple of functions which are shared by
some of the scripts.
clindexer.py
This script scans all ChangeLog entries from config.py and creates Python code on stdout (index.py).
This index is currently used by the clhtml_archive.py and clhtml_month.py scripts.
clhtml_archive.py
Generates a shell script on stdout that will create the whole archive.
clhtml_month.py
Generates an HTML page in the archive for the specified year and month (command line parameters).
clrdf.py
Generates an RDF feed of the 15 most recent entries on stdout.
Also, for use with OGo, there's an ogocl.css style sheet which is used by the HTML created by clhtml_month.py. This
style sheet is basically a rip-off from COREBlog's CSS. Atsushi Shibata <shibata@webcore.co.jp> was kind enough to grant us permission to use it for OGo. Either you ask
him if you could use it in your project as well or you design your own - it's up to you of course.
How to use ...
All stuff has to be put in one directory. Now, open config.py in your texteditor of choice (vi I bet) and adjust
the settings. If you're done, the following should work:
./clindexer.py > index.py
./clhtml_archive.py > create_archive.sh
chmod 755 create_archive.sh
./create_archive.sh
I don't have any specific recommendations how you should integrate this whole mechanism in your project. Because the archive
generation works on a checked out copy of your project, you can create archives for developer snapshots, releases, tagged versions etc.. All you
need to do is to provide a config.py and index.py for each purpose. Python is flexibel when it comes to search pathes, so you can write small additional scripts to adjust these paths.
Because old archive pages contain links to newer archive pages, with every new month the whole archive has to be rebuilt. Please note that
there already has to be a ChangeLog entry in this new month, otherwise clindexer.py will have no entry for the month; a cronjob simply
won't do.
If you don't like the generated HTML you'll have to dig in clhtml_month.py. It's fun, so I'll recommend it! ;-)
Afterthoughts
While the overall result is even better than I anticipated, the code is a bit quirky.
First of all, well, the naming of the scripts is pretty bad. I more or less felt that
I was writing a proof of concept, not a really useful bunch of scripts. Helge added requests in a row while I was just
writing the parser and the accompanied print utility, so there was no real design phase. Also, there are no custom classes, it's
all a bunch of arrays and dictionaries - rather messy. If someone feels like rewriting this I'd understand it. However, it just
works, and I don't need it any better designed at the moment.
The most important thing: Who had the idea?
hh: hatte ich eigentlich die Idee zum ChangeBlogger?
oder warst du das?
;-)
znek: weiss nicht mehr
ich glaube, ich wollte das für commit messages machen
und du meintest dann changelogs
aber die idee mit dem blog war von mir
hh: ok
ehre wem ehre gebuerht
znek: der code ist übrigens auch von mir
hh: gebrueht meine ich
ach der code ist doch egal
znek: von dir ist mal wieder nur ganz wenig
hh: na klar, ich habe den "fertile ground" geschaffen
znek: ausser rummeckern und rumkommandieren
hh: ohne *MEIN* Staropramen haettest du das nie hinbekommen
znek: ;(
;-)
In summary: probably Helge had the brilliant idea to use a BLog format
for ChangeLogs, but neither ZNeK nor Helge do remember being under the
evil influence of Staropramen.
Written by
Marcus Müller
&
Helge Heß