sources

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildIndexer

type BuildIndexer interface {
	// contains filtered or unexported methods
}

BuildIndexer is an interface that describes the buildnum to row index mapping used to retrieve data about individual builds from the JSON file. This is an interface because the JSON format describing failure clusters has 2 ways of recording the mapping info.

type Cluster

type Cluster struct {
	Identifier string  `json:"id"`
	Key        string  `json:"key"`
	Text       string  `json:"text"`
	Tests      []*Test `json:"tests"`
	// contains filtered or unexported fields
}

Cluster holds information about a failure cluster.

func (*Cluster) Body

func (c *Cluster) Body(closedIssues []*githubapi.Issue) string

Body returns the body text of the github issue and *must* contain the output of ID(). closedIssues is a (potentially empty) slice containing all closed issues authored by this bot that contain ID() in their body. If Body returns an empty string no issue is created.

func (*Cluster) ID

func (c *Cluster) ID() string

ID yields the string identifier that uniquely identifies this issue. This ID must appear in the body of the issue. DO NOT CHANGE how this ID is formatted or duplicate issues may be created on github.

func (*Cluster) Labels

func (c *Cluster) Labels() []string

Labels returns the labels to apply to the issue created for this cluster on github.

func (*Cluster) Owners

func (c *Cluster) Owners() []string

Owners returns the list of usernames to assign to this issue on github.

func (*Cluster) Priority

func (c *Cluster) Priority() (string, bool)

Priority calculates and returns the priority of this issue. The returned bool indicates if the returned priority is valid and can be used.

func (*Cluster) Title

func (c *Cluster) Title() string

Title is the string to use as the github issue title.

type ContigIndexer

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

ContigIndexer is a BuildIndexer implementation for when the buildnum to row index mapping describes a contiguous set of rows via 3 ints.

type DictIndexer

type DictIndexer map[string]interface{}

DictIndexer is a BuildIndexer implementation for when the buildnum to row index mapping is simply a dictionary. The value type of this dictionary is interface instead of int so that we don't have to convert the original map.

type FlakyJob

type FlakyJob struct {
	// Name is the job's name.
	Name string
	// Consistency is the percentage of builds that passed.
	Consistency *float64 `json:"consistency"`
	// FlakeCount is the number of flakes.
	FlakeCount *int `json:"flakes"`
	// FlakyTests is a map of test names to the number of times that test failed.
	// Any test that failed at least once a day for the past week on this job is included.
	FlakyTests map[string]int `json:"flakiest"`
	// contains filtered or unexported fields
}

FlakyJob is a struct that represents a single job and the flake data associated with it. FlakyJob implements the Issue interface so that it can be synced with github issues via the IssueCreator.

func (*FlakyJob) Body

func (fj *FlakyJob) Body(closedIssues []*githubapi.Issue) string

Body returns the body text of the github issue and *must* contain the output of ID(). closedIssues is a (potentially empty) slice containing all closed issues authored by this bot that contain ID() in their body. If Body returns an empty string no issue is created.

func (*FlakyJob) ID

func (fj *FlakyJob) ID() string

ID yields the string identifier that uniquely identifies this issue. This ID must appear in the body of the issue. DO NOT CHANGE how this ID is formatted or duplicate issues may be created on github.

func (*FlakyJob) Labels

func (fj *FlakyJob) Labels() []string

Labels returns the labels to apply to the issue created for this flaky job on github.

func (*FlakyJob) Owners

func (fj *FlakyJob) Owners() []string

Owners returns the list of usernames to assign to this issue on github.

func (*FlakyJob) Priority

func (fj *FlakyJob) Priority() (string, bool)

Priority calculates and returns the priority of this issue The returned bool indicates if the returned priority is valid and can be used

func (*FlakyJob) TestsSorted

func (fj *FlakyJob) TestsSorted() []string

TestsSorted returns a slice of the testnames from a FlakyJob's FlakyTests map. The slice is sorted by descending number of failures for the tests.

func (*FlakyJob) Title

func (fj *FlakyJob) Title() string

Title yields the initial title text of the github issue.

type FlakyJobReporter

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

FlakyJobReporter is a munger that creates github issues for the flakiest kubernetes jobs. The flakiest jobs are parsed from JSON generated by /test-infra/experiment/bigquery/flakes.sh

func (*FlakyJobReporter) Issues

func (fjr *FlakyJobReporter) Issues(c *creator.IssueCreator) ([]creator.Issue, error)

Issues is the main work method of FlakyJobReporter. It fetches and parses flaky job data, then syncs the top issues to github with the IssueCreator.

func (*FlakyJobReporter) RegisterFlags

func (fjr *FlakyJobReporter) RegisterFlags()

RegisterFlags registers options for this munger; returns any that require a restart when changed.

type Job

type Job struct {
	Name   string `json:"name"`
	Builds []int  `json:"builds"`
}

Job holds a name and list of build numbers

type Test

type Test struct {
	Name string `json:"name"`
	Jobs []*Job `json:"jobs"`
}

Test holds a name and list of jobs

type TriageFiler

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

TriageFiler files issues for clustered test failures.

func (*TriageFiler) Issues

func (f *TriageFiler) Issues(c *creator.IssueCreator) ([]creator.Issue, error)

Issues is the main work function of the TriageFiler. It fetches and parses cluster data, then syncs the top issues to github with the IssueCreator.

func (*TriageFiler) RegisterFlags

func (f *TriageFiler) RegisterFlags()

RegisterFlags registers options for this munger; returns any that require a restart when changed.

Jump to

Keyboard shortcuts

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