VCS changes not detected when triggering build

We use GitHub for our repositories. We have issues on most of our builds when we trigger builds when changing pull requests (either by adding / removing commits or rebasing the pull request). TeamCity does not detect the latest change in the pull request. If I trigger it manually after it was triggered by the pull request, TeamCity does detect the changes and builds the correct version.

We are running TeamCity 2017.1.5 (build 47175) from AWS region eu-west-1. The VCS root has branch specification +:refs/(pull/*)/merge set, plus default branch refs/heads/master. We are triggering the build from a webhook in GitHub, it does a POST request to httpAuth/action.html?add2Queue={build_step_id}&branchName=pull/{pull_request_number}.

How can we make sure that if the build is triggered, the changes in the pull request will be detected in TeamCity?

4
21 comments

When pull request is updated the old commit referenced by refs/pull/../merge branch becomes unavailable and cannot be fetched. This leads to 2 kinds of errors:

1. error during changes collecting: TeamCity takes current repository state (revisions of all repository branches) and then tries to collect changes between the previous state and the new one. If branch revision is changed between these events, then changes collecting fails (https://youtrack.jetbrains.com/issue/TW-45151).

2. error during the agent side-checkout: TeamCity collected changes and computed a revision for a build, but when build starts computed commit is not available anymore and agent-side checkout fails (https://youtrack.jetbrains.com/issue/TW-31130).

We addressed both issues in TeamCity 2017.2 is to be released in a week or so. The first issue is addressed by repeating changes collection attempt in case of recoverable errors such as unavailable commit. The second issue is addressed by canceling the build instead of failing it. If you have a VCS trigger, then TeamCity will trigger build on a newer commit automatically. In TeamCity 2017.1.x you can workaround the second problem by switching to server-side checkout. If TeamCity server is able to collect changes, then it will be able to build a proper patch and transfer it to the agent. Hope it helps.

0

Thanks for your response Dmitry!

The first error you describe makes sense, we use force push to our repositories a lot. This means that the commit in the previous state is not available anymore. However, I do not see errors in the logs and builds just run without changes, they don't fail. Since we use server side checkout, the second error is probably not related.

What do you mean with 'repeating changes collection attempt'? How can I do that?

0

By 'repeating changes collection attempt' I mean that TeamCity will automatically try to collect changes again if it detects an error of the first kind. 

If I understand correctly, in your case TeamCity is able successfully collect changes and since you use a server-side checkout TeamCity can run a build on a removed commit without any problems. The problem is that TeamCity runs such redundant build, right? 

0

TeamCity is able to successfully collect changes, however it does not get the latest changes. The GitHub webhook triggers a build which indicates 'no changes' and when I redeliver the webhook (or run the build manually) it will see the latest changes and build with those.

If we use VCS root branch specification +:refs/(pull/*)/head  we don't have this issue. The GitHub webhook triggers a build with the latest changes immediately. We don't have this issue on the master branch either. It's only when we use the +:refs/(pull/*)/merge branch configuration that we have problems.

Any idea on how to fix this?

0

Could you please provide teamcity-server.log, teamcity-vcs-state.log, and teamcity-vcs.log covering the time when such build was triggered as well as a build log of the build?

0

What I see is that there is no log entry in the teamcity-vcs-state.log when such build is run. In the teamcity-vcs.log it says this:

[2017-11-22 15:40:17,664] INFO [rmal executor 1] - jetbrains.buildServer.VCS - Done requesting incremental patch for root="puppet-coolblue-php" {instance id=196, parent internal id=167, parent id=Puppet_Modules_Php_PuppetCoolbluePhpMerge, description: "https://github.com/coolblue-development/puppet-coolblue-php#refs/heads/master"}, fromVersion=83b6932382a0cbc8021381fce826a51fd7ea84b6, toVersion=83b6932382a0cbc8021381fce826a51fd7ea84b6, checkoutRules=+:=>, cleanPatch=false, buildType=Puppet :: Modules :: PHP :: Inspection {id=Puppet_Modules_Php_Inspection, internal id=bt2062}, buildId=229083; took 0 msec
host = ip-10-251-100-89 sourcetype = undefined
22/11/2017
16:40:17.664
[2017-11-22 15:40:17,664] INFO [rmal executor 1] - jetbrains.buildServer.VCS - Requesting incremental patch: root="puppet-coolblue-php" {instance id=196, parent internal id=167, parent id=Puppet_Modules_Php_PuppetCoolbluePhpMerge, description: "https://github.com/coolblue-development/puppet-coolblue-php#refs/heads/master"}, fromVersion=83b6932382a0cbc8021381fce826a51fd7ea84b6, toVersion=83b6932382a0cbc8021381fce826a51fd7ea84b6, checkoutRules=+:=>, cleanPatch=false, buildType=Puppet :: Modules :: PHP :: Inspection {id=Puppet_Modules_Php_Inspection, internal id=bt2062}, buildId=229083

TeamCity server log says this:

[2017-11-22 15:40:28,857] INFO - tbrains.buildServer.ACTIVITIES - Finished build Puppet :: Modules :: PHP :: Inspection {id=Puppet_Modules_Php_Inspection, internal id=bt2062} #413 {build id=229083, promotion id=229083, branch=pull/95, history=false, agent="onprem-01" {id=149}, triggered by "'github-webhook' (Github Webhook) {id=2}" (##userId='2' type='user'). Started 2017-11-22 15:40:17.005, running}
host = ip-10-251-100-89 source = /opt/jetbrains/TeamCity/logs/teamcity-server.log sourcetype = undefined
22/11/2017
16:40:28.770
[2017-11-22 15:40:28,770] INFO - ndexer.EventBasedBuildsIndexer - Indexing finishing build: #413 {build id=229083, buildTypeId=Puppet_Modules_Php_Inspection}
host = ip-10-251-100-89 source = /opt/jetbrains/TeamCity/logs/teamcity-server.log sourcetype = undefined
22/11/2017
16:40:28.724
[2017-11-22 15:40:28,724] INFO - jetbrains.buildServer.SERVER - Build finished received for build: #413 {build id=229083, buildTypeId=Puppet_Modules_Php_Inspection}
host = ip-10-251-100-89 source = /opt/jetbrains/TeamCity/logs/teamcity-server.log sourcetype = undefined
22/11/2017
16:40:13.843
[2017-11-22 15:40:13,843] INFO - tbrains.buildServer.ACTIVITIES - Build started; Puppet :: Modules :: PHP :: Inspection {id=Puppet_Modules_Php_Inspection, internal id=bt2062} #413 {build id=229083, promotion id=229083, branch=pull/95, history=false, agent="onprem-01" {id=149}, triggered by "'github-webhook' (Github Webhook) {id=2}" (##userId='2' type='user'). Started 2017-11-22 15:40:13.784, running}
host = ip-10-251-100-89 source = /opt/jetbrains/TeamCity/logs/teamcity-server.log sourcetype = undefined
22/11/2017
16:40:13.289
[2017-11-22 15:40:13,289] INFO - tbrains.buildServer.ACTIVITIES - Build added to queue; Queued build {Build promotion {promotion id=229083, configuration={id=Puppet_Modules_Php_Inspection, internal id=bt2062}, branch=pull/95, queued}, triggered by "Github Webhook"}
host = ip-10-251-100-89 source = /opt/jetbrains/TeamCity/logs/teamcity-server.log sourcetype = undefined
22/11/2017
16:40:13.231
[2017-11-22 15:40:13,231] INFO - ity.BuildQueuePriorityOrdering - New item Queued build {Build promotion {promotion id=229083, configuration={id=Puppet_Modules_Php_Inspection, internal id=bt2062}}, item id=229083} with weight 0.00 inserted at the default position 0 in the end of the queue

NOTE: since logs are from our log collector, read from bottom up

0

btw when I run it manually, I do get an entry in the teamcity-vcs-state.log

0

Could you please provide a build log which didn't take the latest changes?

0

Sure, this is the build log. I've removed the stack traces of all of the failed tests:

Build 'Puppet :: Modules :: PHP :: Inspection' #413, branch 'pull/95'
Started 2017-11-22 16:40:17 on 'onprem-01' by 'Github Webhook (github-webhook)'
Finished 2017-11-22 16:40:28 with status FAILURE 'Tests failed: 44, passed: 1'
VCS revisions: 'puppet-coolblue-php' (Git): 83b6932382a0cbc8021381fce826a51fd7ea84b6 (branch 'refs/pull/95/merge')
TeamCity URL https://teamcity.coolblue.eu/viewLog.html?buildId=229083&buildTypeId=Puppet_Modules_Php_Inspection
TeamCity server version is 2017.1.5 (build 47175), server timezone: UTC

[16:40:13]E: bt2062 (15s)
[16:40:13]i: TeamCity server version is 2017.1.5 (build 47175)
[16:40:13] : The build is removed from the queue to be prepared for the start
[16:40:13] : Collecting changes in 1 VCS root (1s)
[16:40:13] : [Collecting changes in 1 VCS root] VCS Root details
[16:40:13] : [VCS Root details] "puppet-coolblue-php" {instance id=196, parent internal id=167, parent id=Puppet_Modules_Php_PuppetCoolbluePhpMerge, description: "https://github.com/coolblue-development/puppet-coolblue-php#refs/heads/master"}
[16:40:14]i: [Collecting changes in 1 VCS root] Detecting changes in VCS root 'puppet-coolblue-php' (used in 'Inspection')
[16:40:14]i: [Collecting changes in 1 VCS root] Will collect changes for 'puppet-coolblue-php' starting from revision 359d26a7c58ebeaa7f5ee1f1f1159428f659eaec
[16:40:14] : [Collecting changes in 1 VCS root] Compute revision for 'puppet-coolblue-php'
[16:40:14] : [Compute revision for 'puppet-coolblue-php'] Upper limit revision: 83b6932382a0cbc8021381fce826a51fd7ea84b6
[16:40:14]i: [Compute revision for 'puppet-coolblue-php'] MaxModId = 470912
[16:40:14] : [Compute revision for 'puppet-coolblue-php'] Latest commit attached to build configuration: 83b6932382a0cbc8021381fce826a51fd7ea84b6
[16:40:14] : [Compute revision for 'puppet-coolblue-php'] Computed revision: 83b6932382a0cbc8021381fce826a51fd7ea84b6
[16:40:15] : Starting the build on the agent onprem-01
[16:40:17]i: Agent time zone: Europe/Amsterdam
[16:40:17]i: Agent is running under JRE: 1.8.0_151-b12
[16:40:18] : Clearing temporary directory: /var/lib/teamcity-agent/temp/buildTmp
[16:40:18] : Publishing internal artifacts
[16:40:18] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[16:40:18] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[16:40:18] : Using vcs information from agent file: ac08a8cf4b043f0b.xml
[16:40:18] : Checkout directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:18] : Updating sources: server side checkout
[16:40:17] : [Updating sources] Building incremental patch for VCS root: puppet-coolblue-php; checkout rules: =>; revision: 83b6932382a0cbc8021381fce826a51fd7ea84b6 --> 83b6932382a0cbc8021381fce826a51fd7ea84b6
[16:40:18] : [Updating sources] Repository sources transferred (3 B)
[16:40:18] : Build preparation done
[16:40:18] : Step 1/5: Bundle install (Command Line)
[16:40:18] : [Step 1/5] Starting: /usr/local/bin/bundle install --binstubs --deployment
[16:40:18] : [Step 1/5] in directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:18] : [Step 1/5] The latest bundler is 1.16.0, but you are currently running 1.15.4.
[16:40:18] : [Step 1/5] To update, run `gem install bundler`
[16:40:18] : [Step 1/5] Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
[16:40:18] : [Step 1/5] Using rake 10.4.2
[16:40:18] : [Step 1/5] Using CFPropertyList 2.2.8
[16:40:18] : [Step 1/5] Using i18n 0.7.0
[16:40:18] : [Step 1/5] Using json 1.8.3
[16:40:18] : [Step 1/5] Using minitest 5.8.3
[16:40:18] : [Step 1/5] Using thread_safe 0.3.5
[16:40:18] : [Step 1/5] Using builder 3.2.2
[16:40:18] : [Step 1/5] Using bundler 1.15.4
[16:40:18] : [Step 1/5] Using colorize 0.7.7
[16:40:18] : [Step 1/5] Using deep_merge 1.0.1
[16:40:18] : [Step 1/5] Using diff-lcs 1.2.5
[16:40:18] : [Step 1/5] Using facter 2.4.4
[16:40:18] : [Step 1/5] Using multipart-post 2.0.0
[16:40:18] : [Step 1/5] Using multi_json 1.11.2
[16:40:18] : [Step 1/5] Using json_pure 1.8.3
[16:40:18] : [Step 1/5] Using highline 1.6.21
[16:40:18] : [Step 1/5] Using trollop 2.1.2
[16:40:18] : [Step 1/5] Using thor 0.19.1
[16:40:18] : [Step 1/5] Using rsync 1.0.9
[16:40:18] : [Step 1/5] Using metaclass 0.0.4
[16:40:18] : [Step 1/5] Using puppet-lint 1.1.0 from https://github.com/rodjek/puppet-lint.git (at master@2546fed)
[16:40:18] : [Step 1/5] Using rspec-support 3.4.1
[16:40:18] : [Step 1/5] Using rspec-puppet-utils 2.2.1
[16:40:18] : [Step 1/5] Using puppet-syntax 2.0.0
[16:40:18] : [Step 1/5] Using spdx-licenses 1.0.0
[16:40:18] : [Step 1/5] Using tzinfo 1.2.2
[16:40:18] : [Step 1/5] Using faraday 0.9.2
[16:40:18] : [Step 1/5] Using hiera 1.3.4
[16:40:18] : [Step 1/5] Using hiera-eyaml 2.0.8
[16:40:18] : [Step 1/5] Using librarianp 0.6.3
[16:40:18] : [Step 1/5] Using mocha 1.1.0
[16:40:18] : [Step 1/5] Using puppet-lint-absolute_classname-check 0.1.3
[16:40:18] : [Step 1/5] Using puppet-lint-file_ensure-check 0.2.1
[16:40:18] : [Step 1/5] Using puppet-lint-file_source_rights-check 0.1.0
[16:40:18] : [Step 1/5] Using puppet-lint-leading_zero-check 0.1.0
[16:40:18] : [Step 1/5] Using puppet-lint-strict_indent-check 2.0.1
[16:40:18] : [Step 1/5] Using puppet-lint-trailing_comma-check 0.3.1
[16:40:18] : [Step 1/5] Using puppet-lint-trailing_newline-check 1.0.0
[16:40:18] : [Step 1/5] Using puppet-lint-unquoted_string-check 0.2.5
[16:40:18] : [Step 1/5] Using puppet-lint-variable_contains_upcase 1.0.0
[16:40:18] : [Step 1/5] Using rspec-core 3.4.1
[16:40:18] : [Step 1/5] Using rspec-expectations 3.4.0
[16:40:18] : [Step 1/5] Using rspec-mocks 3.4.0
[16:40:18] : [Step 1/5] Using metadata-json-lint 0.0.11
[16:40:18] : [Step 1/5] Using activesupport 4.2.5
[16:40:18] : [Step 1/5] Using puppet 3.8.4
[16:40:18] : [Step 1/5] Using rspec 3.4.0
[16:40:18] : [Step 1/5] Using activemodel 4.2.5
[16:40:18] : [Step 1/5] Using rspec-puppet 2.2.0
[16:40:18] : [Step 1/5] Using her 0.6.8
[16:40:18] : [Step 1/5] Using puppetlabs_spec_helper 1.0.1
[16:40:18] : [Step 1/5] Using puppet_forge 1.0.5
[16:40:18] : [Step 1/5] Using librarian-puppet 2.2.1
[16:40:18] : [Step 1/5] Bundle complete! 19 Gemfile dependencies, 53 gems now installed.
[16:40:18] : [Step 1/5] Bundled gems are installed into ./vendor/bundle.
[16:40:18] : [Step 1/5] Process exited with code 0
[16:40:19]W: Step 2/5: Validate metadata.json (Rake)
[16:40:19] : [Step 2/5] Starting: /usr/bin/ruby /usr/share/teamcity-agent/plugins/rake-runner/rb/runner/rakerunner.rb metadata
[16:40:19] : [Step 2/5] in directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:19] : [Step 2/5]
[16:40:19]W: [Step 2/5] Execute metadata
[16:40:19]W: [Execute metadata] metadata-json-lint metadata.json
[16:40:19] : [Execute metadata]
[16:40:19] : [Step 2/5] Process exited with code 0
[16:40:19]W: Step 3/5: Syntax (Rake)
[16:40:20] : [Step 3/5] Starting: /usr/bin/ruby /usr/share/teamcity-agent/plugins/rake-runner/rb/runner/rakerunner.rb syntax:templates syntax:hiera
[16:40:20] : [Step 3/5] in directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:20]W: [Step 3/5] ---> syntax:templates
[16:40:20] : [Step 3/5]
[16:40:20] : [Step 3/5] Execute syntax:templates
[16:40:20] : [Execute syntax:templates]
[16:40:20] : [Step 3/5]
[16:40:20]W: [Step 3/5] ---> syntax:hiera:yaml
[16:40:20] : [Step 3/5] Execute syntax:hiera:yaml
[16:40:20] : [Execute syntax:hiera:yaml]
[16:40:20] : [Step 3/5]
[16:40:20] : [Step 3/5] Execute syntax:hiera
[16:40:20] : [Execute syntax:hiera]
[16:40:20] : [Step 3/5] Process exited with code 0
[16:40:20] : Step 4/5: Puppet lint (Rake) (1s)
[16:40:20] : [Step 4/5] Starting: /usr/bin/ruby /usr/share/teamcity-agent/plugins/rake-runner/rb/runner/rakerunner.rb puppet:lint
[16:40:20] : [Step 4/5] in directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:20] : [Step 4/5]
[16:40:20] : [Step 4/5] Execute puppet:lint (1s)
[16:40:22] : [Execute puppet:lint]
[16:40:22] : [Step 4/5] Process exited with code 0
[16:40:22]E: Step 5/5: RSpec tests (Rake) (6s)
[16:40:22] : [Step 5/5] RSpec Options: --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
[16:40:22] : [Step 5/5] Starting: /usr/bin/ruby /usr/share/teamcity-agent/plugins/rake-runner/rb/runner/rakerunner.rb spec
[16:40:22] : [Step 5/5] in directory: /var/lib/teamcity-agent/work/ac08a8cf4b043f0b
[16:40:22] : [Step 5/5]
[16:40:22]F: [Step 5/5] Execute spec (5s)
[16:40:27]E: [Step 5/5] Failed tests detected
<<<<<<<<<<<<
NOTE: STACK TRACES AND TEST RESULTS OMITTED FROM OUTPUT
>>>>>>>>>>>>
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec_standalone] 45 examples, 44 failures, 1 passed
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec_standalone] Finished in 2.969510471 seconds
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec_standalone] Total resources: 0
[16:40:28] : [Execute spec_standalone] Touched resources: 0
[16:40:28] : [Execute spec_standalone] Resource coverage: NaN%
[16:40:28] : [Execute spec_standalone] Untouched resources:
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec_standalone]
[16:40:28] : [Execute spec]
[16:40:28] : [Execute spec] Execute spec_clean
[16:40:28] : [Execute spec_clean]
[16:40:28] : [Execute spec]
[16:40:28] : [Step 5/5] Process exited with code 0
[16:40:28] : Publishing internal artifacts
[16:40:29] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[16:40:29] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[16:40:28] : Build finished

0

Judging by the build log the 'refs/pull/95/merge' branch was pointing to the revision '83b6932382a0cbc8021381fce826a51fd7ea84b6' when the build started and TeamCity uses this revision...

0

Well yes and that is indeed the problem. We found out that GitHub can take up to 2 minutes to update the merge branch. It looks like the merge branch is updated asynchronously by GitHub, which makes this branch useless when using their webhook. In the payload that GitHub sends in the webhook you can actually see that the merge_commit_sha has not been updated (yet).

0

We have been testing locally with `git ls-remote upstream | grep '\95\' ` to see what the merge commit sha is after we update a pull request. There we see that the merge commit sha isn't being updated. However, just after TeamCity starts a build, we do see it is updated. Do you have any idea what could cause this? It looks like some kind of caching at GitHub side, but we can't figure it out

0

Not sure how TeamCity build can affect refs caches in Github. As far as I know Github treats refs/pull/*/merge refs as internal refs not supposed for external use. In the past I've seen that the PR merge revision was updated on PR open/close and if I'm not mistaken on comment in PR as well. Maybe this was changed and now the revision is updated less often and cached more aggressively. If you find a reason for stale revision in Github and how to avoid it, please share.

0

We have found out how TeamCity can affect the refs/pull/*/merge refs. According to this article https://github.community/t5/How-to-use-Git-and-GitHub/Issue-with-fetching-the-latest-PR-commits/td-p/275 the merge ref is updated lazily. We have enabled the build feature 'Report change status to GitHub'. This changes the status of the PR, which triggers the update of the refs/pull/*/merge refs. 

We aren't sure how to fix the problem, but we are sure we've now found the root cause of our problem.

0

Looks like Github support doesn't recommend using the PR merge branches. I can only recommend the same: use PR head branches instead. 

0

We have changed the branch specification on one of our projects. Unfortunately this led to thousands of new builds being queued because TeamCity detected changes in the head of (already closed) pull request branches. Is there a way to mitigate this?

Since we have hundreds of projects we don't see a way now to update the branch specification in an automated way. That will add so many builds to the queue that normal deployments will grind to a halt.

0

This shouldn't happen, please provide teamcity-vcs.logs and teamcity-vcs-states.logs from TeamCity server machine.

0

I've changed the branch specification on one of our projects today. The default branch is unchanged: refs/heads/master. And I have updated the branch specification from +:refs/pull/*/merge to +:refs/pull/*/head. This is what the teamcity-vcs-states.log says:

15/12/2017

11:40:17.714

[2017-12-15 10:40:17,714]   INFO [ic executor 471] - tbrains.buildServer.VCS_STATES - Finish collecting changes successfully for VCS root "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"} from state RepositoryState{defaultBranch='refs/heads/master', revisions={refs/heads/master: 727eb3c99be733d290f9726dd5222dfb04a0f52a, refs/pull/101/merge: dd58d7a2c343250ecfb523d4334679f0339cc4ad, refs/pull/103/merge: f7a44e8a4e4f0be4dab03c5573f77a8ea0182e34, refs/pull/111/merge: a8b79c3e0a4bf405e7ae3a1df068c75b00166dee, refs/pull/123/merge: 312478c56a3322b83109ed8c40e05b514c1f243b, refs/pull/129/merge: c5b8a8f0484c94d03a8e776dd24c47eb63149fd9, refs/pull/138/merge: cf26ed8bfd52b57efda0f773e60883b9d4e482ca, refs/pull/158/merge: a6fe0e14cc00eda361e105c6a826887bffa6522b, refs/pull/186/merge: 3b1128b6aab03d95aa1f1bb6642ca2a62fee6ed7, refs/pull/195/merge: 0d3d3ddccf5c1766abf36e0a33798dd33a4134fb, refs/pull/21/merge: 18aad8acf69008a602391e8c14aa556c2e8a3087, refs/pull/277/merge: 43895015906299b29de85e91e1977b56407f92ba, refs/pull/301/merge: afaa1bf8307b0a053b8384a47d16c86adc41243f, refs/pull/314/merge: e28c423b2e3cc6ef279617407ea80ee57b3a6bba, refs/pull/42/merge: c1dac1e12fc5e857fb3b3b8b4a561768c452221c, refs/pull/90/merge: 22b0a7b3e0dff13511dd8fbf01a78b4f2b57b782}} to state RepositoryState{defaultBranch='refs/heads/master', revisions={refs/heads/master: 727eb3c99be733d290f9726dd5222dfb04a0f52a, refs/pull/101/merge: null, refs/pull/103/merge: null, refs/pull/111/merge: null, refs/pull/123/merge: null, refs/pull/129/merge: null, refs/pull/138/merge: null, refs/pull/158/merge: null, refs/pull/186/merge: null, refs/pull/195/merge: null, refs/pull/21/merge: null, refs/pull/277/merge: null, refs/pull/301/merge: null, refs/pull/314/merge: null, refs/pull/42/merge: null, refs/pull/90/merge: null}}; 0 changes collected 0 changes persisted, total time: 5ms, persisting time: < 1ms • host = ip-XXX

15/12/2017

11:40:17.708

[2017-12-15 10:40:17,708]   INFO [ic executor 471] - tbrains.buildServer.VCS_STATES - Collecting changes for VCS root "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"} from state RepositoryState{defaultBranch='refs/heads/master', revisions={refs/heads/master: 727eb3c99be733d290f9726dd5222dfb04a0f52a, refs/pull/101/merge: dd58d7a2c343250ecfb523d4334679f0339cc4ad, refs/pull/103/merge: f7a44e8a4e4f0be4dab03c5573f77a8ea0182e34, refs/pull/111/merge: a8b79c3e0a4bf405e7ae3a1df068c75b00166dee, refs/pull/123/merge: 312478c56a3322b83109ed8c40e05b514c1f243b, refs/pull/129/merge: c5b8a8f0484c94d03a8e776dd24c47eb63149fd9, refs/pull/138/merge: cf26ed8bfd52b57efda0f773e60883b9d4e482ca, refs/pull/158/merge: a6fe0e14cc00eda361e105c6a826887bffa6522b, refs/pull/186/merge: 3b1128b6aab03d95aa1f1bb6642ca2a62fee6ed7, refs/pull/195/merge: 0d3d3ddccf5c1766abf36e0a33798dd33a4134fb, refs/pull/21/merge: 18aad8acf69008a602391e8c14aa556c2e8a3087, refs/pull/277/merge: 43895015906299b29de85e91e1977b56407f92ba, refs/pull/301/merge: afaa1bf8307b0a053b8384a47d16c86adc41243f, refs/pull/314/merge: e28c423b2e3cc6ef279617407ea80ee57b3a6bba, refs/pull/42/merge: c1dac1e12fc5e857fb3b3b8b4a561768c452221c, refs/pull/90/merge: 22b0a7b3e0dff13511dd8fbf01a78b4f2b57b782}} to state RepositoryState{defaultBranch='refs/heads/master', revisions={refs/heads/master: 727eb3c99be733d290f9726dd5222dfb04a0f52a, refs/pull/101/merge: null, refs/pull/103/merge: null, refs/pull/111/merge: null, refs/pull/123/merge: null, refs/pull/129/merge: null, refs/pull/138/merge: null, refs/pull/158/merge: null, refs/pull/186/merge: null, refs/pull/195/merge: null, refs/pull/21/merge: null, refs/pull/277/merge: null, refs/pull/301/merge: null, refs/pull/314/merge: null, refs/pull/42/merge: null, refs/pull/90/merge: null}}

There were a lot of builds triggered, it even contained the very first pull request! A snippet from the teamcity-vcs.log:

 

15/12/2017

11:40:56.409

[2017-12-15 10:40:56,409]   INFO [rmal executor 6] -      jetbrains.buildServer.VCS - Done requesting clean patch for root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, toVersion=587e7f0bf79f2599af86b015967b8aa513d7d123, checkoutRules=+:=>, cleanPatch=true, buildType=Puppet :: Modules :: Webshop :: Inspection {id=Puppet_Modules_Webshop_Inspection, internal id=bt2021}, buildId=312812; took 579 msec • host = ip 

15/12/2017

11:40:55.831

[2017-12-15 10:40:55,831]   INFO [rmal executor 6] - atch.GitPatchBuilderDispatcher - Build patch in separate process, root: "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, fromRevision: null, toRevision: 587e7f0bf79f2599af86b015967b8aa513d7d123 • host = ip-

15/12/2017

11:40:55.830

[2017-12-15 10:40:55,830]   INFO [rmal executor 6] - Triggers.vcs.git.GitVcsSupport - Build patch in VCS root "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"} to revision 587e7f0bf79f2599af86b015967b8aa513d7d123 • host = ip-

15/12/2017

11:40:55.830

[2017-12-15 10:40:55,830]   INFO [rmal executor 6] -      jetbrains.buildServer.VCS - Building clean patch because cached version is newer: root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, fromVersion=727eb3c99be733d290f9726dd5222dfb04a0f52a, toVersion=587e7f0bf79f2599af86b015967b8aa513d7d123, checkoutRules=+:=> • host = ip-

15/12/2017

11:40:55.829

[2017-12-15 10:40:55,829]   INFO [rmal executor 6] -      jetbrains.buildServer.VCS - Requesting clean patch: root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, toVersion=587e7f0bf79f2599af86b015967b8aa513d7d123, checkoutRules=+:=>, cleanPatch=true, buildType=Puppet :: Modules :: Webshop :: Inspection {id=Puppet_Modules_Webshop_Inspection, internal id=bt2021}, buildId=312812 • host = ip- source = /opt/jetbrains/TeamCity/logs/teamcity-vcs.log • sourcetype = undefined

15/12/2017

11:40:40.430

[2017-12-15 10:40:40,430]   INFO [rmal executor 8] -      jetbrains.buildServer.VCS - Done requesting clean patch for root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, toVersion=9292aead16974ab70746ed03f5295489c3ce04d4, checkoutRules=+:=>, cleanPatch=true, buildType=Puppet :: Modules :: Webshop :: Inspection {id=Puppet_Modules_Webshop_Inspection, internal id=bt2021}, buildId=312811; took 717 msec • host = ip-10-

15/12/2017

11:40:39.715

[2017-12-15 10:40:39,715]   INFO [rmal executor 8] - atch.GitPatchBuilderDispatcher - Build patch in separate process, root: "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, fromRevision: null, toRevision: 9292aead16974ab70746ed03f5295489c3ce04d4 • host = ip-10-

15/12/2017

11:40:39.713

[2017-12-15 10:40:39,713]   INFO [rmal executor 8] - Triggers.vcs.git.GitVcsSupport - Build patch in VCS root "puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"} to revision 9292aead16974ab70746ed03f5295489c3ce04d4 • host = ip-

15/12/2017

11:40:39.713

[2017-12-15 10:40:39,713]   INFO [rmal executor 8] -      jetbrains.buildServer.VCS - Building clean patch because cached version is newer: root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, fromVersion=727eb3c99be733d290f9726dd5222dfb04a0f52a, toVersion=9292aead16974ab70746ed03f5295489c3ce04d4, checkoutRules=+:=> • host = ip-10-

15/12/2017

11:40:39.713

[2017-12-15 10:40:39,713]   INFO [rmal executor 8] -      jetbrains.buildServer.VCS - Requesting clean patch: root="puppet-coolblue-webshop (Merge)" {instance id=170, parent internal id=145, parent id=Puppet_Modules_Webshop_PuppetCoolblueWebshopMerge, description: "https://github.com/coolblue-development/puppet-coolblue-webshop#refs/heads/master"}, toVersion=9292aead16974ab70746ed03f5295489c3ce04d4, checkoutRules=+:=>, cleanPatch=true, buildType=Puppet :: Modules :: Webshop :: Inspection {id=Puppet_Modules_Webshop_Inspection, internal id=bt2021}, buildId=312811

And the list in logs goes on and on after this.... 

0

Please check if changing the branch specification to 

+:refs/pull/(*/head)

helps. With the +:refs/pull/*/head you got the same logical branch names as before and it looks like VCS trigger thinks that the revision of the branch changed, that's why it triggers the build. Another workaround is to disable the trigger, change the branch specification and then enable the trigger again.

0

Changing the branch specification doesn't work. Disabling the VCS trigger does work. Thanks Dmitry for your help!

0

I have committed some code to branch but after giving build no changes happened in teamcity build i have the ref/head/branch name also can you assist me regarding this,But build successfully  completed without any errors but nothing changes reflected in the build and aslo disabled and enable the triggers aslo but no changes 

0

Please sign in to leave a comment.