One inline remark to write, as CreatePullReviewComment expects it.
Used twice: on its own as the body of POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments, and as an element of CreateReview.comments when a whole review is posted in one call. The pinned spec expresses that reuse literally — CreatePullReviewCommentOptions is a $ref to CreatePullReviewComment and nothing else — so this library models it once.
==Which line, and which side of the diff==
Forgejo carries two line numbers and uses 0 for "not this side": new_position addresses the line as it appears '''after''' the change, old_position addresses it as it appeared '''before'''. Getting them the wrong way round anchors the remark to an unrelated line rather than failing, which is why there is no constructor taking both. Pick the one that says what is meant:
for remark <- NewReviewComment.onNewLine("modules/git/hook.go", 42L, "this quoting is still wrong")
yield remark.spanning(3L)
NewReviewComment.onFile is the third possibility — a remark about the file as a whole, with neither position set — which Forgejo accepts and renders at the top of the file's diff.
Value parameters
- body
-
the remark, as Markdown source; trimmed and required by every constructor
- extraLinesCount
-
how many further lines the remark covers, absent for a single-line remark. Forgejo reads an absent value and a
0identically, so this library sends neither unless spanning was called - newPosition
-
the line on the new side of the diff, absent for a remark on the old side or on the file as a whole
- oldPosition
-
the line on the old side of the diff, absent for a remark on the new side or on the file as a whole
- path
-
the file the remark is about, relative to the repository root, exactly as com.worxbend.codeberg4s.pulls.ChangedFile.filename reports it
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any