gerrit

package
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeDiff

type ChangeDiff struct {
	// contains filtered or unexported fields
}

ChangeDiff is a diff service for Gerrit changes.

func NewChangeDiff

func NewChangeDiff(cli *gerrit.Client, branch, changeID string) (*ChangeDiff, error)

NewChangeDiff returns a new ChangeDiff service, it needs git command in $PATH.

func (*ChangeDiff) Diff

func (g *ChangeDiff) Diff(ctx context.Context) ([]byte, error)

Diff returns a diff of MergeRequest. It runs `git diff` locally instead of diff_url of GitLab Merge Request because diff of diff_url is not suited for comment API in a sense that diff of diff_url is equivalent to `git diff --no-renames`, we want diff which is equivalent to `git diff --find-renames`.

func (*ChangeDiff) Strip

func (g *ChangeDiff) Strip() int

Strip returns 1 as a strip of git diff.

type ChangeReviewCommenter

type ChangeReviewCommenter struct {
	// contains filtered or unexported fields
}

ChangeReviewCommenter is a comment service for Gerrit Change Review API:

https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review
POST /changes/{change-id}/revisions/{revision-id}/review

func NewChangeReviewCommenter

func NewChangeReviewCommenter(cli *gerrit.Client, changeID, revisionID string) (*ChangeReviewCommenter, error)

NewChangeReviewCommenter returns a new NewChangeReviewCommenter service. ChangeReviewCommenter service needs git command in $PATH.

func (*ChangeReviewCommenter) Flush

Flush posts comments which has not been posted yet.

func (*ChangeReviewCommenter) Post

Post accepts a comment and holds it. Flush method actually posts comments to Gerrit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL