Continuous builds and Agile vs commit often

Right now I'm just doing formal training at Agile, and one question I have is the value of continuous builds and the cost associated with the version control system.

My understanding with version control is that it is better to fix it often, because then you have a history and the ability to return to previous changes in a small way.

My understanding with flexible and continuous builds is that you need to put pressure on developers to always have working code. To break the source tree, this is a taboo thing.

Now I agree with both of these feelings, but sometimes it happens that they can work against each other. You may be in the middle of a fairly large code change and want to copy the code to make sure you have a story, but this will break the source tree.

Anyone have any thoughts on this?

+6
version-control continuous-integration agile
source share
11 answers

What could be less flexible than a taboo about something that ever goes wrong? I would say that the taboo is to leave the assembly broken, and not to completely break the assembly. Accidental assembly failure is in order. That is why you perform continuous builds and tests. CI build / test determines when the build is broken, and ideally, who broke it. This ensures that it will be fixed quickly. If this happens sometimes, you're fine. If this happens twenty times a day, the team probably has problems.

Taboo should interfere with other people doing their job. When you break the assembly, they receive an email: "Our source branch is ruined." They will not be able to integrate other people's changes or their changes with the main line until they receive all the clear letter.

The real problem is working in such continuously integrated environments: 1) Team retention is quite small. As a rule, we begin to see problems after about 25 developers have gathered in a team. Everything starts to become fragile. Using branches, components, or a multi-stage CI with threads can help larger teams break up smaller teams.

2) The choice of small units of work. As a rule, there should not be a conflict between checking corrections regularly and not breaking everything. Obligations must be fulfilled with small work changes. The new function may not be available to the user, but if a coherent API change is made that does not break the tests, check back.

3) Fast, accurate assembly. There are many race conditions that a team usually wins more often when the assembly becomes faster. Plus, reproducible builds ensure that the developer on his computer (which she managed to do because it was fast), the developer made a fairly accurate prediction of success at completion.

+10
source share

Branches / tags allow this on most version control systems.

They allow you to mark or simply “fork” (pun intended) a segment / revision of the code and have it as a “stable release”. Then you can make changes to the main trunk or patch branch or other approaches.

Both concepts work together.

+10
source share

In fact, Agile’s general philosophy (which I’m actually very pleased with) is: “If you cannot make the transition before heading home, come back.

It sounds cruel at first, so I usually first copy my source tree locally or expand it and then go back to where I started. The next day I will start work. It usually goes VERY QUICKLY, I improve what I did on the previous day, and I rarely ever look at a copy (well, sometimes I hold back some classes that I had "Finished", and I was sure and again them integrated.

I almost never need to go through more than a few hours without registering. I try to use refactories (they are ALWAYS very short and harmless or they are not refactors), and I add the code this way, Do not break. This may include adding proven code (a new method or object) and checking it before binding in the rest of the code.

In general, your unit tests should ALWAYS work. I tend to run tests as often as several times per minute and rarely more than once every ten minutes.

Taking small steps may take a little longer, but you will avoid these 3-4-day code rewriting sessions, where you cannot run any tests or checks, those can be cruel and HUGE waste of time!

+5
source share

I will add another answer, because it seems to me that some of the most important points were not mentioned.

My understanding with version control is that it is better to do it often, because then you have a history and the ability to return to previous changes in a fine-grained form.

I absolutely agree with that.

My understanding with Agile and the continuous build is that it is there to put pressure on developers to always have working code.

You should not put pressure on developers - I would prefer to describe continuous integration as a friendly security network that will help you catch problems as soon as you fix them, when fixing them is usually easy, (Check out Martin Fowler original article for additional CI benefits.) Important always have a working code and that where there are version control branches, as the mulberries noted . But unlike the traditional scenario that he describes (and what Fowler says: “Everyone fixes the main line every day”), I would recommend the opposite: stabilize your main chest, preferably always in the released form, and do all the basic development in temporary work branches.

I have connected a stable approach to trunk on SO here and here ; see these posts for some justification and experience with this model. In addition, I warmly recommend this article, which greatly influenced my thinking: Version control for several flexible teams from Henrik Kniberg.

Breaking the build in the dev branch is far from taboo, although you should still try to keep all the compilation and all tests pass. In this scenario, the gap in the trunk structure is somewhat more serious, but I would not call it a taboo - this happens from time to time, and instead of finding someone who is to blame, it’s infinitely important for the team to correct it (and be happy, that the problem was found now, and not much later, perhaps by the client).

+4
source share

Use Git for easy forking, merging, and reloading.

+3
source share

Silky is in place, forking / tagging allows this (svn plug for this function).

I often root for fixing, and I personally find that this makes it easier to prevent the assembly from breaking because I test less code each time.

+2
source share

TDD allows you to have both

One solution to this obvious paradox is Test Driven Design (TDD) software development agility. Practically good, it is easy to execute code often and have continuous builds that are rarely interrupted by non-working code.

First get the latest code from the repository and run all the tests. (If they all fail, kill the last person to complete.) Write a test for a little functionality (before you implemented the functionality), then add the functionality and run all the tests again. Update your code from the version control system, if something has changed while working, repeat all the tests, and if all of them pass, you can immediately fix this. This is a very “red-green” agile Red-Green-Refactor concept. After that, do any necessary refactoring and repeat all the tests. If you are still green, you can commit again at this point.

Most flexible commands have a Continuous Integration server that runs on a regular schedule (often by hours or more) and has a large visible indicator (like a traffic light) that indicates whether the last build passed, failed or is in the process.

Have a local version management database if you need to

If you absolutely cannot escape the “big code changes”, use your own local version control repository using something like git , as Gordon Potter suggests, and commit when you are done with the change. You can do this even if your team uses a different version control product.

+1
source share

For a significant or large change that is likely to damage dependent code fragments, the industry will be appropriate. At the moment when you want to integrate this change and check it in the trunk or any integration branch on which you are going to promote it, referring to faults and having tests, all the work is necessary. I do not think that two things should work against each other. Using branches or managing a distributed source will simplify management.

0
source share

You will need to study what story makes sense during the merger. Suppose you have a program that uses many loadable modules, it could be the kernel .. a web server, whatever.

When writing one module, you make 200 commits, when you merge with the main project, you probably want only one (albeit a big) patch, maybe two:

  • Introduce the foo module
  • Makefile update to create foo

This is one of the reasons why Git has become such a dominant presence in the DVCS world.

Your choice of fixation frequency does not really affect which software development method you want to use. You can make 200 verified verified versions, or one, until people pulling what you click swallow toxic revisions or regressions in their code caused by your own (unless, of course, your code creates a problem for them).

I (personally) like to make many small commits for the same reasons that you gave. In fact, it is usually ideal if everyone is working on one central branch. However, if you have been working in some subsystem for 6 months, I would prefer that you send me some large patches rather than inherit your entire history. You always have your story in your own working repo, and probably this is interesting only for you :)

0
source share

If a large code change is in a separate branch, this does not necessarily destroy the assembly. Having a branch on itself, the changes are saved outside the code until the change is completed, and then all this can be combined back into the main or main line of code. The key is that, although continuous assembly is taking place, this does not necessarily include things that are not “done-done.”

0
source share

It seems to me that Git solves this problem. Store the local repository and commit it earlier, commit often, and then when the code reaches the incomplete stage that pops the main repository. If the entire team uses Git, then the entire history of the entire repository can be maintained in the repository of everyone else when they pull the changes. And all without breaking the assembly.

And when you reboot, you don’t even have to expose your entire history of local commit when outputting milestones.

0
source share

All Articles