Thursday, 14 April 2011

ITS066 - iSkills progress

Coldfusion 9 Migration

Application - iSkills

Introduction

The coldfusion migrations have come about in order to bring our older (and unsupported) applications up to date with the current version of Coldfusion server, version 9.

The applications themselves have been written in the old Coldfusion 6 language and most are running on the content management system of the time which is Fusebox. As the applications are upgraded they must be transfered onto the mach-ii framework as this is something that IS apps are looking to do across all of their applications to maintain a standard format to the software we produce and use.

As part of the migration the applications must be as follows;

  • fully compatible with coldfusion 9
  • transfered onto the Mach-ii CMS where appropriate

the project brief is also in the /its066 cf9 migration/iSkills/documents folder.

At this stage there are three developers working on the project and there are also three different applications being upgraded in this batch. My application is iSkills.

iSkills was written around 7/8 years ago and is no longer supported on the cf6 platform, its fusebox framework will also need to be replaced with Mach-ii. The application was written as a resource where anybody could come and search for skills training or teaching of any offered sort.

The site allows users to search its database for resources using a number of parameters and then displays results based on their requirements. The site is not that different from the recent Edge project in terms of what the application is for.

New technology introduced

  • Apache http server – Server software, although it’s used in most places and I have seen it before this is the first time I have used it for myself. I am now running apache in my dev setup to emulate real world server environments.
  • Fusebox – Content management system (CMS), provides a framework to build applications around.
  • Mach-ii – Another CMS does essentially the same thing in a different manner.
  • Mod_rewrite – An apache module which needs to be enabled in the apache configuration file. This allows URL’s to be disguised or redirected, the point being that its making it harder for people to guess their way around your applications directories and be a bit naughty. Secondly it makes it easier for search engines to index the site, the spiders and crawlers used they use to do the indexing generally stay away from query string laden URL’s. Mod-rewrite is a separate component from your web application.



Stage 1 – Familiarisation

The old code was to be studied so that we knew how the old system was working. The steps I took are as follows:

· Obtained old code from the current live system (see issues section).

· Modify code to run on my cf9 development setup.

· Print off all pages and their related debugging output to ascertain what functions and queries were involved in each of the applications transactions. (hard evidence has been kept).

· Follow the above notes to see where and why these functions are used.

There was an initial budget of 1 day for system familiarisation, I don’t think one day was enough and initially thought that would be down to my skill level however I was reassured to see that I was not the only developer needing more time here.

The code was to be obtained from the live system, initially it was to come from MS visual source safe however it can be a hit or miss whether the full working code will be in there so the safer option was to obtain straight from live, support calls were placed through Unidesk as developers don’t generally have rights to the live servers.

Eventually (see issues section) the live code was obtained and required modifications to run locally. Mod_rewrite was a particular issue at this point because I had never experienced it and knew nothing about it, same can be said about fusebox and mach-ii.

Of course not knowing how that worked meant I never understood at first when the application didn’t work correctly and I set about making the changes necessary to run it. When I got a page of the site that needed to pass a query string in the URL I found the sight stopped responding in to commands and started falling back to its defaults.

What I was missing at the time was that the rewrite engine also rewrites the query string and acts like and interpreter between the browser and the software so when I tried passing anything more than a simple page request the adjustments I had made to rewrite were not enough to deal with the requests. A half hour meeting with the original developer sorted that one out and explained how it was working in relation to the iSkills app.

The time given was enough to get an overview of how the application was working however not enough to get deep into it. Bearing in mind I also had to learn about two CMS’s, mod_rewrite and the actual application itself, in a day.

Issues

  • Incomplete code in source safe – solved by requesting the code from live (see images/uniDeskCodeRequest.jpg)
  • Support argued about obtaining the code from live and took nearly a week to pick up the request.

Stage 2 – Impact analysis & Initial Meeting

A meeting was called to discuss the following:

  • the applications suitability for mach-ii
  • the amount of time we require to make the upgrade
  • any issues we should consider across the whole migration project.

Please see bill lee's email dated 03/11, this is the initial invitation and explains what was required of me at the meeting.

We were required to produce a short document outlining our analysis and intentions for the build (this document is in /its066 cf9 migration/iSkills/documents). In this document I outlined the following;

  • The applications mach-ii suitability.
  • My view on my ability to bring the project in within the budget.
  • My concerns over the more advanced levels of code (versus my skill) in the application and what it its impact would be on the time I would take to complete the project.
  • The benefits of this project in terms of IS's aim to implement a common structure to the universities applications.
  • the importance of this project to my development (in terms of CMS frameworks)

My proposal was accepted and the tasks were assigned (see bill lee's email dated 16/03) with the original time scales noted which it was agreed could be adjusted if the project needed it to be. its worth noting at this stage that this was the first batch of migrations to go ahead and all other migrations would follow the template that was set by this initial run.

Stage 3 – Migrate code (Build)

Not a lot of work was required to convert the code to CF9, mainly outdated coldfusion implicit functions needing replaced with more modern equivalents.

However the mod_rewrite issue persisted here, the build went fine through making of the home and search pages, I had not yet started on their functional components yet, I was able to have the pages active and looking like the did on live however when it came to passing parameters around it became a different story. When I tried to click into the third page which was the browse page you are presented with a list of categories on the left of the page, click them and that categories search results are displayed on the right of the page (see images/iskillsBrowseResults).

In order for the application to search for and display those results it has to pass a query string through the url which mod_rewrite has to interpret for the browser to interact with the software. Unfortunately this meant rewriting the first set of pages I done.

At this stage to get the results list working I came across the attributes scope of fusebox, in this application it had been used as a catch all scope which is available throughout the whole application which posed a problem. How could I find what was in that scope if I couldn’t debug the original program? Also if I was able to do so how would I replicate that in mach-ii since that scope doesn’t exist?

It became clear that this would not be a case of copying over chunks of code if the environment they were designed to be in was no longer going to be used.

In order to help me overcome this issue I requested a meeting with the original developer. He explained that the rewriting url was heavily woven into the application as well as the attributes scope, between us we felt that the time needed to redevelop the software in the mould that the project wanted would have been a lot more than was budgeted for.

I took this to the project and resource manager and the mach-ii part of this build was dropped. I was very disappointed at not being able to complete the mach-ii build but on the upside I was confident in making that decision due to what I had learned about software development with Coldfusion.

What bill explained to me was that it was less a reflection of my ability but an indication of my ability to find a potential problem and not just keep butting up against it. knowing where the limits are when it comes budget and timescale.

Iskills is now ready for peer testing, at the time of writing this it is waiting on the development server to be tested, I still have configuration work to do regards to setting up server mappings and datasources, these are actually an integral task to the team setting up the server environment however its not been done and one of the servers is currently serving up error pages which I need someone else to fix. I’m just waiting for the go ahead.

Testing

As the site is divided into two sections, user & admin, I will be testing each section as they are completed, hopefully this should lead to me having a finished and tested application before moving on.

Each section would then be devided into their respective pages and functions which again will be tested on completion.

Although I don't hold a full knowledge of it I believe this leans slightly towards a test driven development methodology, or at lest my interpretation of it.

Issues

  • Tight coupling between application, framework and server. Separation meant massive rework.
  • No supporting documentation available to assist in analysis and debug of old system.
  • Unable to complete a mach-ii build and consider this framework to be the most important stage of this placement so far.

No comments:

Post a Comment