Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are source control and configuration management best practices?

I am thinking of a list that I could refer other developers to with things like:

  1. One build script, such as makefile, will build and test entire project
  2. All components to needed build the system need to be source controlled

Anybody have such a list? In priority order?


UPDATE - added some fyi detail

System in question consists of C++ and makefiles, Java with ant that results in WARs, as well as powerbuilder and C# gui components. All code is in perforce.

So I am looking for both generic as well as language specific best practices.

like image 283
Ville M Avatar asked Apr 14 '09 21:04

Ville M


5 Answers

To me, the #1 rule is this:

The main branch is sacred - it must always be buildable, capable of passing BVT's, and be basically usable.

Any code that is allowed to go into the main branch that causes a build or BVT break exposes a bug in the process. The process should allow buddy builds/tests for single branch systems, or require child branches to build and pass BVT's before mergining into the main branch, or other such safeguards.

like image 136
Michael Avatar answered Nov 08 '22 02:11

Michael


Take a look at High-level Best Practices in Software Configuration Management.

like image 29
starblue Avatar answered Nov 08 '22 03:11

starblue


This is highly dependent on what environment are you building in?

  • Is it C/MakeFile?
  • Is it Java/JUnit/Ant?
  • Is it .NET/NUnit/NAnt?
  • Is it .NET/MSUnit/MSBuild?
  • Is it Ruby...
  • Is it Python...
  • Is it PHP

Each of these differ in approach and setup. So we need to know your setup before you can be helped.

like image 20
Nick Berardi Avatar answered Nov 08 '22 03:11

Nick Berardi


My number one item:

  • Update often, commit often,

or, as Jeff puts is: Check In Early, Check In Often.

like image 1
Dirk Vollmar Avatar answered Nov 08 '22 02:11

Dirk Vollmar


The system must build by itself, test by itself, and download+build dependencies by itself. I have a makefile downloading, building and deploying a runtime environment which is "certified" for my trunk version. This makefile is committed as well into the repository.

Remember to commit another, very important, and mostly overlooked thing (comes in a bundle of three):

  • The SQL code that creates your database layout (put a version on it!).
  • The SQL code that brings up your database layout version (to upgrade)
  • The SQL code that bring down your database layout version (to downgrade)
like image 1
Stefano Borini Avatar answered Nov 08 '22 04:11

Stefano Borini