3
votes

In the days following the (still unanswered) question what the preferred way for a big continuous integrations setup in TeamCity might be we have been setting up a lot of snapshot dependencies.

Now, image you have configuration A, B, C, D and E which are depending on configuration Z. Three months are passing.

Now assume you want to switch from configuration Z to X, maybe because it is a configuration with which you tested a lot of different settings on different build agents. And you want to roll out those changes. And you do not want to enforce CI downtimes for developers just because you are manually copying configuration settings around you already have tested successfully with configuration X.

So to switch a dependency configuration Z to a different configuration X and to switch all dependent configurations to this new configuration: How do you still know then which configurations are still depending on Z?

Thanks - Stefan

1

1 Answers

1
votes

Although TeamCity has a good view tracking of dependencies on a per-build basis, I'm not aware of a page in the UI that allows you to see a list of build configurations that depend on a given "parent" configuration. You can of course view each individual configuration to find this out, but that may not be feasible in your large deployment.

If you'd like to access this information in a single place or programmatically, it's stored by TeamCity in a project-config.xml file in your <TEAMCITY-DATA-DIR>\config\<PROJECT-NAME> directory.

<project id="project1">
  <build-type id="bt1" name="Parent">
    ...
  </build-type>

  <build-type id="bt2" name="Child 1">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>

  <build-type id="bt3" name="Child 2">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>
</project>

In the above example, you could look for any build-type that had a settings/dependencies/depends-on node with a sourceBuildTypeId matching your parent configuration id. This approach should still work even if your dependencies span multiple projects, as the build type ids are unique on the TeamCity installation.