Build chain feature branch promotion

We are using snapshot dependencies to create a build chain. So for example we have repo A and B and B is depended on A. What I want to achieve is that when A is building an feature branch which doesn't exists on B, B doesn't get started at all. We are applying the 'teamcity.promotion.isEquivalentChecksBranch' parameter with value 'true'. We are seeing that A gets building with the feature branch and B also with the feature branch (hence it doesn't exists, and actually using the dev branch). How can we solve this issue? 

0
8 comments

Hi Martijn,

I'm not certain from your wording whether A depends on B or B depends on A. If A depends on B, then there is no way that A will start without having a vaild B to use, even if you disable the default branch on B (https://confluence.jetbrains.com/display/TCD10/Configuring+VCS+Settings#ConfiguringVCSSettings-DisableBuildinginDefaultBranch)

If B depends on A, and it's not needed to run B on some branches, then it should be pretty straightforward: set up a VCS Trigger on A that launches for the branches that should run always, and a different one on B with the branches that should only be run when required. When both triggers are triggered at the same time, the build queue will automatically drop one of the two copies of A to only build it once. You can explicitly include only the excluding branches on A, but I expect this isn't what you are looking for.

0
Avatar
Permanently deleted user

Hi Denis, 


Thanks for the response.

B (EntityFramework::Build) is depends on A (Extensions::Build). We used a snapshot dependcy on B to A (see picture below)

What the problem is, is that when we are commit a change on A which triggers a build on the branch: feature-example, it also schedules a build on B with the branch: feature-example. But feature-example doesn't exist on B. So we don't want to build B at all. 

Hopfully this explains the situation a bit more.

0

Hi Martijn, sorry for the delay on answering.

I think that my answer applies to your scenario. You could do the following:
-Set a VCS Trigger on Extensions::Build for the branches that should build A (or all builds)
-Set a VCS Trigger on EntityFramework::Build only for the branches that should build both

With that setup, Extensions::Build would trigger always and build always, but B would only get triggered for the branches you are looking to build.

Hope this makes sense.

0
Avatar
Permanently deleted user

Hi Denis,

Thanks for the response. The problem is that we are using dynamic feature branches. So we have like a trigger definition: feature-*. But i don't understand when a feature branch doesn't exists on B it suggets it's building with the branch created on A.

0

Hi Martijn,

Dynamic branches would be ok if you are able to somehow discern between the ones that should trigger B and the one who shouldn't. It would also be OK if you could discern it through any other filter applicable from the trigger, such as any comment, or specific files being altered.

When some branch that exists on one doesn't exist on the other, the second build would fall back to the default branch. I'm not fully sure I understand your last sentence "But i don't understand...". Would you mind explaining?

0
Avatar
Permanently deleted user

Hi Denis,

Thanks for the response. What I meant by the last sentence is that we are seeing builds in the build chain with a changeset of a branch that doesnt exists on that repository. Some repo's are defaulting to the default branch (dev), but some other branches checkout a really strange commit. Although, since we've updated TeamCity the results are better. But the problem is that the build chain is suggesting that a build is on a branch that doesn't exist on the repo.

0

Ah, got it now, thanks. Could you send us, using the "Submit a request" button on top, a full build log of such a build, with a screenshot of the builds page where it shows the wrong branch? If you could also attach a screenshot of the chain and mention which ones have the weird commit and what you would expect, it would be helpful as well

0
Avatar
Permanently deleted user

 

Hi Denis,

I will create a issue for this with the screenshots attached. 

Thanks, Martijn.

0

Please sign in to leave a comment.