govin
govin

Reputation: 6693

Github multiple status checks for pull request

I have a teamcity project running a build against github repo. On completion of the build, it uses a build feature of teamcity named "Report Change Status to Github" which reports the build status using - https://api.github.com

Now I would like to have another teamcity project run a build against the same github repo and report the build status to github.

How do I make github display the 2 status checks differently? Despite the 2 builds reporting status to github, github just displays "1 pending check" or "1 status check completed successfully"

Upvotes: 7

Views: 6040

Answers (2)

ratherblue
ratherblue

Reputation: 2108

Edit: I didn't realize you already have the plug in installed, but I am going to leave the steps for other users. I think you need separate build configurations and to make sure you customize the context setting.

I was playing with this today and you can't use JetBrains "Commit Status Reporter" to do this. You can use this plugin though: https://github.com/jonnyzzz/TeamCity.GitHub

It wasn't straightforward to install--

  1. Go here (choose Log in as guest): https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt398 and
  2. Click the "View" link in the "Artifacts" column in the latest successful build.
  3. Then you click teamcity.github.zip and it will download a zip file
  4. Then you upload that zip to TeamCity in the plugins section
  5. Once you do that, go to Build Features and click "Add Build Feature" and select "Report change status to GitHub".
  6. Then fill the form out with something like this (Note: You will need this for each build configuration you want reported. I am also running each build on separate agents which might be necessary):

TeamCity with Github Statuses

Upvotes: 12

Ivan Zuzak
Ivan Zuzak

Reputation: 18762

Statuses are created with something called a context:

https://developer.github.com/v3/repos/statuses/#create-a-status

For each commit, the latest status for each context is shown. And for the pull request overall (next to the merge button) the latest per-context statuses of the latest commit in the pull request are shown.

This means that if you want multiple status checks to show up -- those statuses need to be created with different contexts. And that's something defined by the application which is creating statuses, not GitHub. GitHub only displays the statuses.

Upvotes: 3

Related Questions