Triggering CI build from a patchset in Upsource

Hi All.

In the past I have used Gerrit which was configured together with Jenkins (by use of Gerrit trigger) to trigger CI build/test for each patch set that was pushed into Gerrit. And a special label was configured in Gerrit which could only be set from Jenkins after CI build finished. Setting value +1 on this label was required to permit merge of the patch set to the main repository. And if Jenkins set it to -1 that would mean that either build or tests failed. The idea is simple, merge can be allowed only if CI tasks successfully completed, which means anything merged cannot really break the build, code in main repository can always be compiled and always passes unit tests. Now, I have to use Mercurial for source control and would like to set up something similar. I am looking at Upsource as an alternative to Gerrit. Can something similar be set up with Upsource? Anf if so is there any documentation to this matter?


Dmitri Priimak


Hi Dmitri,

Sorry for the delayed response.

Upsource just a repository browser/code review tool for now, so it's only reads data from VCS, but don't manage your repository (e.g. permit or allow merge). So in the described scenario I don't see what role Upsource might play. Anyhow we'll introduce simple ingratiation with CI tools (build statuses will be published to each revision in Upsource, see screenshot):


So such identification should be a good sign whether revision might be merged into master or not.

Also we are working on the VCS hosting feature to be a part of Upsource, so when it gets released, for sure we might return to your scenario with prohibit/allow merging depending on CI build results.

Hope it answers your question. 


I see. So, Upsource does not actually host repository unlike Gerrit and workflow is actually very different from Gerrit. That is a bummer. Could you guys add some diagrams to the documentation or ever main Upsource website describing suggested/possible dev. workflow with Upsource.



Dmitri Priimak



Since Upsource 3.0 this feature should be supported, right? In a video about TeamCity someone mentioned that if you do not use TeamCity you should use a webhook to notify Upsource about build status. Unfortunately I could not find any information about how to set it up! 

Could you tell me please how to do it? I secretly hope that it's going to be as simple as POST `{'staus':STAUS, 'commit':'SHA'}`...

Thanks a lot




Hi Vojtech,

Yes, this feature is a part of 3.0 release. Configuration is pretty simple. Please find corresponding doc page here -

Hope that helps.


Please sign in to leave a comment.