Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Python

Ask Slashdot: Taming a Wild, One-Man Codebase? 151

New submitter tavi.g writes "Working for an ISP, along with my main job (networking) I get to create some useful code (Bash and Python) that's running on various internal machines. Among them: glue scripts, Cisco interaction / automatization tools, backup tools, alerting tools, IP-to-Serial OOB stuff, even a couple of web applications (LAMPython and CherryPy). Code has piled up — maybe over 20,000 lines — and I need a way to reliably work on it and deploy it. So far I used headers at the beginning of the scripts, but now I'm migrating the code over to Bazaar with TracBzr, because it seems best for my situation. My question for the Slashdot community is: in the case of single developer (for now), multiple machines, and a small-ish user base, what would be your suggestions for code versioning and deployment, considering that there are no real test environments and most code just goes into production ? This is relevant because lacking a test environment, I got used to immediate feedback from the scripts, since they were in production, and now a versioning system would mean going through proper deployment/rollback in order to get real feedback."
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Taming a Wild, One-Man Codebase?

Comments Filter:
  • A few things (Score:5, Informative)

    by jlechem ( 613317 ) on Thursday September 20, 2012 @02:36PM (#41402763) Homepage Journal

    1. Buy or get a machine to host SVN for version control. I work on my wife's company website and some basic management tools. SVN has saved my bacon on multiple times where I thought I had lost some code.

    2. Get a pre-production server and test your code! Sounds like you're living in the wild west and that shit flies until something goes horribly wrong and you're the guy who gets blamed.

  • No real change (Score:5, Informative)

    by chthon ( 580889 ) on Thursday September 20, 2012 @02:37PM (#41402775) Journal

    You can still change everything in place. Then you can run the script and get feedback. When it works, you commit. When it doesn't, you remove the problem, check and commit.

    Or you can make your changes, review them and commit them, then do a run. When you have a problem, you commit again.

    It is not because you use a versioning system that you need extra formality. You can still work the way you used to, but now you have an extra safety measure due to the versioning system.

    Using trac is a way to better organise your problems. The main thing I can say about using trac effectively is that you always need to have a browser window open on it, and when you have an idea, or notice something, or have problem, then enter it immediately. Afterwards, take your time to look at new and open problems, classify them and process them.

  • by turbidostato ( 878842 ) on Thursday September 20, 2012 @02:47PM (#41402909)

    Oh, by the way, you really should listen to those that tell you *need* some development environment.

    Again, I've already been there, so I know you pain: even for the silliest development the developers will have their development environment but for us, systems people, it's expected that everything just fits in place at first try, no second chances. Of course, next heavy refurbish will be near to impossible because while being a good professional allows for more or less "clean" kaizen-style development, anything a bit dangerous is an almost impossibility because of lack of test environments (with luck, next "heavy test window" will be in three/four years when all the servers are decomissioned and new ones come in place) but that's the way it is, take it of leave it.

    The good news is that, while not a panacea, virtualization, even at desktop level (you surely need to have a look at vagrant[1]) allows for a lot of testing, impossible in the age or "real-iron only".

    [1] http://www.vagrantup.com/ [vagrantup.com]

  • Documentation (Score:3, Informative)

    by Hjalmar ( 7270 ) on Thursday September 20, 2012 @02:57PM (#41403051)

    Yes, set up a test environment. And implement some kind of versioning system, even if it's just "cp current_code old_code". You should always be able to fall back if you have a botched deployment.

    But one of the best things you can do is to start writing documentation. I like to write my documentation assuming it will be my replacement reading it, and so I try to include everything. Justify every unusual implementation detail, explain why each task was down the way it was. List bugs, and any code you had to write to work around it. The best part of documenting your project will be that as you work through it, you'll find things that no longer make sense and make them better.

  • by HornWumpus ( 783565 ) on Thursday September 20, 2012 @03:52PM (#41403767)

    You need to fire this cowboy. He doesn't think he needs to test his scripts.

    I know he seems irreplaceable. That should be a big red flag.

  • Re:Scalability (Score:5, Informative)

    by theshowmecanuck ( 703852 ) on Thursday September 20, 2012 @07:24PM (#41405983) Journal

    testing code on a fraction has led to misconceptions about scalability to a far larger data set

    This is real. The solution is to manage expectations. If people know that the tests just show functionality and not scalability, and that scalability testing is required (when warranted), you should be good. More importantly if the decision makers know this, you are good.

    if the real data contains people's shipping addresses or other PII?

    Scrub the data. Addresses are not personal information though. The fact a specific person lives there might. Open a phone book (if you can find one now-a-days. They have reams of addresses as well as phone numbers tied to real people. This is public knowledge. Personal information involves things more like name, age, finances, medical records, etc.

    For the stuff that is real personal information, randomizing names to create fake people tied to real addresses is not hard at all (real addresses are often necessary when system tie into others where shipping or location are requirements). You can take real information and put it in a can and scrambled to make fake people. I think testers should be proficient enough to be able generate this kind of data.

    As to one other comment made by the OP:

    and now a versioning system would mean going through proper deployment/rollback in order to get real feedback.

    Versioning systems do no such thing if you don't use them that way. If you want a "proper deployment and rollback cycle" you can do that. Or not. But at least you'll be able to go back in time to find the code that actually worked if you need to. No coder should work without the safety net of version control. Whether it be CVS, SVN, GIT, it matters less what it is than whether you have one or not. Pick one and use it.

Everybody likes a kidder, but nobody lends him money. -- Arthur Miller

Working...