Hi,
In the software development environment where I work we have a group of developers all working in the same (Java) codebase (currently using SVN). I notice that people want to commit often what they have constructed without 'breaking the build'. So just for that reason I'm looking at tools like Git and Mercurial that make branching and especially merging much easier.
One of the things I see is that if a developer commits 'bad code' then the code is broken for everyone. As an idea to avoid this I would like a way of having a 'intermediate single feature' repository that is simply the current 'master' with ONLY the one changeset for that single new feature. Such a 'intermediate single feature' repository can then be automatically tested (code quality, unit testing, manual code inspection, etc.) before becoming part of the main code base.
So the workflow I have in mind looks something like this:.
- A developer creates a new feature and commits this locally on a daily basis.
- After some time the developer is finished and submits the entire changeset to be integrated into the 'main' repository.
- A continuous integration system takes the current 'master', applies the changeset and checks the code (merge conflicts, PMD, Findbugs,...), runs the unit tests, checks the coding style, etc.
- If the CI system decides "bad code" the developer is notified about the reasons and the developer has to fix the mentioned issues. In this case the main repository is unchanged.
- If the CI system decides "good enough" then the code reaches the 'lead developer' or a 'code reviewer' who inspects the chosen solution and approves or rejects it.
- The approved changeset is then included into the main repository and is available for all developers to rebase/merge with.
I have some questions about this kind of workflow:
- Do you thing this will work well in practice (i.e. is this a good idea or a really braindead one)?
- Have any of you worked with something like this before? What were the pro's and con's?
- Is there a 'ready to run' script/procedure/tool/... that makes it possible to jump start such a workflow (or a variation on this idea) in minimal time?
Thanks.
Background note:
I have worked as a developer some 13 years ago at a company where they build a similar workflow internally and they had two nightly builds:
- The 'production' version: Main code base
- The 'senior version: Main code base with all newly submitted versions of all changed files.
Because this was all SCCS (lock-edit-unlock model) based there was no way to 'commit often', you had deadlocks for code changes and all other kinds of nasty effects. What I'm looking for is mainly the good things about what I used back then using the much better tools of today.