Skip to main content

Module forge

Module forge 

Source
Expand description

The forge consumer’s domain (ADR 0029, spec/forge.md).

What a pull request or merge request is to a review, the forge’s review threads as the review sees them, and the two decisions that sit between a forge and the reader’s findings: where a fetched thread lands in the diff, and which findings a publish may send.

Nothing here runs a program. The adapters that speak to gh and glab implement Forge and live in forgeio; this module is the trait, the types it speaks in, and pure policy over a plan document.

Structs§

Batch
What one publish sends: everything in one submission where the forge allows it.
Excluded
A finding a publish left out, and why, in words for the status line.
LineEnd
One end of a multi-line comment, as GitLab’s line_range names it.
LineSpan
The two ends of a multi-line comment’s line_range.
NewComment
A new review comment to publish: a finding that is not a reply.
NewReply
A reply to publish into an existing thread.
OwnComment
A comment on the forge that is the reader’s: by author, by marker, or by the address a publish recorded. What the reviewer’s c edits and dd deletes; ReviewSession::own_comment is the one place that decides it.
PublishOutcome
What one publish brings back: the forge’s record of each finding it took, and the threads fetched afterwards so the twins can be shown.
PublishPlan
A publish, decided: what goes and what stays.
Published
One comment the forge accepted, keyed back to its finding.
RemoteComment
One comment in a thread. reply_to is None on the root.
RemoteThread
One review thread: where the forge put it, and where this review did.
Request
A request as the forge describes it: the object a review is of.
Sent
What an adapter’s publish brought back.

Enums§

ForgeError
ForgeKind
Which forge a request lives on. The flag that names the request names this too: --pr is GitHub and --mr is GitLab, and nothing infers it.

Traits§

Forge
The forge, as the domain needs it. dyn: which forge a repository is on is a run-time answer, like which model groups (ADR 0020, 0029).

Functions§

head_matches
Whether the forge still has the head this review was opened on. Both forges reject a comment against any other commit, so this is the first thing a publish checks and the batch is not built when it fails.
other_side_line
The number an unchanged line has on the other side, or None for a changed line, which exists on one side only.
place
Where a fetched thread lands in this plan.
publish
The whole publish, forge side: ask the forge where the request is now, refuse if it moved, send the batch, fetch the threads again.
publish_plan
Which open findings a publish may send, and which it must leave.
source_for
The range a request reviews: the merge base of its target branch’s tip and its head, to its head. That is the diff the request page shows.
strip_marker
A fetched body, split into what is shown and which finding wrote it.
with_marker
A finding’s body as it is sent: the text, a blank line, the marker.