# dev.knotless.mergePull

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

Merges a pull as the account logged in to this appview's pages.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.mergePull)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.mergePull/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.mergePull/examples)

## Definitions

### `dev.knotless.mergePull#closedIssue`

**Type**: `object`

An issue the merge closed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | The dev.knotless.issue record. |

### `dev.knotless.mergePull`

**Type**: `procedure`

Merges an open pull as `knotless merge` does, as the account logged in to this appview's web pages, with the session the appview keeps for it: a fast-forward when the base has not moved, else a merge commit, or one squashed commit into a branch protected as linear. Refused on conflicts, into a branch that takes pulls only through the merge queue (dev.knotless.queuePull queues it), and, in a repository that names runners, until each workflow that runs on it passed at its head merged with its base as it is now; it does not wait. The owner and collaborators may. Its head branch, when in the repository, goes with it unless kept or named by another open pull. Into the default branch, it closes the issues the pull names to close. Requires the session cookie the pages' login sets.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `keepBranch` | `boolean` | No | Keep its head branch. |
| `pull` | `string` (at-uri) | Yes | The dev.knotless.pull record. |
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `closed` | `array` | Yes | The issues it closed. |
| `commit` | `string` | Yes | The commit the target branch now points at, in hex. |
| `deleted` | `string` | No | The head branch the merge deleted. |

#### Errors

- **NotFound**: No such repository.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.
- **UpstreamFailure**: It did not merge, as the reason says: it conflicts, its checks have not passed, its branch takes pulls only through the merge queue, or the account may not merge it.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "closedIssue": {
      "description": "An issue the merge closed.",
      "properties": {
        "uri": {
          "description": "The dev.knotless.issue record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "main": {
      "description": "Merges an open pull as `knotless merge` does, as the account logged in to this appview's web pages, with the session the appview keeps for it: a fast-forward when the base has not moved, else a merge commit, or one squashed commit into a branch protected as linear. Refused on conflicts, into a branch that takes pulls only through the merge queue (dev.knotless.queuePull queues it), and, in a repository that names runners, until each workflow that runs on it passed at its head merged with its base as it is now; it does not wait. The owner and collaborators may. Its head branch, when in the repository, goes with it unless kept or named by another open pull. Into the default branch, it closes the issues the pull names to close. Requires the session cookie the pages' login sets.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "It did not merge, as the reason says: it conflicts, its checks have not passed, its branch takes pulls only through the merge queue, or the account may not merge it.",
          "name": "UpstreamFailure"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "keepBranch": {
              "default": false,
              "description": "Keep its head branch.",
              "type": "boolean"
            },
            "pull": {
              "description": "The dev.knotless.pull record.",
              "format": "at-uri",
              "type": "string"
            },
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "pull"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "closed": {
              "description": "The issues it closed.",
              "items": {
                "ref": "#closedIssue",
                "type": "ref"
              },
              "type": "array"
            },
            "commit": {
              "description": "The commit the target branch now points at, in hex.",
              "type": "string"
            },
            "deleted": {
              "description": "The head branch the merge deleted.",
              "type": "string"
            }
          },
          "required": [
            "commit",
            "closed"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Merges a pull as the account logged in to this appview's pages.",
  "id": "dev.knotless.mergePull",
  "lexicon": 1
}
```
