Ignore changes for merged github branches

Hello,

We have TeamCity configured with a VCS root connected to a GitHub repo with the +:refs/pull/(*/merge) branch specification for building pull requests. Is there a way of configuring the VCS root to only track changes for Pull Request branches that have not already been merged?

The issue we are having is that we have around 4000 total pull requests in GitHub where only ~30 pull requests are active (open) at a given time and it takes ~3 minutes to collect the changes for ~1500 of these branches (some of these are almost 2 years old), even though we are only interested in the active ones.

Below is an example from the VCS log for one check for changes:

[2014-10-06 14:18:23,771]   INFO [l executor 9808] -      jetbrains.buildServer.VCS - Finish collecting changes successfully for VCS root "AquariusPullRequestVCSMerge" 
{instance id=39, parent internal id=1, parent id=Aquarius_AquariusPullRequestVCSMerge, description: "git@github.com:AquaticInformatics/Aquarius.git#develop"}
from state RepositoryStateImpl {defaultBranch=refs/heads/develop,branchRevisions={refs/heads/develop: 743dd61b911da20584874a59913bf390f1e847c3, refs/pull/1/merge: 3a4df00175c1ee9c30b114ae02a1717a7b2fd83e, refs/pull/10/merge: 21306d70b309530d628e2642b26a3df06b60668b, refs/pull/100/merge: bbfac5703e99f1a28c110b89f64f564e7bbf1f95, refs/pull/1000/merge: cadeb2f5bb706c2c2fd3c45bd5364c0aa53a208b, refs/pull/1001/merge: ac16079926f457025ed4c4c2f4c59a0b49aeb9fc, refs/pull/1002/merge: e9a0a13f1d688b1421040595fdf9754a51fc7fcf, refs/pull/1003/merge: 0d70e5b08ec8c7c9d46b21750ffc56e81dd7349f, refs/pull/1004/merge: 2ea63086ebccca92ad3850b6d29c0cdc3a00b756, refs/pull/1005/merge: af54539a905694437ec4d9bea893e31374c41efa, refs/pull/1006/merge: 49417aa7584094deafa9f52496e583e68a065ee8, refs/pull/1007/merge: 0296232ec9016c6098e345d0f6c2d76441731a3e, refs/pull/1008/merge: a733d1fd03f921cd65f6e02d7886b13ee24dbd52, refs/pull/1009/merge: 3b37fbf41c50660f59334c4a1aa6aa014083988d, refs/pull/101/merge: 7e227639d503c0a6de2907de939f0e64213c5e9f, refs/pull/1010/merge: 4f6226066b600bfb42a3baeab481275c20b887ea, refs/pull/1011/merge: 9aa66157b079463a2bef49d2d9673a0148eb28bb, refs/pull/1012/merge: 9dbcec145814ffd7327989e40f44a1a51351561c, refs/pull/1013/merge: 4192a5b8ffa2f999440ddbc4582fb708cdbf3a78, refs/pull/1014/merge: 4d0a8a6f23993d4fb59f29e8a0673333634d9dff, refs/pull/1015/merge: 8fef703c0139c9ba73bda35b58e1dfd67d6b606a, refs/pull/1016/merge: dddb10f0fb461915013532943a680ae73c8730c5, refs/pull/1017/merge: 18ef5c382a6d191a1fd41579ef4d2f4ab56bdc07, refs/pull/1018/merge: 943d6aa3c72f33147816a1e6da7358824fb88b29, refs/pull/1019/merge: ca2db10439ef7130c5df8139dd82eaafa261cdaa, refs/pull/102/merge: 1bbb2548302ff4b3be132a3bec14d921740a4fd8, refs/pull/1020/merge: 185fd9291c5a564bcb348602095b95644ec3f10f, refs/pull/1021/merge: bcfe2ba62a3d16de72ed96cba4af778bdb1c72fb, refs/pull/1022/merge: 3dda886d34b4e0dbed94b369b32ec9f1fd2ae40b, refs/pull/1023/merge: 68e2bbdcc6970ec474578316335006ebfd4d16ee, refs/pull/1024/merge: b05ba1e526df9c004eef21247cf6ed4f733f6c33, refs/pull/1025/merge: e1d290ecb84d4425a5938cf719a7b2a886171c2e, refs/pull/1026/merge: 11ee7fa3a4238338ceabd40e9970d127c8a372f8, refs/pull/1027/merge: 57312555627d43b545c338cbe91e2c1e7aa2d216, refs/pull/1028/merge: 2bebac8e07497c2e4f46941febcb886f52df4119, refs/pull/1029/merge: 8fef88082597bfbb03e2c8574e5524282d927242, refs/pull/103/merge: b150ab6402cd5be7be2aaafed33df749c61cbe6c, refs/pull/1030/merge: 418e51fad78f160d7e8fb7cd9fa2686be164f69c, refs/pull/1031/merge: 08111e70a8f60a02bd512c1e962421780caedd60, refs/pull/1032/merge: 5ca85e0e9a8059450100211d23c7b09a5d92955e, refs/pull/1033/merge: 341c996b44ea55a2d1a542fc7835e22da5e3821a, refs/pull/1034/merge: 4aaad5520c95dcb89cf8843b9f39806fa044ed55, refs/pull/1035/merge: a406927c3859ac4aa12f6774ec2363cc756785de, refs/pull/1036/merge: 33b812fb4315077a3159ff14aba2cb3624f28dbc, refs/pull/1037/merge: 9657d3030cd4073f5cac884383a31fd3ace9d566, refs/pull/1038/merge: 359424525cb9937a9db48f4540b1473ac0516113, refs/pull/1039/merge: f03242e2a933874a30bbe76c9d7ad8f373a939dd, refs/pull/104/merge: 67a4e9ef1a2b183c78f58bbcbf7b1cc382546439, refs/pull/1040/merge: 40d677b783fb5180d1cb5122eca13b31fe9428bb, refs/pull/1041/merge: c18a242e597791829f27f601bf67728355eee64a, refs/pull/1042/merge: f27d832635949477edc3230df05d8237ccf5ca28, refs/pull/1043/merge: 1d89f51cf61eded88e91ed8d296e76bc5406b0c5, refs/pull/1044/merge: 90c8c551e5c1f2ed364459dca8272554d10d3095, refs/pull/1045/merge: 07ddc7847a2544077e47688cdb2c01fd88756a29, refs/pull/1046/merge: d579d5452a95284df36b1968753390fce35d9fcf, refs/pull/1047/merge: f67bbc2bc425c3ca81b8c1524c9145d99c9340d9, refs/pull/1048/merge: 3525c9c7d19b9ef3a9d8a8da443a814b1fa5852e, refs/pull/1049/merge: 5d164bdba32231ecd44d64f6883e5dae934d4ebc, refs/pull/105/merge: a2530a09dfb4cae1c1a32d9b671d0e79350b1352, refs/pull/1051/merge: a44d6e7cea9a26f9633a1fe96e1b9a35421d337c, refs/pull/1052/merge: 46171f77ceb06bd847da1d811649518afa662607, refs/pull/1053/merge: fe0e8f72ad90438e405de05500afdf0814abb300, refs/pull/1054/merge: 96825d517dd4d00a2894c5008513db5db89604c3, refs/pull/1055/merge: 1f6a681941760eb9b0a7a50b8b3e6f83c21a04c7, refs/pull/1056/merge: 4b26bf3184b31fd7793302a14bddc178a7fad975, refs/pull/1057/merge: cfc8c531fb58608ed377ec5cbc2c84ab59208e30, refs/pull/1058/merge: ae4d610dad68f478cf237d9ecd609972b1f4a387, refs/pull/1059/merge: 14ae152a1de2a93746e133e90372881da84088a3, refs/pull/106/merge: 09f7d4f5d22561a721f2788fd8a353ea9b4c1a7b, refs/pull/1060/merge: c89bfe43c2773065886d9b274f06149b27e00ace, refs/pull/1061/merge: 86159a16fdea4849a6cd3b4465ee17e91323f8db, refs/pull/1062/merge: 3fc212844eb2e2d9074f78274bbd50738716395a, refs/pull/1063/merge: 7f485a8af559b1c444be92788e50a2ffaecef602, refs/pull/1064/merge: e9ad45cd8c1e8dfd40a42f4a8e6beab3ca124599, refs/pull/1065/merge: bf4cf5969d581762579d4cf41b37d0cbd99de892, refs/pull/1066/merge: c5775b70837cbf2b70bcc35339a611a9f8c71cda, refs/pull/1067/merge: 14b0be5aba392a56eeae57dcc9949b165cae0a6a, refs/pull/1068/merge: e935d58f485e736cad8160704004e721a3d6128f, refs/pull/1069/merge: bb188199370ca3f1106187b85b037d7823ab6df9, refs/pull/107/merge: ed8ceb972870048c19d30bd6dbb956cdcb9cdf55, refs/pull/1070/merge: 5acb5fa2fffa0643188b9d5d517915bb03ae05f6, refs/pull/1071/merge: 765403a3264971d3fe3b93f1c54f6cfaa308e501, refs/pull/1072/merge: c2620eb704d39b257922ae7dd47b7901983358b8, refs/pull/1073/merge: e944462fc8dd6ceab3d9e8627858062fb711a119, refs/pull/1074/merge: 329a3708c7559e6781285035918a0c1de2f0ff09, refs/pull/1075/merge: 9cea325124b0e110922aa3dd518711128f389993, refs/pull/1076/merge: c87758da2d5b4193437c2d11ec02c38d157db908, refs/pull/1077/merge: b7fc2788afbafd879550ce5fffa497c1fa5c1d49, refs/pull/1078/merge: 6b4a43defeddc4b6b7c395a8f4795c9dded2354b, refs/pull/1079/merge: 1fcfdb0e28f4191ccb8d69e73ba545f5a7d1929a, refs/pull/108/merge: 300ddffa8de5930a82796ee1815cd02f0a55f7f9, refs/pull/1080/merge: 2213a6ff5b33ba8f4367cd32d79f561dd55580e2, refs/pull/1081/merge: c341ca376f80e6ccf9ba1f94e899417dfaee5757, refs/pull/1082/merge: 469a2f8aebf20d230375573a414fe5c52b0d3a8a, refs/pull/1083/merge: 76c8c48f26e3c2681345ce2b7c4d99f376790983, refs/pull/1084/merge: d53aca702b392d667fb5d03e5bad376627b9e5a9, refs/pull/1085/merge: 175c325d2c85edb4ea47f6e725717e30133a2552, refs/pull/1086/merge: 2bd8e4a16fdf06da9c9c9c8dfbd4ceb245e41118, refs/pull/1087/merge: 2b0182474eb75e0134cb4facb75eff007ff667bd, refs/pull/1088/merge: 797a041cf15e2e8fc872e38502265c99a7907210, ; <and 1416 more branches>}}
to state RepositoryStateImpl{defaultBranch=refs/heads/develop,branchRevisions={refs/heads/develop: 743dd61b911da20584874a59913bf390f1e847c3, refs/pull/1/merge: 3a4df00175c1ee9c30b114ae02a1717a7b2fd83e, refs/pull/10/merge: 21306d70b309530d628e2642b26a3df06b60668b, refs/pull/100/merge: bbfac5703e99f1a28c110b89f64f564e7bbf1f95, refs/pull/1000/merge: cadeb2f5bb706c2c2fd3c45bd5364c0aa53a208b, refs/pull/1001/merge: ac16079926f457025ed4c4c2f4c59a0b49aeb9fc, refs/pull/1002/merge: e9a0a13f1d688b1421040595fdf9754a51fc7fcf, refs/pull/1003/merge: 0d70e5b08ec8c7c9d46b21750ffc56e81dd7349f, refs/pull/1004/merge: 2ea63086ebccca92ad3850b6d29c0cdc3a00b756, refs/pull/1005/merge: af54539a905694437ec4d9bea893e31374c41efa, refs/pull/1006/merge: 49417aa7584094deafa9f52496e583e68a065ee8, refs/pull/1007/merge: 0296232ec9016c6098e345d0f6c2d76441731a3e, refs/pull/1008/merge: a733d1fd03f921cd65f6e02d7886b13ee24dbd52, refs/pull/1009/merge: 3b37fbf41c50660f59334c4a1aa6aa014083988d, refs/pull/101/merge: 7e227639d503c0a6de2907de939f0e64213c5e9f, refs/pull/1010/merge: 4f6226066b600bfb42a3baeab481275c20b887ea, refs/pull/1011/merge: 9aa66157b079463a2bef49d2d9673a0148eb28bb, refs/pull/1012/merge: 9dbcec145814ffd7327989e40f44a1a51351561c, refs/pull/1013/merge: 4192a5b8ffa2f999440ddbc4582fb708cdbf3a78, refs/pull/1014/merge: 4d0a8a6f23993d4fb59f29e8a0673333634d9dff, refs/pull/1015/merge: 8fef703c0139c9ba73bda35b58e1dfd67d6b606a, refs/pull/1016/merge: dddb10f0fb461915013532943a680ae73c8730c5, refs/pull/1017/merge: 18ef5c382a6d191a1fd41579ef4d2f4ab56bdc07, refs/pull/1018/merge: 943d6aa3c72f33147816a1e6da7358824fb88b29, refs/pull/1019/merge: ca2db10439ef7130c5df8139dd82eaafa261cdaa, refs/pull/102/merge: 1bbb2548302ff4b3be132a3bec14d921740a4fd8, refs/pull/1020/merge: 185fd9291c5a564bcb348602095b95644ec3f10f, refs/pull/1021/merge: bcfe2ba62a3d16de72ed96cba4af778bdb1c72fb, refs/pull/1022/merge: 3dda886d34b4e0dbed94b369b32ec9f1fd2ae40b, refs/pull/1023/merge: 68e2bbdcc6970ec474578316335006ebfd4d16ee, refs/pull/1024/merge: b05ba1e526df9c004eef21247cf6ed4f733f6c33, refs/pull/1025/merge: e1d290ecb84d4425a5938cf719a7b2a886171c2e, refs/pull/1026/merge: 11ee7fa3a4238338ceabd40e9970d127c8a372f8, refs/pull/1027/merge: 57312555627d43b545c338cbe91e2c1e7aa2d216, refs/pull/1028/merge: 2bebac8e07497c2e4f46941febcb886f52df4119, refs/pull/1029/merge: 8fef88082597bfbb03e2c8574e5524282d927242, refs/pull/103/merge: b150ab6402cd5be7be2aaafed33df749c61cbe6c, refs/pull/1030/merge: 418e51fad78f160d7e8fb7cd9fa2686be164f69c, refs/pull/1031/merge: 08111e70a8f60a02bd512c1e962421780caedd60, refs/pull/1032/merge: 5ca85e0e9a8059450100211d23c7b09a5d92955e, refs/pull/1033/merge: 341c996b44ea55a2d1a542fc7835e22da5e3821a, refs/pull/1034/merge: 4aaad5520c95dcb89cf8843b9f39806fa044ed55, refs/pull/1035/merge: a406927c3859ac4aa12f6774ec2363cc756785de, refs/pull/1036/merge: 33b812fb4315077a3159ff14aba2cb3624f28dbc, refs/pull/1037/merge: 9657d3030cd4073f5cac884383a31fd3ace9d566, refs/pull/1038/merge: 359424525cb9937a9db48f4540b1473ac0516113, refs/pull/1039/merge: f03242e2a933874a30bbe76c9d7ad8f373a939dd, refs/pull/104/merge: 67a4e9ef1a2b183c78f58bbcbf7b1cc382546439, refs/pull/1040/merge: 40d677b783fb5180d1cb5122eca13b31fe9428bb, refs/pull/1041/merge: c18a242e597791829f27f601bf67728355eee64a, refs/pull/1042/merge: f27d832635949477edc3230df05d8237ccf5ca28, refs/pull/1043/merge: 1d89f51cf61eded88e91ed8d296e76bc5406b0c5, refs/pull/1044/merge: 90c8c551e5c1f2ed364459dca8272554d10d3095, refs/pull/1045/merge: 07ddc7847a2544077e47688cdb2c01fd88756a29, refs/pull/1046/merge: d579d5452a95284df36b1968753390fce35d9fcf, refs/pull/1047/merge: f67bbc2bc425c3ca81b8c1524c9145d99c9340d9, refs/pull/1048/merge: 3525c9c7d19b9ef3a9d8a8da443a814b1fa5852e, refs/pull/1049/merge: 5d164bdba32231ecd44d64f6883e5dae934d4ebc, refs/pull/105/merge: a2530a09dfb4cae1c1a32d9b671d0e79350b1352, refs/pull/1051/merge: a44d6e7cea9a26f9633a1fe96e1b9a35421d337c, refs/pull/1052/merge: 46171f77ceb06bd847da1d811649518afa662607, refs/pull/1053/merge: fe0e8f72ad90438e405de05500afdf0814abb300, refs/pull/1054/merge: 96825d517dd4d00a2894c5008513db5db89604c3, refs/pull/1055/merge: 1f6a681941760eb9b0a7a50b8b3e6f83c21a04c7, refs/pull/1056/merge: 4b26bf3184b31fd7793302a14bddc178a7fad975, refs/pull/1057/merge: cfc8c531fb58608ed377ec5cbc2c84ab59208e30, refs/pull/1058/merge: ae4d610dad68f478cf237d9ecd609972b1f4a387, refs/pull/1059/merge: 14ae152a1de2a93746e133e90372881da84088a3, refs/pull/106/merge: 09f7d4f5d22561a721f2788fd8a353ea9b4c1a7b, refs/pull/1060/merge: c89bfe43c2773065886d9b274f06149b27e00ace, refs/pull/1061/merge: 86159a16fdea4849a6cd3b4465ee17e91323f8db, refs/pull/1062/merge: 3fc212844eb2e2d9074f78274bbd50738716395a, refs/pull/1063/merge: 7f485a8af559b1c444be92788e50a2ffaecef602, refs/pull/1064/merge: e9ad45cd8c1e8dfd40a42f4a8e6beab3ca124599, refs/pull/1065/merge: bf4cf5969d581762579d4cf41b37d0cbd99de892, refs/pull/1066/merge: c5775b70837cbf2b70bcc35339a611a9f8c71cda, refs/pull/1067/merge: 14b0be5aba392a56eeae57dcc9949b165cae0a6a, refs/pull/1068/merge: e935d58f485e736cad8160704004e721a3d6128f, refs/pull/1069/merge: bb188199370ca3f1106187b85b037d7823ab6df9, refs/pull/107/merge: ed8ceb972870048c19d30bd6dbb956cdcb9cdf55, refs/pull/1070/merge: 5acb5fa2fffa0643188b9d5d517915bb03ae05f6, refs/pull/1071/merge: 765403a3264971d3fe3b93f1c54f6cfaa308e501, refs/pull/1072/merge: c2620eb704d39b257922ae7dd47b7901983358b8, refs/pull/1073/merge: e944462fc8dd6ceab3d9e8627858062fb711a119, refs/pull/1074/merge: 329a3708c7559e6781285035918a0c1de2f0ff09, refs/pull/1075/merge: 9cea325124b0e110922aa3dd518711128f389993, refs/pull/1076/merge: c87758da2d5b4193437c2d11ec02c38d157db908, refs/pull/1077/merge: b7fc2788afbafd879550ce5fffa497c1fa5c1d49, refs/pull/1078/merge: 6b4a43defeddc4b6b7c395a8f4795c9dded2354b, refs/pull/1079/merge: 1fcfdb0e28f4191ccb8d69e73ba545f5a7d1929a, refs/pull/108/merge: 300ddffa8de5930a82796ee1815cd02f0a55f7f9, refs/pull/1080/merge: 2213a6ff5b33ba8f4367cd32d79f561dd55580e2, refs/pull/1081/merge: c341ca376f80e6ccf9ba1f94e899417dfaee5757, refs/pull/1082/merge: 469a2f8aebf20d230375573a414fe5c52b0d3a8a, refs/pull/1083/merge: 76c8c48f26e3c2681345ce2b7c4d99f376790983, refs/pull/1084/merge: d53aca702b392d667fb5d03e5bad376627b9e5a9, refs/pull/1085/merge: 175c325d2c85edb4ea47f6e725717e30133a2552, refs/pull/1086/merge: 2bd8e4a16fdf06da9c9c9c8dfbd4ceb245e41118, refs/pull/1087/merge: 2b0182474eb75e0134cb4facb75eff007ff667bd, refs/pull/1088/merge: 797a041cf15e2e8fc872e38502265c99a7907210, ; <and 1417 more branches>}};
4 changes collected 4 changes persisted, total time: 5m:48s,688ms, persisting time: 625ms


The branch 'refs/pull/1/merge' for example was merged in November 2012, and does not need to be tracked in anyway

I have attached a VCS debug log in case that helps in someway.

Thanks



Attachment(s):
teamcity-vcs.zip
3 comments
Comment actions Permalink

Hi Martin,

The closed pull requests should not slow down the process of collecting changes. Do you have git garbage collector turned on?

0
Comment actions Permalink

I don't have git gc turned on assuming you are referring to the 'teamcity.server.git.gc.enabled' setting as shown in the Git Internal Properties page

I will enable that setting and see if it makes a difference

Thank you for the response,

* update *

I have been monitoring the collection changes for the past day or so and enabling the git clean option seems to have greatly speeded things up. Most collection operations are now done in ~20 seconds down from 3~5 minutes.

Thank you for your help!
Martin

0
Comment actions Permalink

Glad it's working! Please watch/vote for related request: https://youtrack.jetbrains.com/issue/TW-14734.

0

Please sign in to leave a comment.