# dev.knotless.comment

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

✓ This is the authoritative definition for this NSID.

## Description

A comment on a pull or issue. With a verdict it is a review; with a line, a comment on lines of a pull's diff, starting a thread there; with a reply, an answer in such a thread.

## Links

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

## Definitions

### `dev.knotless.comment#lineRef`

**Type**: `object`

Lines of a file in a pull's diff, as GitHub's review comments name them.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `line` | `integer` | Yes | The last line commented on, counting from 1. |
| `path` | `string` | Yes | The file's path on the side commented on. |
| `side` | `string` | No | `new`, the side the pull brings in, or `old`, the side it leaves, for lines it removes. Absent, `new`. |
| `startLine` | `integer` | No | The first, for more than one line; no later than `line`. |

### `dev.knotless.comment`

**Type**: `record`

Kept in the commenter's account; for a private repository, in their repo inside the repository's space.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `attachments` | `array` | No | What it carries beside its body: the pictures the body shows. Kinds unknown to a reader are passed over, and kept by a client changing it. |
| `body` | `string` | Yes | Markdown. |
| `commit` | `string` | No | The hex object ID of the head commit a review looked at, or that a comment's `line` is in. |
| `createdAt` | `string` (datetime) | Yes |  |
| `facets` | `array` | No | The accounts its body mentions, by where: written as it is, from each `@handle` outside code and links. |
| `line` | `ref` → `#lineRef` | No | For a comment on a pull's diff, the lines it is on, in the file as it was at `commit` on that side. |
| `reply` | `string` (at-uri) | No | The dev.knotless.comment, with a `line`, whose thread this answers. An answer has no `line` of its own. |
| `repo` | `ref` → `dev.knotless.defs#repoRef` | Yes | The repository the pull or issue is on. |
| `review` | `string` (at-uri) | No | The review, a dev.knotless.comment, this was sent with as one of its line comments, all in one write. |
| `subject` | `string` (at-uri) | Yes | The dev.knotless.pull or dev.knotless.issue commented on. |
| `updatedAt` | `string` (datetime) | No | When its author last changed its body. |
| `verdict` | `string` | No | Present on a review: `approve`, or `changes` to ask for changes. Readers take each reviewer's latest as where they stand, and none from the pull's author. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "lineRef": {
      "description": "Lines of a file in a pull's diff, as GitHub's review comments name them.",
      "properties": {
        "line": {
          "description": "The last line commented on, counting from 1.",
          "minimum": 1,
          "type": "integer"
        },
        "path": {
          "description": "The file's path on the side commented on.",
          "maxLength": 1024,
          "type": "string"
        },
        "side": {
          "description": "`new`, the side the pull brings in, or `old`, the side it leaves, for lines it removes. Absent, `new`.",
          "knownValues": [
            "old",
            "new"
          ],
          "maxLength": 16,
          "type": "string"
        },
        "startLine": {
          "description": "The first, for more than one line; no later than `line`.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "path",
        "line"
      ],
      "type": "object"
    },
    "main": {
      "description": "Kept in the commenter's account; for a private repository, in their repo inside the repository's space.",
      "key": "tid",
      "record": {
        "properties": {
          "attachments": {
            "description": "What it carries beside its body: the pictures the body shows. Kinds unknown to a reader are passed over, and kept by a client changing it.",
            "items": {
              "refs": [
                "dev.knotless.defs#image"
              ],
              "type": "union"
            },
            "maxLength": 32,
            "type": "array"
          },
          "body": {
            "description": "Markdown.",
            "maxLength": 20000,
            "type": "string"
          },
          "commit": {
            "description": "The hex object ID of the head commit a review looked at, or that a comment's `line` is in.",
            "maxLength": 64,
            "minLength": 40,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "facets": {
            "description": "The accounts its body mentions, by where: written as it is, from each `@handle` outside code and links.",
            "items": {
              "ref": "dev.knotless.defs#facet",
              "type": "ref"
            },
            "maxLength": 50,
            "type": "array"
          },
          "line": {
            "description": "For a comment on a pull's diff, the lines it is on, in the file as it was at `commit` on that side.",
            "ref": "#lineRef",
            "type": "ref"
          },
          "reply": {
            "description": "The dev.knotless.comment, with a `line`, whose thread this answers. An answer has no `line` of its own.",
            "format": "at-uri",
            "type": "string"
          },
          "repo": {
            "description": "The repository the pull or issue is on.",
            "ref": "dev.knotless.defs#repoRef",
            "type": "ref"
          },
          "review": {
            "description": "The review, a dev.knotless.comment, this was sent with as one of its line comments, all in one write.",
            "format": "at-uri",
            "type": "string"
          },
          "subject": {
            "description": "The dev.knotless.pull or dev.knotless.issue commented on.",
            "format": "at-uri",
            "type": "string"
          },
          "updatedAt": {
            "description": "When its author last changed its body.",
            "format": "datetime",
            "type": "string"
          },
          "verdict": {
            "description": "Present on a review: `approve`, or `changes` to ask for changes. Readers take each reviewer's latest as where they stand, and none from the pull's author.",
            "knownValues": [
              "approve",
              "changes"
            ],
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "repo",
          "subject",
          "body",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A comment on a pull or issue. With a verdict it is a review; with a line, a comment on lines of a pull's diff, starting a thread there; with a reply, an answer in such a thread.",
  "id": "dev.knotless.comment",
  "lexicon": 1
}
```
