Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should an automated build process commit changes to version control?

I have often seen automated build processes, including Continuous Integration builds, commit changes made to source files during the build back into the version control repository that the source originated from*. Auto-incrementing version numbers is a common scenario where this is done but there are others.

My intuition is that this is a bad idea as it can litter the repository history with build-related commits and the build process needs to prevent accidentally re-triggering itself. However I don't have any concrete evidence that committing changes during a build is best avoided.

Can anyone cite references discussing the pros and cons of commit changes to version control during an automated build?

*Committing changes to a separate artifact repository is perfectly acceptable.

like image 374
Jason Stangroome Avatar asked Dec 13 '11 03:12

Jason Stangroome


People also ask

What are some common tasks of automated build?

Build automation is the process of automating the retrieval of source code, compiling it into binary code, executing automated tests, and publishing it into a shared, centralized repository.

What are the benefits of the automated build process?

Another major benefit of automated builds is that they simplify the delivery of the project across the team. Without a build system, every member of the team would have to download the latest version of the codebase and compile it on their own to see any recent changes.

What are the two common ways to automate builds?

Build-automation utilities The two ways build tools differ are task-oriented vs. product-oriented. Task-oriented tools describe the dependency of networks in terms of a specific set task and product-oriented tools describe things in terms of the products they generate.

How do CI and version control relate to one another?

Continuous Integration relies on Version Control System Every change applied to the codebase must be safely stored in a dedicated Version Control System (VCS). Once the code is version controlled, it can be accessed by the CI tool.


1 Answers

Auto-incrementing version numbers

That is a metadata, and putting metadata in (versioned) data is "evil": for the pros and cons, see this answer.

Continuous Integration includes the build automation, which is about being able to reproduce a build from a fixed set of versioned data.
If you change anything back in that same set, you sort of defeat its purpose.

like image 126
VonC Avatar answered Nov 15 '22 10:11

VonC