Swabra always forces clean checkout
Answered
Hi, i use swabra build files cleaner.
Every build at the beggining i get message from swabra: [Swabra] Checkout directory state is unknown. Need a clean checkout directory snapshot - forcing clean checkout
Checkout directory is unknown everytime i run build. It causes clean checkout removing folders i exclude from swabra cleaning like nuget packages.
Where can be the problem? Thanks.
Please sign in to leave a comment.
Hi Sanjuro,
what checkout mode do you use (agent or server-side), do you use a custom checkout directory? Also, it's also good to check teamcity-agent.log file for any errors.
Hi,
i use checkout mode always on agent with custom checkout directory.
Thanks.
Do you see any errors/warnings in the agent logs?
I can't see any warning or errors in log. Actually this build uses one snapshot dependency that checkouts to same custom directory. Both dependencies need to checkout same VCS dir.
Here is part of log output:
It isn't recommended to share a custom checkout directory between build configurations with different VCS settings. In this case, a clean checkout on each build is an expected and documented behavior. Please check the documentation - https://www.jetbrains.com/help/teamcity/build-checkout-directory.html#BuildCheckoutDirectory-Customcheckoutdirectory.
I made changes and now both configurations use auto checkout directory. But the problem is same. First configuration installs some NPM packages to node_modules. Swabra in second build configuration forces clean checkout as in previous situation. Swabra just force clean checkout, creates snapshot, deletes files after build comparing to that snapshot, but new build again, forces clean checkout deleting node_modules and so on. At this state it is unusable. Exactly what conditions can cause forced clean checkout on Swabra?
You can read more about Swabra here and here more about automatic clean checkout.
Could you maybe attach screenshots for VCS roots\Swabra settings in both build configurations? It'll help with the investigation.
First build configuration dont use swabra. It just npm install some packages, run script and updates teamcity parameter. Second one that depends on first one use swabra. Second one actually builds .net core app. I followed links u provided. What i finally did, i added swabra to the first build configuration with same settings as in second one despite i dont need it there. But now it finally works as expected. So it is obviously problem for swabra if one configuration has no swabra and other has in one build chain, it is little weird, but finally it works.
Many thanks for your help.
Glad to hear that you solved your problem.
Swabra stores a directory state from the previous build. If, after that build, any files were changed (e.g. new dependencies were installed by npm) Swabra performed a clean checkout because this new state is unknown for it. Unless you add the same build feature to all builds working with the same checkout directory.