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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With