Waiting for engine...
Skip to main content

Branch object

You can use the Branch object to create, update, and delete development branches on your account.

Structure

<Branch>
<id/>
<name/>
<createdBy/>
<createdDate/>
<modifiedBy/>
<modifiedDate/>
<parentId/>
<parentName/>
<packageId/>
<ready/>
<deleted/>
<stage/>
</Branch>
FieldTypeDescription
idstringThe ID of the branch.
namestringThe name of the branch.
createdBystringThe user who created the branch.
createdDatedateTime (yyyy-MM-dd'T'HH:mm:ss'Z')The date and time when the branch was created.
modifiedBystringThe user who last modified the branch.
modifiedDatedateTime (yyyy-MM-dd'T'HH:mm:ss'Z')The date and time when the branch was updated.
parentIdstringThe ID of the parent branch.
parentNamestringThe name of the parent branch.
packageIdstringThe ID of the packaged component from which the branch is created.
readybooleanWhether the branch is ready to use.
deletedbooleanWhether the branch is deleted.
stagestringThe branch status: CREATING, NORMAL (ready for use), or DELETING.

Supported operations

GETQUERYCREATEUPDATEEXECUTEDELETE
not supportedsupportedsupportedsupportednot supportedsupported

Using the DELETE operation

  • You can delete branches stuck in a non-ready state (such as CREATING, DELETING, FAILED_TO_CREATE, FAILED_TO_DELETE, and FAILED_TO_MERGE) after the minimum dwell time has passed. The default time is 15 minutes and can be configured using EngineConfig.BRANCH_FORCE_DELETE_MIN_DWELL_MINUTES.

  • If the minimum dwell time hasn't passed, the API returns the following message: The {branchName} branch is currently processing. Please try again in {X} minutes.

  • If the branch is locked by an active merge request, the API returns the following message: The {branchName} branch is locked. MR-{id} is still processing. Try again soon.

Using the QUERY operation

You must first retrieve the ID of your main branch, using the name of your current branch. If you haven't created any branches, your current branch will be "main". The QUERY operation supports the following query fields:

  • id
  • name
  • parentId
  • parentName
  • createdBy
  • createdDate
  • modifiedBy
  • modifiedDate

When you query a branch, it might be in one of the following states:

  • CREATING - The branch is being created
  • NORMAL - The branch is ready to use
  • DELETING - The branch is being deleted
On this Page