private void mergeConfigUpgradePack(ConfigUpgradePack pack, File upgradesFolder) throws AmbariException {
    File stackFolder = new File(upgradesFolder, stackInfo.getName());
    File versionFolder = new File(stackFolder, stackInfo.getVersion());
    File serviceConfig = new File(versionFolder, StackDefinitionDirectory.CONFIG_UPGRADE_XML_FILENAME_PREFIX);
    if (!serviceConfig.exists()) {
      return;
    }

    try {
      ConfigUpgradePack serviceConfigPack = unmarshaller.unmarshal(ConfigUpgradePack.class, serviceConfig);
      pack.services.addAll(serviceConfigPack.services);
    }
    catch (Exception e) {
      throw new AmbariException("Unable to parse service config upgrade file at location: " + serviceConfig.getAbsolutePath(), e);
    }
  }
Attempts to merge, into the stack config upgrade, all the config upgrades
for any service which specifies its own upgrade.
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java