Skip to content

Inline notes

Inline notes are off by default. When you turn them on, each block listed for a human reviewer also gets a short comment in the diff, on its own lines, so the reviewer sees why it needs them without leaving the code. In dry run the notes are recorded with the review and nothing is posted.

Set score.inlineNotes: true for every repository, or for one:

repositories:
defaults:
score:
inlineNotes: true
overrides:
acme/shop:
score: { inlineNotes: false }

It is false when not written. An admin can also change it in the UI’s Settings, under Repositories (see Configuration). When a second scorer is named, repositories.defaults.score must write threshold too.

A note repeats most of what the review body’s Human review line for the block says: its lines, its score, its category and the first line of its reason. For example:

**Human review:** lines 42-57, 82% `business_rule` — Changes when a refund is allowed.

A block whose score was reused from another pull request shows its category and never its reason, since the reason was written about another pull request (see Scores across reviews).

  • One note for each block at or above the score threshold, on the block’s first line, on the old side when the block’s label says old. Of two blocks with the same lines, the one that scored higher gets the note.
  • At most 50 a review, highest scores first, and in path order among equal scores. The blocks left over get their note at a later review that still lists them.
  • Once for each block. A block (same file, same changed lines) that already has a note on the pull request gets no second one. The service knows this from the notes it has stored, and from the threads it reads before a later review. It recognises a note GitHub gives back by the part of its text the service wrote (the lines, the score and the category), not by the model’s reason. In dry run none of this is read, so each head records its notes as if none had been given.
  • Only blocks get notes. A block flagged only through its file’s whole-file score gets no note, so a model that scores files as a whole gives few notes.

Each note is an ordinary review thread. Where a repository requires conversations to be resolved before merging, someone has to resolve each note. The app never resolves one.

A note is not a finding. No later review judges it, shows it to the model, replies into it or counts it as a finding already discussed.

When a flagged block changes, its note does not move. A flagged block that is edited, a block whose hunk merged with its neighbour or was split, and every flagged block of a renamed file are new blocks: each gets a new note, and the old notes’ threads stay for someone to resolve.

When GitHub refuses a review because of one of its comments, the service posts it again with the findings’ comments and without the notes. If GitHub refuses that too, the review is posted with the body written whole and no inline comments; a review with no findings then ends publish_rejected. The notes are not posted, and the next review of the pull request tries them again.

So a note, or a finding’s comment, that GitHub never accepts keeps every note of that pull request from being posted, with one refused try at each review. The sign is notes_dropped: true in the review log line at every review of that pull request. It is also true once for a review that a later start publishes, and for a review the service finds already posted that holds none of its notes.

Field Line Meaning
notes review How many notes the review carried
notes_dropped review The notes were not posted with this review
notes_missing readback Above 0: a note the review posted was not found, by its lines, its score and its category, among the comments GitHub gives back. Such a note is not recognised as posted, and would be posted again
notes_failed log event The notes could not be rendered at all, and the review went without them
  • The list and the notes can differ. With more than 50 flagged blocks, the body lists 50 entries, file by file, and the notes take the 50 highest scores, so a block can be in neither the list nor the notes of one review.
  • A resumed review has no notes. A review that a later start publishes, because its first publication failed or the service stopped before it was posted, goes without its notes. They come with the next review.
  • Notes use up the thread limits. Each note is a thread, so the limits on reading a pull request’s threads (20 pages of 100) and a review’s comments (20 pages of 100) are reached sooner. At the comment limit, a review’s comments are not stored by the read-back; they are stored from the threads at a later review, when those can be read. A pull request whose threads cannot be read gets no later review (see Running the service).