Restricting what counts as a pending change when using agent-side checkout with git

We're using git and have recently moved from server-side to agent-side checkout to improve performance. As part of the move we removed our checkout rules as git only supports checking out the whole repo.

We have a range of builds that compile various parts of the repository, and have set up VCS triggers to only trigger those builds when the source change is somewhere that can impact the build.

The issue is that because we can't have checkout rules, all changes in the repo are shown as "pending" for every build. At best this is confusing: changes to unrelated areas of the repo will show as pending for each build. At worst it causes unnecessary builds when using snapshot dependencies built from the same chain since if any change has been made in the repo since the last time the dependency was built, it will show as a pending change and require a rebuild, even if the change was unrelated.

Is there any way to restrict the areas of the repo that are watched for pending changes when using agent-side checkout using git, or is this only possible with server-side checkout?

5 comments
Comment actions Permalink

Hi Richard,

You can use +: checkout rule, only "exclude" rules are not supported.
Also we have the related feature request https://youtrack.jetbrains.com/issue/TW-38926, please watch/vote for it.

0
Comment actions Permalink

Hi Alina,

Thanks for the response. Using a +: checkout rule gives the following error message:

Failed to perform checkout on agent: Agent checkout for the git supports only include rule of form '. => subdir', rule 'abc=>abc' for VCS Root 'xyz' is not supported

0
Comment actions Permalink

Richard,

I am awfully sorry for misleading information. Exclude/include checkout rules don't work for Git and Mercurial in case of agent-side checkout. We have the related issue https://youtrack.jetbrains.com/issue/TW-15746, please vote.
The current workarounds are to split your project into different git repositories or to use server-side checkout.

0
Comment actions Permalink

No problems, I'll vote for the issue. Thanks for your help.

0
Comment actions Permalink

We're currently using TeamCity 9.1.6 with SVN and server-side checkout. However, we're looking to move to Git in the near future and must use Git LFS for our binary files. It's my understanding that to use Git LFS with TeamCity, we must use agent-side checkout. In 9.1.6, for our agent-side VCS checkout rules, it appears we still have to map the entire Git repository and any commit within the repo will trigger a build for all configurations using the same VCS root. As Richard noted, if I use trigger rules, all changes in the repo are shown as "pending" for every build.

Based on the documentation, it appears that in TeamCity 10.x with Git agent-side checkout, we should be able to define what is checked out by a specific build configuration via checkout rules. Is this correct?

https://confluence.jetbrains.com/display/TCD10/Git#Git-Limitations

0

Please sign in to leave a comment.