Automerger - REST API

This page describes the REST endpoints that are added by the automerger plugin.

Please also take note of the general information on the REST API.

Automerger Endpoints

Config Downstream

POST /projects/{project-name}/automerger~config-downstream

Returns a map of branches that are one hop downstream to whether or not it should be skipped by default.

Request

  POST /projects/platform/test_data/automerger~config-downstream HTTP/1.0
  Content-Type application/json;charset=UTF-8

  {
    "subject": "DO NOT MERGE i am a test subject"
  }

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  {
    "master": true,
    "branch_two": false
  }

All Config Downstream

GET /projects/{project-name}/branches/{branch-id}/automerger~all-config-downstream

Returns a list of branch names that are downstream, including ones more than one hop away.

Request

  GET /projects/platform/test_data/branches/test_branch_name/automerger~all-config-downstream HTTP/1.0

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    "master", "branch_two"
  ]

Automerge Change

POST /changes/{change-id}/revisions/{revision-id}/automerger~automerge-change

Automerges changes based on the given map, with merges being done with the strategy -s ours if the value in the map is false.

Request

  POST /changes/Id3adb33f/revisions/1/automerger~automerge-change HTTP/1.0
  Content-Type application/json;charset=UTF-8

  {
    "master": true,
    "branch_two": false
  }

Response

  HTTP/1.1 204 No Content

Cherry Pick Mode

GET /config/server/automerger~automerge-mode

Returns either “CHERRY-PICK” or “MERGE”.

Request

  GET /config/server/automerger~automerge-mode HTTP/1.1

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=utf-8
  )]}'
  "CHERRY-PICK"