Get repo by id via API

Hi,

Say I create a build via the API. The response payload contains repo_id, and source_repo. I have two problems:

  • source_repo is always empty
  • repo_id is available, but there is no API endpoint to get a repo via it’s ID

How can I get the repo info via the API from the build info ?

The only workaround I have to far is to list all repos and then search the payload for a specific ID. I’m afraid of performance issues here…

Thanks a lot for your help !

source_repo is always empty

Source repo is only populated for pull requests that come from forks, so we expect this to be empty when you are creating a build for a specific commit or branch.

repo_id is available, but there is no API endpoint to get a repo via it’s ID

You should use the repository name. You cannot create a build without knowing the repository name in the first place, since the repository name is a URL parameter in the build creation endpoint.

I’m always amazed by how quick you are :slight_smile: Thanks again !

Good point, that’s embarrassing for me :stuck_out_tongue: