Given an application having:
- Configuration Files (xml or json)
- An Automated Deployment Process
After the deployment the configuration files can be modified by users.
When deploying a new version of the application, the new version can include new configuration properties, one would like to add the new configuration properties and preserve the old properties values.
For Example:
<!-- OLD -->
<config>
<path value="C:\App" />
</config>
<!-- NEW -->
<config>
<path value="F:\Ppa" />
<errorMessage value="ERROR!" />
</config>
<!-- EXPECTED -->
<config>
<path value="C:\App" />
<errorMessage value="ERROR!" />
</config>
How to manage this properly given considerations such as:
- the application is deployed in multiple production environments
- the config files can have arbitrary structure and nesting
So far we considered several solution but each have a considerable drawback:
- Use Xml Semantic Diff Libraries -> Does not handle well some edge cases (detects add/remove as change)
- Create format specific logic -> Requires changes whenever the structure is modified
- Store the configuration property/values in the database (SQL) -> Would require substantial rework in the application