# dev.knotless.getQueue

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

✓ This is the authoritative definition for this NSID.

## Description

A repository's merge queues.

## Links

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

## Definitions

### `dev.knotless.getQueue#batchView`

**Type**: `object`

A batch being checked, or landing once its checks have passed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `checks` | `array` | Yes | The newest run of each workflow at its commit. |
| `commit` | `string` | Yes | The commit it would leave the branch at, in hex. |
| `size` | `integer` | Yes | How many pulls are in it. |
| `state` | `string` | Yes |  |

### `dev.knotless.getQueue#branchView`

**Type**: `object`

A branch's merge queue.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `batches` | `array` | Yes | The batches being checked or landing, in the order they land: a pull names the one it is in. |
| `branch` | `string` | Yes | The branch's name. |
| `pulls` | `array` | Yes | In the order they land. |

### `dev.knotless.getQueue#ejectedView`

**Type**: `object`

A pull the merge queue turned away.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `checks` | `array` | Yes | The checks of its batch that did not pass, if they are why. |
| `ejectedAt` | `string` (datetime) | Yes |  |
| `pull` | `ref` → `dev.knotless.defs#itemView` | Yes |  |
| `reason` | `string` | No | Why, as the runner said. |

### `dev.knotless.getQueue#landedView`

**Type**: `object`

A batch the merge queue landed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `branch` | `string` | Yes | The branch's name. |
| `commit` | `string` | Yes | The commit it left the branch at, in hex. |
| `landedAt` | `string` (datetime) | No |  |
| `pulls` | `array` | Yes | In the order they were squashed onto the branch. |

### `dev.knotless.getQueue`

**Type**: `query`

What is queued on each branch of a repository, in the order it lands, the batches being checked, the open pulls the queue turned away and why, and the batches it landed last, as the runners the repository names report them. No authentication; responses are not personalized.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record. Its authority may be a handle; a name the repository had before, or an owner it moved from with its agreement, finds it under the name it has now. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `branches` | `array` | Yes | Each branch with pulls queued, by name. |
| `ejected` | `array` | Yes | The open pulls the queue turned away, newest first. |
| `landed` | `array` | Yes | The last few batches landed, newest first. |

#### Errors

- **NotFound**: No such repository; or this appview keeps no index, so it knows no pulls.

### `dev.knotless.getQueue#queuedView`

**Type**: `object`

A pull in a merge queue.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `batch` | `integer` | No | The batch it is in, by its place in its branch's `batches`. |
| `pull` | `ref` → `dev.knotless.defs#itemView` | Yes |  |
| `queuedAt` | `string` (datetime) | Yes |  |
| `said` | `string` | Yes | Where it stands, in words: `Queued, 3rd of 5`, `In a batch of 4 being checked` or `Landing`. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "batchView": {
      "description": "A batch being checked, or landing once its checks have passed.",
      "properties": {
        "checks": {
          "description": "The newest run of each workflow at its commit.",
          "items": {
            "ref": "dev.knotless.defs#checkView",
            "type": "ref"
          },
          "type": "array"
        },
        "commit": {
          "description": "The commit it would leave the branch at, in hex.",
          "type": "string"
        },
        "size": {
          "description": "How many pulls are in it.",
          "minimum": 1,
          "type": "integer"
        },
        "state": {
          "knownValues": [
            "checking",
            "landing"
          ],
          "type": "string"
        }
      },
      "required": [
        "commit",
        "state",
        "size",
        "checks"
      ],
      "type": "object"
    },
    "branchView": {
      "description": "A branch's merge queue.",
      "properties": {
        "batches": {
          "description": "The batches being checked or landing, in the order they land: a pull names the one it is in.",
          "items": {
            "ref": "#batchView",
            "type": "ref"
          },
          "type": "array"
        },
        "branch": {
          "description": "The branch's name.",
          "type": "string"
        },
        "pulls": {
          "description": "In the order they land.",
          "items": {
            "ref": "#queuedView",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "branch",
        "pulls",
        "batches"
      ],
      "type": "object"
    },
    "ejectedView": {
      "description": "A pull the merge queue turned away.",
      "properties": {
        "checks": {
          "description": "The checks of its batch that did not pass, if they are why.",
          "items": {
            "ref": "dev.knotless.defs#checkView",
            "type": "ref"
          },
          "type": "array"
        },
        "ejectedAt": {
          "format": "datetime",
          "type": "string"
        },
        "pull": {
          "ref": "dev.knotless.defs#itemView",
          "type": "ref"
        },
        "reason": {
          "description": "Why, as the runner said.",
          "type": "string"
        }
      },
      "required": [
        "pull",
        "ejectedAt",
        "checks"
      ],
      "type": "object"
    },
    "landedView": {
      "description": "A batch the merge queue landed.",
      "properties": {
        "branch": {
          "description": "The branch's name.",
          "type": "string"
        },
        "commit": {
          "description": "The commit it left the branch at, in hex.",
          "type": "string"
        },
        "landedAt": {
          "format": "datetime",
          "type": "string"
        },
        "pulls": {
          "description": "In the order they were squashed onto the branch.",
          "items": {
            "ref": "dev.knotless.defs#itemView",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "branch",
        "commit",
        "pulls"
      ],
      "type": "object"
    },
    "main": {
      "description": "What is queued on each branch of a repository, in the order it lands, the batches being checked, the open pulls the queue turned away and why, and the batches it landed last, as the runners the repository names report them. No authentication; responses are not personalized.",
      "errors": [
        {
          "description": "No such repository; or this appview keeps no index, so it knows no pulls.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "branches": {
              "description": "Each branch with pulls queued, by name.",
              "items": {
                "ref": "#branchView",
                "type": "ref"
              },
              "type": "array"
            },
            "ejected": {
              "description": "The open pulls the queue turned away, newest first.",
              "items": {
                "ref": "#ejectedView",
                "type": "ref"
              },
              "type": "array"
            },
            "landed": {
              "description": "The last few batches landed, newest first.",
              "items": {
                "ref": "#landedView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "branches",
            "ejected",
            "landed"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "repo": {
            "description": "The repository's dev.knotless.repo record. Its authority may be a handle; a name the repository had before, or an owner it moved from with its agreement, finds it under the name it has now.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "repo"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "queuedView": {
      "description": "A pull in a merge queue.",
      "properties": {
        "batch": {
          "description": "The batch it is in, by its place in its branch's `batches`.",
          "minimum": 0,
          "type": "integer"
        },
        "pull": {
          "ref": "dev.knotless.defs#itemView",
          "type": "ref"
        },
        "queuedAt": {
          "format": "datetime",
          "type": "string"
        },
        "said": {
          "description": "Where it stands, in words: `Queued, 3rd of 5`, `In a batch of 4 being checked` or `Landing`.",
          "type": "string"
        }
      },
      "required": [
        "pull",
        "queuedAt",
        "said"
      ],
      "type": "object"
    }
  },
  "description": "A repository's merge queues.",
  "id": "dev.knotless.getQueue",
  "lexicon": 1
}
```
