How to avoid using reverse.dep to make our builds "suitable"?
**Context:**
We're running the free version of Teamcity to manage our projects. Some of those projects have dependencies between each others.
**The problem**
Some projects have chained Snapshot Dependencies, and those dependencies are always being built. Ideally, we would want to avoid snapshot dependencies being re-built if there's already an artifact on the latest version.
Example: A depends on B, B depends on C. Push A triggers a build of C, followed by a build of B and finally a build of A.
Ideally: A would be built based on the latest built versions of B and C.
**Where I think the problem lies (but I might be wrong)**
Each of our projects has a number of Snapshot dependencies, and each snapshot dependency is configured with the following parameters turned on:
- [x] Do not run new build if there is a suitable one
- [x] Only use successful builds from suitable ones
For the first option, the documentation says:
> If this option is set, TeamCity will not run a new dependency build, if another dependency build in progress or completed with the appropriate source revision already exists. See also Suitable builds: (https://www.jetbrains.com/help/teamcity/2022.10/snapshot-dependencies.html#Suitable+Builds).
If we look in the Suitable Builds doc, it shows a list of requirements for a build to be considered suitable. The one I think is relevant is here:
> - It must not have any custom settings, including those defined via reverse.dep. (related feature request: TW-23700: (http://youtrack.jetbrains.com/issue/TW-23700)).
However, we currently have `reverse.dep.*.env.SOME_PARAMETER` as a Configuration Parameter in every single one of our builds (it's inherited through a template).
Based on that, it seems to me that the "Do not run new build if there is a suitable one" option is doing nothing, and therefore that's why all our dependencies are built every time (or am I wrong?)
We also have, in every one of our builds, an environment variable called `env.SOME_PARAMETER` which has the same value as the reverse.dep configuration parameter.
**My question**
Is there a way to avoid using `reverse.dep` in my situation so that the `Do not run new build if there is a suitable one` option works? Perhaps by using the environment variable instead?
I asked the senior developer at the company I work in, and they said that in theory it should work, but in practice it doesn't, but he seems recitent to explain further. I'm just a beginner in Teamcity, so detailed explanations are welcome
Please sign in to leave a comment.
reverse.dep.*is the same as in the existing build, just having thereverse.dep.*parameter will not prevent TeamCity from reusing the build. You can use the 'Select for comparison' action on an existing build to compare it with another build and find the differences:https://www.jetbrains.com/help/teamcity/build-actions.html#Compare+Two+Builds