So sometimes with one repo and multiple pipelines you want fan-in behaviour, e.g if you are splitting the pipelines to run different logical testing blocks in parallel and either
- don't want to model them as parallel jobs within one pipeline or
- where pipelines require multiple source code material inputs, and you don't want excessive triggering of unrelated pipeline work
Other times you have multiple things in one repo for ease of management, but things are sufficiently segregated and you are OK with treating the pieces independently. In this case fan-in might not be what you want/need, despite sharing a repository/material.
Let's say you have some more classic mono repo A:
./deploy-scripts/
./service-common/
./service-A/
./frontend/
Perhaps you then have pipelines like
repoA --fanout--> frontend-build --> frontend-functional-test --fanin--> frontend-plus-service-A-smoke-test --fanout--> (deploy-frontend-to-UAT + deploy-service-A-to-UAT)
repoA --fanout--> service-A-build --> service-A-functional-test --fanin--> frontend-plus-service-A-smoke-test --fanout--> (deploy-frontend-to-UAT + deploy-service-A-to-UAT)
In a normal setup with GoCD, frontend-plus-service-A-smoke-test will only trigger when all of the upstreams are built on the same revision from repoA. If the frontend tests are perhaps far slower, this may unnecessarily slow progress down for promoting service-A code changes to UAT, and require triggering of everything.
You may be confident enough that they can be built and deployed independently, but still want some confidence that the frontend and service-A play nicely together which is why you have "frontend-plus-service-A-smoke-test". In this case you may want to take more responsibility on yourselves, and consider something like
https://github.com/TWChennai/gocd-git-path-material-plugin to allow the deploys to happen independently, but without excessive triggering of unrelated pieces, without splitting your repository. With something like this you might instead model like
repoA (path: deploy-scripts/ + frontend/) --> frontend-build --> frontend-functional-test --> frontend-plus-service-A-smoke-test --fanout--> (deploy-frontend-to-UAT + deploy-service-A-to-UAT)
repoA (path: deploy-scripts/ + service-common/ + service-A/)
--> service-A-build --> service-A-functional-test -->
frontend-plus-service-A-smoke-test --fanout--> (deploy-frontend-to-UAT + deploy-service-A-to-UAT)
This would logically split the materials while allowing you to commit together in one repo, essentially working around the
limitations of filtering noted here.
Anyway, these are just different tools in the arsenal, depending on what you are trying to achieve, and how you are modelling your pipelines and splitting your source code, test/deploy scripting etc.
-Chad