GitLab status checks not getting updated
Hi everyone,
We are trying to migrate our code repository from Github to Gitlab.
Currently in Github when we create a pull request, we have a set of status checks that must pass in order for the developer to be able to merge. These status checks are pipelines run in Teamcity and Teamcity updates the status of this "checks" successfully in Github (whether the passed, failed or are still in progress).
We are trying to accomplish the same thing in Gitlab, when we create a new Merge Request we have setup some status checks that will need to pass in order for the developer to be able to merge.
Unfortunately, we have not been able to get Teamcity to update these status checks and I was wondering whether someone here has done something similar.
In Github it looks like the commit status build feature updates the status checks for us but in Gitlab we need to setup an API call in the status check to tell Gitlab where to go to check for the status rather than letting the Teamcity commit status build feature do the work for us like in Github.
Any help on this matter would be greatly appreciated.
Please sign in to leave a comment.
Commit Status Publisher is a build feature (https://www.jetbrains.com/help/teamcity/adding-build-features.html) which allows TeamCity to automatically send build statuses of your commits to an external system. And gitlab is supported by commit status publisher build feature. Fore more detailed information please refer to https://www.jetbrains.com/help/teamcity/commit-status-publisher.html#GitLab.
Hi Tom Sun
Thank you for your response. I am using the Status Publisher for Gitlab and it's working fine for normal commits, however it doesn't seem to work for status checks in Gitlab, that's where I'm having the problem.
This may be due to the fact that the status checks in Gitlab require an API endpoint where to go to update the status rather than the external system update Gitlab with the status (like what the Status Publisher is doing).
Regards,
Yago
> I am using the Status Publisher for Gitlab and it's working fine for normal commits, however it doesn't seem to work for status checks in Gitlab, that's where I'm having the problem.
To avoid any misunderstanding, could you please share more information about it? Reproduced steps and screenshots would also be helpful.
Hi Tom Sun
I created a pipeline in Teamcity called: MR-Only
The VCS has been defined as follows:
The vcs has been tested and it connects to Gitlab successfully.
I've added two build features shown in the pictures below (MR-Only-03, MR-Only-04 and MR-Only-05)
Then in Gitlab you can see that the MR-Only pipeline was successful but the status check is showing as failed
I suspect the problem is to do with the way we have to setup the status check in Gitlab
At this point I am not sure whether I did something wrong within the Temcity setup or that I should use something different in the API to check in Gitlab.
Any help on this issue would be greatly appreciated.
Hi Yago,
Thanks for your detailed information.
API to check should be the external service or an API that you implemented it by yourselves.
For integrating with TeamCity, you could check the pipeline must succeed option.
Best Regards,
Tom
Hi Tom Sun
My understanding is that the API to check should be a Teamcity endpoint that returns whether it succeeded or not and that's the part I'm struggling with. Which Teamcity endpoint should I add in there? as it's a compulsory field.
Hi Yago,
As I mentioned, the API to check should be an external service or an API you implement yourselves. This API can be used to verify whatever you need.
With this integration, you can connect to third-party workflow tools like ServiceNow or any custom tool of your choice. The third-party tool will respond with an associated st
atus.For more detailed information, please refer to GitLab documentation(https://docs.gitlab.com/ee/user/project/merge_requests/status_checks.html).
For integrating with TeamCity, using the pull request and commit status publisher will push the build status to GitLab. On the GitLab side, we can use the "pipeline must succeed" option. Are there any additional checks needed from the TeamCity side?
For any questions or concerns, please do not hesitate to reach out.
Best Regards,
Tom