Master/Branch Dependencies build even with no changes.

Hi

Not sure if this is possible but i thought id ask.

If i have three projects (.net - In reality there are actually many more projects than this but hopefully this will illustrate it enough)

Proj A - MVC UI layer
Proj B - Domain Layer
Proj C - Persistence layer

Proj B is then feature branched. A load of changes go into said branch and the functional tester needs to test the changes before merging to develop. So i need a build of all projects but use the feature branch if it exists?

Is it possible to get a build of all the projects but use the feature branch if it exists? If i set the branch name for project A and it doesn't exist does it default back to an existing branch? I shall try this..

Im trying to adopt the gitflow workflow. Is this something anyone has achieved before?

Any help is much appreciated!

Thanks in advance
Justin Crowe

UPDATE This was an error on my part, See further issue in post 2..

6 comments
Comment actions Permalink

Actually i setup the dependencies incorrectly here. After fixing it, it now appears to work.

Commits to Proj B produce a correctly labelled feature branch build in Proj A, even though A isnt branched. Great.

But i still have the issue where if Proj A master is built it uses the nuget package from Proj B feature because it has a higher number..

So, I set the dependency options and checked "Do not run new build if there is a suitable one" & "only use successful builds from suitable ones"

Ok, a hotfix is committed to master of Proj A:

Now, when i commit the hotfix. Proj B then rebuilds on master. not sure why?, there are no changes in master of Proj B (only the feature branch has been changing) so can TC not use the latest master build for Proj B instead of having to rebuild? the rebuild causes an incremented version number and so indicated that a change has occured in Proj B when it hasn't.

Have i done something wrong with the dependencies?



Im thinking i will have to have 3 separate build configurations for each project? Develop/feature, release and master. That's a bit annoying. I have over 50 projects...

Again, any help would be appreciated.

0
Comment actions Permalink

Hi, guys. Do you have any suggestions on this?

Master rebuilds even if there are no changes?

Thanks

0
Comment actions Permalink

Hi Justin,

1. How feature branches work if dependencies are configured: https://confluence.jetbrains.com/display/TCD9/Working+with+Feature+Branches#WorkingwithFeatureBranches-Dependencies
2. In your example A snapshot-depends on B, is it right? Do A and B build configurations use the same VCS roots? What triggers do you have configured?

0
Comment actions Permalink

Hi

In my example

Proj A depends on Proj B. They use different VCS roots in Stash but they are both configured to monitor all branches related to GitFlow for their VCS roots.

Proj A has a snapshot dependency on Proj B, set up as follows:

dependency.PNG

It also has two triggers.

A VCS trigger (used the default settings):

vcsTrigger.PNG

and a Finished Build trigger for project B (used default settings)

finishBuildTrigger.PNG

Is this the problem of combining the triggers for all branches? I need to have seperate triggers per branch?

Thanks for the help!
Justin

0
Comment actions Permalink

Hi Justin,

Could you please check the "triggeredBy" parameter of build B that you did not expect to trigger?
You probably can simplify your setup and configure the following triggers: no triggers for build configuration B, for A build configuration VCS trigger with option "Trigger a build on changes in snapshot dependencies". In this case the build chain will rebuild if there are commits to A or B VCS root. Please see an example in this section.

0
Comment actions Permalink

Hi Alina

I changed my triggers as you suggested but i still get the rebuild of project B. Sorry, but where do i find the "triggeredBy" parameter?

I now also don't get feature branch builds going up the dependency chain anymore :( im back to square one. So when i feature branch Proj A and commit to don't get a corresponding feature branch build of Proj B that uses it.

Any ideas? or am i trying to set up something that won't work?

0

Please sign in to leave a comment.