Grok: Introspector and other things on the way to number one
| Author: | Uli Fouquet |
|---|
Abstract
On the way to 1.0 release Grok has completed a remarkable set of tasks. Some things, however, need more care. Beside basic features like better testing and i18n support, a very important feature also for user acceptance might be a better introspector for the Zope component registry, the ZODB and similar runtime-information. The introspector can be improved in terms of integration (into Python/Zope), completeness and general library design quality. Eventually the introspector could support basic debugging features. All this should be done with a strong focus on usability for developers (beginners and advanced).
Project Targets
Grok Retrospector
As announced on the ZF GSOC list I would like to reimplement the Grok introspector. To finish this task I might perform the following steps, which are partly derived from Lennart Regebros call for feature requests for a introspector tool (http://regebro.wordpress.com/2008/02/17/what-would-you-want-from-a-component-introspector-debugging-tool/) and from an an IRC meeting with Lennart Regebro, Martijn Faassen, Martin Lundwall and Jesper Petersen on April 5th, where we already worked out a plan to separate and coordinate the tasks concerning the design and implementation of a new, resusable introspection API and related UI components in both, Zope 2 and Zope 3 environments.
Factor out the Grok admin UI into a separate package
zope.introspector:
Design and implement a basic Zope API zope.introspector, which should be reusable in any Zope 2 and Zope 3 environment, namely Plone and, of course, Grok. This might be completed as a collaborative effort of Martin Lundwall, Jesper Petersen and me. We already did some planning to coordinate our work during GSOC on April, 5 (see below).
Design goals:
- Reusable in any Zope-based environment.
- Extensible in a sense to help building of more specific introspectors in more specific environemts like Plone or Grok.
- Should gather all important runtime-information of a running Zope framework, which are not Zope 2/Zope 3 specific. including classes, attributes, etc. What "important runtime-information" means in detail, will be worked out during first phase of GSOC together with other introspection minded students, namely Martin Lundwall and Jesper Petersen. I can bring in my experiences from writing the current Grok introspector here and would do so in any case, whether my application will be accepted or not.
- No own UI, but with possibility to plugin custom UIs?, so that viewers/browsers can be built quite easily.
- As little dependencies as necessary. Probably zope.interface and zope.component only.
Rebuild docgrok based on the renewed zope.introspector. Currently, docgrok is mainly build on apidoc, which is (currently) not Zope 2 compatible and at some places too tightly bound to views and a 'book' structure.
The new docgrok should grab at leas the following additional information (not provided by zope.introspector):
- explicitly and silently (by defaul) applied grok directives for a specific object.
- views and layers for a specific object.
Build a new Grok introspector UI based on docgrok.
I hope to get some feedback here from the Grok-community during work.
The new Grok introspector-UI must perform at least:
- displaying of explicitly and silently (by default) applied grok directives.
- displaying of views and layers available for a specific object
- displaying of ZODB objects
- displaying of runtime-objects like classes/interfaces/packages most probably based on apidoc.
- displaying of accompanied txt file in packages.
- (eventually) displaying code
The Grok introspector UI should be extensible, so that custom UIs? can be used by other Grok projects to use it on their own.
If there is enough time also writing back of modified values might be possible for at least simple values.
Minor Tasks
Complete the Grok testsetup support
- Finish implementation of grok.testing.testsetup support.
- Extend documentation on testing for endusers/developers.
Complete i18n support:
- Finish implementation of a Grok directive to register locales in the Python code of Grok projects, to make use of the appropriate ZCML directive obsolete.
Improve broken objects support (eventually)
- Broken objects in the ZODB can't be easily deleted/changed currently. While the situation is a bit better in Grok (I already implemented deletion of broken objects), a possibility to grab data from those is still missing. This follows the proposal on the ZF GSOC page by Christian Theune.
Do bugfixes of open issues with Grok and grokproject.
Timeline
Not every problem during such an event is foreseeable. Therefore the follwing is only a first rough sketch, subject to changes.
Week 0-3:
As mentioned above, I already coordinated with Martin Lundwall, Jesper Petersen, Lennart Regebro and Martijn Faassen for the introspection related stuff. Because this will be an important base for other main tasks, I will start with this (zope.introspector API) and hope, that we will have a usable implementation ready by the third or fourth week of GSOC.
I expect some idle time here, due to coordination matters, which could be filled with factoring out the admin app.
Week 4-6:
In a second phase I'd like to write the Grok extension for the zope.introspector, finish grok.testing and i18n-support.
Week 7-10:
The third phase will include the frontends (WebGUI?) for ZODB browsing and afterwards browsing of other runtime objects. Here feedback from Grok community will be important.
Week 11:
The fourth phase might include mainly final finetuning and testing of all topics, presenting results to the community (where not already happened), bugfixing and getting feedback.
About Me
I am currently doing my PHD at the University of Bonn/Germany.
My Python and Zope experience started in 2000. I did a lot of Zope2 and (CMF-based) CPS projects since then and are currently involved in some Zope 3 projects (z3c.testsetup, z3c.fallbackauth) and a larger Plone 3 project.
I already did a GSOC project for Grok in 2007, where I implemented a first, improvable version of an introspector for Grok. In the last year I got involved in Groks friendly community and hope I understood the Zope and Grok concepts deep enough to reach the targets mentioned above, although I am not a guru.
I am active in promoting Grok in the press and on conferences and participated in two Grok sprints during 2007.
Last year's GSOC was a great experience and if my application should be accepted I promise to do everything to make it a success. Thus I can give back a bit of all the goods I received from this community.