2013-05-17

Switching from CVS to GIT (Part 1)

Intro

I'm part of a team that works on a web application created in the middle of the last decade. It's very successful, in terms of "it's making money". We currently use CVS, and the development process is built around that.

The problem

What annoys me most, is you have to check in to test your changes (and testing means "open in browser", I'll cover that later). Other annoying things include:

  • Code QA is done based on file revisions
    I hacked a tool to get changes for a user in a given time frame, to create those QA docs, but this is still error prone due to not doing one story at a time
  • No branching
    I've read that branching in CVS is a real pain. I even don't know how to do it properly. Additionally, even when we would use branches, there would be no testing enviroment, since the dev-server's auto deploy only works on HEAD. There's other problems with that too, since we need more than a dozen Apache vhosts for every branch (explaining that would go too far here)
Not for the first time, I'm thinking about how to convince the team to switch to git.

If we use git the way we currently use cvs, it's pointless. We would still bloat the version control with many unneeded check-ins. To make thinks even worse, there's no invrementing version number in git, so it's harder to track changes in a single file. There would be still no branching, since the central dev-server still can only serve one branch due to the multi-vhost problem.

So I think we have to change the development process in general, and use git the way it's meant to: Every developer has his own (set of) VMs where he could develop and test on. When development of a particular item is finished, he pushes that changeset to the central git repo, where it gets merged into the development branch of our application. The dev-server would still serve the current dev branch.

That imposes the next problem: Our application isn't easy to set up - even a skilled admin would need 2-3 days to deploy it to a fresh server.

Conclusion

It's not exactly easy to switch to git for us. In the next post I'll show some real code and possible steps to take for making a rather big PHPapplication easier to deploy.

2013-05-14

About me

Who am I?
Born in the late sixties. Raised in Berlin, lived in Bavaria for ~20 years, now living near Hamburg.

My first intelligent contact was in 1982 - a TI 99/4A at Berlin's KaDeWe. Instead of going to school, I tried various things with the TI, while others were more attracted to the VC20 or Apple ][. The TI was really slow, and it's basic was pretty limited. Then the C64 came out, and it was so cool, fast, colorful. At that time my Basic skills were pretty good, and while on holiday with my parents, I wrote my first Faktura. In Basic, with pen on paper - at that time I still had no own computer, but was forced to use the ones in retail shops, saving my "daily work" to Datasette. I finally got a C64 and a 1541 Floppy Drive in 1983. I started programming in assembler in 1984, did a couple of modifications of the C64 Basic- and System-ROMs, the 1541 ROM, some SpeedDisk modifications...
I had my first *nix contact in the early Eighties: netbmx, a Xenix box with a couple of modem dial-ins. Shell access for everyone, email (netmbx!lamy, yes, bang notation) and usenet access. Soon thereafter I hab my own Xenix box at home, a 286 with 2MiBs RAM and a 10 GiB, 5¼" HDD. The 2400 baud modem was busy for at least 8 hours a day doing UUCP (unix-to-unix-copy), and the cpu nearly burned compiling things like "elm" from comp.sources.unix. In 1987 I got my first IT job - I ought to fix text terminals, but spent more and more time with installing and breaking some crude mix of BSD and Unix Version 3 running on the 68k boxes my employer sold to business schools in Berlin.
My next "era" began in 1992, when I moved to Bavaria after a longer period of unemployment. I started work at MediaMarkt's in-house ad agency, doing 2nd level support. Naturally, they had a couple of Macintoshes there, but also a small Sun IPC! Some times later, I also hit Linux - at kernel 0.99.x, installed from slackware disks. From that I build my first home-*nix box since I abandoned Xenix in the late Eighties, and had much fun learning C. This lead to my next job, which I started in 1996. My first developer job, I did some C programming on Solaris 2, learning CVS and TCL. We did embed TCL in HTML pages like PHP does. I learned quite a bit there besides TCL and enhancing my C skills. It also was my first contact with version control, CVS. And we did quite a bit of bug hunting in open source projects like TCL, libtiff and pbmtools, using our in-house purify license.
In 1998 I started my own business, which was just the right time. I did IT admin tasks in a couple of companies, including a small Linux based ISP, until I got my first PHP job in 1999. I did a function library for a startup providing both free and paid forum services. The dotcom era turned out to be pretty good (money-wise), but 9/11/2001 nearly stopped my business, until finally 2004 I went out of business and started as an employee at my former client, the ISP. I continued to do all the IT admin stuff there, and kept on building PHP apps for both internal use and for clients, including - surprise! - an OO CMS (PHP4 at that time) and an admin panel for the services we provided to customers. I also did some stuff for ClamAV, and also built lots of stuff around spamassassin. In 2008 I moved on to an ad agency, doing full time PHP development - I built a custom shop software with Zend Framework, finally (really) learning OOP. But, all the time since 1998, I was on my own - only had search engines as helping source.
Then, in 2010, there was another decisive turning point: my wife broke up with me. The next couple of months were really bad, and also my job got more unsatisfactory. Time for a job change. At the same time, I started phoning one of my friends I met in World of Warcraft. That relationship turned into romance, so I decided to do the big cut: quit my job and my appartment, and leave Bavaria for my new love and a new job - first time I would join a real team since I don't know when.
I'm really happy in my current job. For the first time, all my pros and cons get visible. I work with both old code, and get to design new stuff. There are colleagues to ask if something is not clear, and there's this beautiful woman making every evening and weekend feel like a never ending vacation.

So what will this blog be all about?
It's about PHP and Linux. About the juggling act of dealing with old, untestable code, about staging and deployment. And also about dealing with the team, where some really want to use modern tools like git and unit tests, and others want too keep things how they are, because every change comes at a price.

Happy reading!

Thomas