Skip to end of metadata
Go to start of metadata

Commit status publisher is a build feature which allows TeamCity to automatically attach build statuses of your commits in an external system. The feature is implemented as a plugin bundled since TeamCity 10.0; for earlier TeamCity versions the stand-alone plugin is used.

 The supported systems are:

  • JetBrains Upsource
  • GitHub (only the build statuses for pull requests are supported now)
  • GitLab
  • TFS/VSTS-hosted Git (since TeamCity 2017.2 EAP1)
  • Atlassian Bitbucket Server (formerly Stash) and Atlassian Bitbucket Cloud

    Icon

    Make sure that the TeamCity server URL is FQDN, e.g. http://myteamcity.domain.com:8111. Short names, e.g. http://myteamcity:8111 are rejected by the Bitbucket API.

    Icon

    For Bitbucket Cloud team accounts, it is possible to use the team name as the username, and the API key as the password.

  • Gerrit Code Review tool.

To use the tool, add the build feature to your build configuration, select your system as the publisher, and specify its connection details and credentials.

 

 

See the example below to configure sending the status of builds with changes included in your pull request from TeamCity to GitHub.

  1. Configure the branch specification in your VCS Root ensuring that it includes pull requests. Detailed information is available in the Branch specification section of this TeamCity blog post.
  2. Add the build feature, select GitHub as the publisher and specify its connection details and credentials. Since TeamCity 2017.1, you can test the connection :


  3. Commit changes to your source code and create a pull request in GitHub, then run a build with your changes in TeamCity. 

    The Commit Status Publisher will inform you on the status of the build with your pull request changes:  
    1) It will show you whether the check is in progress , whether it failed  or is successful 
    2) hovering over the commit status will display the build summary
    3) clicking the build status sign or the Details link will open the build results page in TeamCity:



    This information is also available on the Commits tab of your pull request details: 



     Similarly to the previous page, clicking the build status icon opens the build results page in the TeamCity web UI: 





  • No labels

27 Comments

  1. Thank you so much for updating this! You don't know how many days it took to figure out where the status are actually placed. I had no idea that it only showed the status in a pull request or the branches view. On that note, is there any way to show the build status in the commit view? Like if I push a commit how can I get the build status, that runs on every commit, to show?

    1. Sean, thank you for the comment. I fixed the page to (hopefully) make it clear TeamCity can attach build statuses of commits in all systems except for GitHub, where only the pull request status can be published. If you want to get the build status on any commit in GitHub, please submit an issue to our tracker 

  2. I'm glad that this plugin is bundled with TeamCity by default. I would like to understand whether it will work when TeamCity is installed on our company's network and is not publicly accessible? Or do I need to expose some proxy? Is there any documentation on how to do it?

     

     

  3. Boris, plugin should work fine in this case. If it doesn't,  please file an issue in the tracker and attach teamcity-server.log covering problems to the issue.

  4. Are there any plans to add TFS/VSTS to the list of supported systems?

    1. Hi Yan,

      there are no such plans at the moment, please file a feature request in issue tracker.

  5. If you have multiple build configurations (say, one on Windows and another one on Mac), it looks like whichever one finishes first wins and sets the status of the PR? That's not great ...

  6. Hello,

    looked into sources, and it seems like SSH auth support for bitbucket is missing. Can you please clarify on that?

    Thank you.

    1. Gleb, not sure what you mean. If you think there is an issue with the code, please post it to our tracker noting the code fragments that cause your concern?

      1. It is not about code. This plugin only has login/password auth option to access bitbucket. Our TC is configured to use SSH key to access bitbucket. I cannot reuse it in this plugin. I've seen that other connectors (to some other repository) have this option. Can I use tracker to post this feature request as well?

        1. Gleb, thank you for clarification. Looks like the Bitbucket REST API does not support SSH auth (unlike Git access to Bitbucket repositories), so it cannot be implemented in our plugin.

          1. Julia Alexandrova thank you very much for info. Sad story (smile) 
            Have a nice day!

          2. Julia Alexandrova - For team accounts, BitBucket offers use of API key. The BitBucket REST API does support API key. As a possible alternative, couldn't the plugin offer option to use API key instead of forcing username/password?

            1. Matt Jackman, Thanks for your comment. The plugin supports using team name as the user name and the API key as the password for Bitbucket Cloud team accounts. Team name/API key can also be used as basic HTTP authentication credentials when configuring a VCS Root, or a Bitbucket issue tracker. I'll update documentation accordingly.

              1. Thank you, Julia Alexandrova, for updating doc. We have A LOT of repos, all under the same team. I'd like status for all my build configurations to go update the specified repo. It appears I need to go back to every build configuration and add this build feature, correct? When I try to add build feature to the template, I'm getting this message: "There are no VCS roots configured."

  7. It looks like this plugin supports only builds against the pull request branch head and not the results of the merge of that branch. Is that true?

    https://github.com/jonnyzzz/TeamCity.GitHub/issues/7
    "I checked the API side. It works for my tests. This could be also a problem is you run the build for refs/pull/*/merge branch. Please use refs/pull/*/head branch"

    1. Rob Fulwell, it seems that you are referencing a different plugin, which is not a part of our bundle.

  8. Has anyone gotten this to work with GitLab?

    I keep getting a "unable to find valid certification path to requested target" error.

    1. Nicola Fera, please submit an issue to our tracker noting the URL and  TeamCity version.

        1. Thanks! Our developers are looking into it, please watch the issue for updates.

  9. Is there any way to use a configuration parameter for the password? It's really tedious to change the value in every single configuration each time we add a new one (because nobody knows what the password actually is so we end up resetting it every time we had a repository to build in teamcity).

  10. Thought i'd mention for anyone that had the same problem as I did - capitalization of repository name is really important! I had capitalized my repository name in TC (when integrating as a bitbucket cloud VCS root), but the BitBucket API to push the build statuses too, requires lowercase. Hope that helps someone.

  11. For Bitbucket Cloud team accounts, it is possible to use the team name as the username, and the API key as the password.

     

    Bitbucket now uses OAuth2, so the API Keys section has disappeared in the team settings.

    How do we now authenticate this plugin to a Bitbucket Cloud account?

  12. We would like to include `Test failures` instead specifying the build failed has on a pull request in Github. Is there any workaround for this of stuff(using API)?