cockroach: github.com/cockroachdb/cockroach/pkg/cmd/internal/issues Index | Files

package issues

import "github.com/cockroachdb/cockroach/pkg/cmd/internal/issues"

Index

Package Files

condense.go issues.go

Constants

const (

    // CockroachPkgPrefix is the crdb package prefix.
    CockroachPkgPrefix = "github.com/cockroachdb/cockroach/pkg/"
)
const UnitTestFailureBody = "" /* 1376 byte string literal not displayed */

UnitTestFailureBody is a body template suitable for posting issues about vanilla Go test failures.

const UnitTestFailureTitle = `{{ shortpkg .PackageName }}: {{.TestName}} failed`

UnitTestFailureTitle is a title template suitable for posting issues about vanilla Go test failures.

func CanPost Uses

func CanPost() bool

CanPost returns true if the github API token environment variable is set to a nontrivial value.

func Post Uses

func Post(ctx context.Context, req PostRequest) error

Post either creates a new issue for a failed test, or posts a comment to an existing open issue.

type CondensedMessage Uses

type CondensedMessage string

A CondensedMessage is a test log output garnished with useful helper methods that extract concise information for seamless debugging.

func (CondensedMessage) Digest Uses

func (s CondensedMessage) Digest(n int) string

Digest returns the last n lines of the test log. If a panic or fatal error occurred, it instead returns the last n lines preceding that event, the event itself, and the first stack trace.

func (CondensedMessage) FatalOrPanic Uses

func (s CondensedMessage) FatalOrPanic(numPrecedingLines int) FatalOrPanic

FatalOrPanic constructs a FatalOrPanic. If no fatal or panic occurred in the test, the zero value is returned.

func (CondensedMessage) String Uses

func (s CondensedMessage) String() string

String calls .Digest(30).

type FatalOrPanic Uses

type FatalOrPanic struct {
    LastLines,
    Error,
    FirstStack string // the first stack, i.e. the goroutine relevant to error
}

FatalOrPanic contains a fatal error or panic obtained from a test log.

type PostRequest Uses

type PostRequest struct {
    // The title of the issue. See UnitTestFailureTitleTemplate for an example.
    TitleTemplate,

    BodyTemplate,

    PackageName,

    TestName,

    Message,

    Artifacts,

    AuthorEmail string
    // Additional labels that will be added to the issue. They will be created
    // as necessary (as a side effect of creating an issue with them). An
    // existing issue may be adopted even if it does not have these labels.
    ExtraLabels []string
}

A PostRequest contains the information needed to create an issue about a test failure.

type TemplateData Uses

type TemplateData struct {
    PostRequest
    Parameters       []string
    CondensedMessage CondensedMessage
    Commit           string
    Branch           string
    ArtifactsURL     string
    URL              string
    Assignee         interface{} // lazy
    RelatedIssues    []github.Issue
}

TemplateData holds the data available in (PostRequest).(Body|Title)Template, respectively. On top of the below, there are also a few functions, for which UnitTestFailureBody can serve as a reference.

Package issues imports 14 packages (graph) and is imported by 2 packages. Updated 2020-02-13. Refresh now. Tools for package owners.