codereview

package
v0.0.0-...-963fb65 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package codereview defines an interface to a code review system such as Gerrit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeReview

type CodeReview interface {
	// ListModifiedFiles returns a list of the modified files for the given
	// issue at the given Ref, where Ref is a git ref, such a
	// "refs/head/master".
	ListModifiedFiles(ctx context.Context, issue Issue, ref string) ([]ListModifiedFilesResult, error)

	// GetFiles returns the contents of the given file at the given Ref as a
	// byte slice, where Ref is a git ref, such a "refs/head/master".
	GetFile(ctx context.Context, filename string, ref string) ([]byte, error)

	// GetPatchsetInfo returns the most recent patchset Ref of the given issue
	// and also if the issue has been closed . Ref is a git ref, such a
	// "refs/head/master".
	GetPatchsetInfo(ctx context.Context, issue Issue) (string, bool, error)
}

CodeReview represents an abstraction of the information we want from a code review system such as Gerrit.

type Issue

type Issue string

Issue is the identifier for a CodeReview issue.

const MainIssue Issue = "main"

A special value for an issue which means to use the main branch at HEAD.

type ListModifiedFilesResult

type ListModifiedFilesResult struct {
	// Filename relative to the root of the git repo.
	Filename string

	// Deleted is true if the file was deleted at the given patchset.
	Deleted bool
}

ListModifiedFilesResult is the results from calling CodeReview.ListModifiedFiles.

Directories

Path Synopsis
Package gerrit implements CodeReview for Gerrit.
Package gerrit implements CodeReview for Gerrit.

Jump to

Keyboard shortcuts

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