Identifying a configuration problem with GTInspector

When releasing the latest version of the Glamorous Toolkit we noticed a little problem: while in Pharo 4.0 the code worked just fine, in Pharo 3.0 we got a problem due to a reference to a class that exists only in Pharo 4.0. The problem came from the GlamourCore project, but I could not exactly see where the problem lies given that the dependencies are deeply nested.

Thus, to fix the problem I first needed a map. I inspected the object corresponding to the configuration version:

ConfigurationOfGToolkit new project version: #stable

and I started to work on a small visualization showing the dependency graph. After a couple of minutes, I ended up with a reasonable view:

Map-playgroundcode.png

The problem was that GlamourCore appeared twice: once with the 3.0.6 version and once with the 3.0.7 version. After a brief inspection, it became clear that 3.0.7 is the correct version. All that was left to do was to update the corresponding configuration dependencies.

Once the visualization code was ready, I installed it in the class of the configuration version as an inspector extension method (through the gtInspectorPresentationOrder: pragma):

gtInspectorProjectMapIn: composite
     <gtInspectorPresentationOrder: 40>
     composite roassal2
          title: 'Project map';
          initializeView: [ RTMondrian new ];
          painting: [ :view |
               view shape label text: [:each | each asString copyReplaceAll: 'ConfigurationOf' with: ''].
               view nodes: self allProjects.
               view edges
                    connectToAll: [:each | each projects collect: #version];
                    moveBehind.
               view layout horizontalDominanceTree ]

To install the method, I did not have to leave my object but wrote the code right in the inspector.

Map-code.png

After installing the new method, the inspector automatically updated itself and the visualization was ready to be used.

Map-with-problem.png

Equipped with the map, we could fix the configurations and use the visualization again to test that everything is fine:

Map-with-fix.png

The whole scenario was measured in minutes. In fact it took more time to write this post than to do the job.

Posted by Tudor Girba at 4 January 2015, 12:48 pm with tags assessment, spike, moose, story, pharo link
|