blame

package
v0.0.0-...-33de393 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlameDistribution

type BlameDistribution struct {
	// Freq contains the indices of commits that are to blame for this
	// Test producing the specified digest.
	Freq []int `json:"freq"`
}

BlameDistribution contains the data about which commits might have introduced Untriaged digests. TODO(kjlubick): This type might not make it to the frontend at all, in which case, it should be deleted. Otherwise, perhaps we can directly return []tiling.Commit.

func (*BlameDistribution) IsEmpty

func (b *BlameDistribution) IsEmpty() bool

type Blamer

type Blamer interface {
	// GetBlamesForTest returns the list of WeightedBlame for the given test.
	GetBlamesForTest(testName types.TestName) []WeightedBlame

	// GetBlame returns the indices of the provided list of commits that likely
	// caused the given test name/digest pair. If the result is empty we are not
	// able to determine blame, because the test name/digest appeared prior
	// to the current tile.
	GetBlame(testName types.TestName, digest types.Digest, commits []tiling.Commit) BlameDistribution
}

Blamer provides the results of blame calculations from a given tile and set of expectations. Specifically, blame is trying to identify who is responsible for Untriaged digests showing up (it essentially ignores positive/negative digests). A Blamer should be immutable after creation.

type BlamerImpl

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

BlamerImpl implements the Blamer interface.

func New

func New(tile *tiling.Tile, exp expectations.ReadOnly) (*BlamerImpl, error)

New returns a new Blamer instance and error. The error is not nil if the first run of calculating the blame lists failed.

func (*BlamerImpl) GetBlame

func (b *BlamerImpl) GetBlame(testName types.TestName, digest types.Digest, commits []tiling.Commit) BlameDistribution

GetBlame fulfills the Blamer interface.

func (*BlamerImpl) GetBlamesForTest

func (b *BlamerImpl) GetBlamesForTest(testName types.TestName) []WeightedBlame

GetBlamesForTest fulfills the Blamer interface.

type WeightedBlame

type WeightedBlame struct {
	Author string  `json:"author"`
	Prob   float64 `json:"prob"`
}

WeightedBlame combines an authors name with a probability that they are on a blamelist. This is aggregated over the digests of a test.

type WeightedBlameSlice

type WeightedBlameSlice []WeightedBlame

Sorting wrapper around WeightedBlame.

func (WeightedBlameSlice) Len

func (w WeightedBlameSlice) Len() int

func (WeightedBlameSlice) Less

func (w WeightedBlameSlice) Less(i, j int) bool

func (WeightedBlameSlice) Swap

func (w WeightedBlameSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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