Pre-Tested (Delayed) Commit
Last modified: 20 April 2023An approach which prevents committing defective code into a build, so the entire team's process is not affected.
Submitted code changes first go through testing. If it passes all of the tests, TeamCity can automatically submit the changes to version control. From there, it will automatically be integrated into the next build. If any test fails, the code is not committed, and the submitting developer is notified.
Developers test their changes by performing a remote run. A pre-tested commit is enabled when commit changes if successful option is selected.
The pre-tested commit is initiated via a plugin to one of Supported Platforms and Environments (also a command-line tool is Command Line Remote Run Tool).
Matching changes and build configurations To submit changed files to pre-tested commit or remote run, TeamCity should be able to check that the files, when committed, will affect the build configurations on the server.
If TeamCity cannot match the changes with the builds, a message "Submitted changes cannot be applied to the build configuration" is displayed.
The VCS integration should be correctly configured in the IDE and TeamCity should be able to match the files on the developer workstation to the build configurations present on TeamCity server. In order to be able to do that, VCS should be configured in the same way on the developer's workstation and on the server. This includes:
for CVS, TFS and Perforce version control systems - use exactly the same URLs to the version control server
for VSS - use exactly the same path to the VSS database (machine and path)
for Subversion - use the same server (TeamCity matches server GUID)
for Git - the current checked out branch should have "remote" set to the server/branch monitored by the TeamCity server and should have common commits in the history with the server-monitored branch.
TeamCity IDE plugin displays only suitable build configurations for the changes being sent to remote run. Suitable build configurations should comply with the following rules:
TeamCity user invoking the operation should have permission to run builds in the build configurations
The build configurations are checking out at least one file of the files sent to remote run. Alternatively, the build configurations snapshot-depend on those checking one the files.
The build configuration does not use "manual" checkout mode.
If no suitable build configurations are found, option to initiate the personal build will not be available.
See also:
Concepts: Remote Run Remote Run on Branch: Branch Remote Run Trigger Installing Tools: IntelliJ Platform Plugin | Eclipse Plugin | Visual Studio Addin
Thanks for your feedback!