Search code examples
gittfswebhooksgit-webhooks

Service Hook can be used to trigger update dependencies in another repository?


I've been investigating a solution for the following problem for our local Microsoft Team Foundation Server that we use with Git:

We have several repositories with some level of dependency. For example, we have a "Messages" repository that will be the interface between the several repositories, each repository is a different unit on our software that will run in different containers and the messages are the interface of the communication between this units.

When we have changed the "Messages" unit we would like to have a trigger that informs all the dependent projects (automatically) like for example update the version of the "Messages" Nuget Package in the project file and commit that changes. When anyone gets the latest version of each unit that depends on the "Messages" unit, when restoring his local version of the project will get the latest version of the messages too.

Is there any way we can do this using the current tools? How can we do it? I can only find examples of sending messages to Slack and this is what I don't need.

best wishes Paulo Aboim Pinto


Solution

  • Instead of using webbook to monitor and trigger build, you could directly chain related builds together using build completion triggers.

    Large products have several components that are dependent on each other. These components are often independently built. When an upstream component (a library, for example) changes, the downstream dependencies have to be rebuilt and revalidated. Teams typically manage these dependencies manually.

    Now you can trigger a build upon the successful completion of another build. Artifacts produced by an upstream build can be downloaded and used in the later build, and you can also get data from these variables: Build.TriggeredBy.BuildId, Build.TriggeredBy.DefinitionId, Build.TriggeredBy.BuildDefinitionName.

    enter image description here

    See the build triggers documentation for more information.

    Another approach could be using Trigger another build task and specifying a Condition. In case you TFS sever is not supported to use build completion trigger. Besides this task also support trigger a build in another team project.