Simple API for triggering builds

I am facing connecting continua to a pull request system (Azure) which would require verification of changes, I would like to still use Continua, but I see no easy way to trigger a build and get the status back.
Is there any posibility to automate that ?
Trigger build → Get Build ID → Check what is the status of Build ID

Hi Michal,

Just to clarify your intended workflow - are you aiming for Azure DevOps pull requests to trigger builds in Continua CI, and then have the results of those builds reported back to Azure DevOps as a commit status?

Continua Git repositories already supports triggering builds from pull requests from Azure Repos, so you just need a way to report the build status back to Azure DevOps. This would show the result of the Continua build (e.g. pending, succeeded, or failed) directly on the pull request in Azure DevOps.

We’ll investigate whether we can implement this as a new build event handler for Azure. It would work in a similar way to our existing GitHub Status build event handler, which updates the status of a commit on GitHub as the build progresses. For Azure DevOps, we could use their Statuses API to post build status updates linked to the relevant commit in the pull request.

In the meantime, you may be able to achieve this using our more general-purpose HTTP Request build event handler. This allows you to make custom API calls at various points in the build lifecycle. With that, you could post status updates to the Azure DevOps Statuses API, using a personal access token, along with the commit and repository information available via the $Source.RepoName... expressions.

Actually I was thinking of creating an azure pipline that would trigger build on Continua and wait for the completion. Thus every pull request would be verified by “azure pipeline”.

Right now we work with Crucible/Fisheye, so we present review link on merge build, we do the checks, create merge commit with review link.

With Azure pull request, right now my workaround is that pull request is created, we run our merge build with that link, verify the review is done by reviewers, we do the checks, and mark pull request as completed (so Azure makes the merge).

I will test how this works, but in general I don’t like Azure :slight_smile:
Anyways, I am good for now, but still and REST API to start and get build status would be great.

Thank you for the hint of commit statuses, I will look into it.

And how do continua can get a pull request ? I though it’s just an azure operation.

Version 2 of Continua CI will include a REST API when we eventually complete it. We’ll make a note to ensure that it includes the ability to trigger builds and get build status.

Actually what I said before is incorrect, we cannot trigger on a pull request. GitHub exposes pull requests as synthetic refs so we can fetch pull request using a specific refspec +refs/pull/*/merge:refs/remotes/origin/pr/*. However, this doesn’t work for Azure DevOps which does not publicly expose pull requests as refs. We would have to add a feature to query the Azure DevOps API for this to work.

1 Like