Checking for uniformity in SVN from Pharo

In an effort to ease continuous delivery for a system, we needed to ensure that all installation projects (for various sites and customers) had a uniform structure. Specifically, after refactoring the package assembly part of the continuous delivery pipeline, we wanted to ensure that all installation projects had a configs/srv/deployments/ path in them.

To check this, we created a tiny script. First, we invoked the Windows command line to get the list of all installation names from Subversion and we dumped these in a installations.txt file:

WinProcess createAndWaitForProcess: 'cmd /c "svn list https://svn/svn/delivery/installations > installations.txt"'.

Afterwards, to check that each of these projects we traversed all the corresponding Subversion repositories. The simplest way we could think of was to simply check that the header of the http request is not an error (such as 404):

'installations.txt' asFileReference readStreamDo: [ :s |
     s contents lines select: [ :each |
          (ZnClient new
               url: 'https://svn/svn/delivery/installations/', each, 'trunk/configs/srv/deployments/';
               username: ‘username' password: ‘password';
               head;
               response) isError ] ].

We got some 80 such projects that needed to be redone (out of a couple of hundred). The whole exercise took less than 10 minutes and could be done with a stock Moose (or even Pharo in this case) distribution, but it was a useful test that guided a multi-hour work. At the end, we reran the same script to check that we are truly done. And we were done.

Posted by Tudor Girba at 4 May 2015, 11:36 pm with tags story, spike, moose, assessment link
|