chromium

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinChangedFiles = 1
	MaxChangedFiles = 100
)

The range of the number of changed files to enable RTS. If the number of changed files is not in this range, then RTS is disabled. Note that 99.3% of developer-authored git commits change <= 100 files, see bit.ly/chromium-rts

Variables

View Source
var File_infra_rts_internal_chromium_rts_chromium_proto protoreflect.FileDescriptor

Functions

func NewBQClient

func NewBQClient(ctx context.Context, auth *auth.Authenticator) (*bigquery.Client, error)

func PrepareOutDir

func PrepareOutDir(path string, append bool, clearPattern string) error

prepareOutDir ensures that a dir exists and does not have files that match clearPattern glob, e.g. "*.jsonl.gz".

func ReadTestFiles

func ReadTestFiles(r io.Reader, callback func(*TestFile) error) error

ReadTestFiles reads test files written by writeTestFilesFrom().

func SubcommandCommandFetchDurations

func SubcommandCommandFetchDurations(authOpt *auth.Options) *subcommands.Command

func SubcommandCommandFetchRejections

func SubcommandCommandFetchRejections(authOpt *auth.Options) *subcommands.Command

func WriteFilterFile

func WriteFilterFile(fileName string, toSkip []string) error

func WriteInvertedFilterFile

func WriteInvertedFilterFile(fileName string, toSkip []string) error

func WriteTestFiles

func WriteTestFiles(ctx context.Context, bqClient *bigquery.Client, w io.Writer) error

writeTestFiles writes TestFile protobuf messages to w in JSON Lines format.

Types

type BaseCommandRun

type BaseCommandRun struct {
	subcommands.CommandRunBase
}

func (*BaseCommandRun) Done

func (r *BaseCommandRun) Done(err error) int

type BaseSelectRun

type BaseSelectRun struct {
	BaseCommandRun

	Checkout           string
	ModelDir           string
	Out                string
	TargetChangeRecall float64
	IgnoreExceptions   bool
	ChangeRef          string
	GenerateInverse    bool

	ChangedFiles stringset.Set        // files different between origin/main and the working tree
	TestFiles    map[string]*TestFile // indexed by source-absolute test file name
	Strategy     git.SelectionStrategy
}

func (*BaseSelectRun) LoadChangedFiles

func (r *BaseSelectRun) LoadChangedFiles() error

LoadChangedFiles initializes r.changedFiles.

func (*BaseSelectRun) LoadGraph

func (r *BaseSelectRun) LoadGraph(fileName string) error

LoadGraph loads r.strategy.Graph from the model.

func (*BaseSelectRun) LoadStrategy

func (r *BaseSelectRun) LoadStrategy(cfgFileName string) error

loadStrategy initializes r.strategy fields, except r.strategy.Graph.

func (*BaseSelectRun) LoadTestFileSet

func (r *BaseSelectRun) LoadTestFileSet(fileName string) error

LoadTestFileSet loads r.testFiles.

func (*BaseSelectRun) LogChangedFiles

func (r *BaseSelectRun) LogChangedFiles(ctx context.Context)

func (*BaseSelectRun) ValidateFlags

func (r *BaseSelectRun) ValidateFlags() error

type GitBasedStrategyConfig

type GitBasedStrategyConfig struct {

	// Value for git.EdgeReader.ChangeLogDistanceFactor;
	ChangeLogDistanceFactor float32 `` /* 136-byte string literal not displayed */
	// Value for git.EdgeReader.FileStructureDistanceFactor.
	FileStructureDistanceFactor float32 `` /* 148-byte string literal not displayed */
	// Thresholds with change recalls and savings,
	// ordered by change recall.
	Thresholds []*proto.Threshold `protobuf:"bytes,3,rep,name=thresholds,proto3" json:"thresholds,omitempty"`
	// contains filtered or unexported fields
}

Configuration of a git-based selection strategy.

func (*GitBasedStrategyConfig) Descriptor deprecated

func (*GitBasedStrategyConfig) Descriptor() ([]byte, []int)

Deprecated: Use GitBasedStrategyConfig.ProtoReflect.Descriptor instead.

func (*GitBasedStrategyConfig) GetChangeLogDistanceFactor

func (x *GitBasedStrategyConfig) GetChangeLogDistanceFactor() float32

func (*GitBasedStrategyConfig) GetFileStructureDistanceFactor

func (x *GitBasedStrategyConfig) GetFileStructureDistanceFactor() float32

func (*GitBasedStrategyConfig) GetThresholds

func (x *GitBasedStrategyConfig) GetThresholds() []*proto.Threshold

func (*GitBasedStrategyConfig) ProtoMessage

func (*GitBasedStrategyConfig) ProtoMessage()

func (*GitBasedStrategyConfig) ProtoReflect

func (x *GitBasedStrategyConfig) ProtoReflect() protoreflect.Message

func (*GitBasedStrategyConfig) Reset

func (x *GitBasedStrategyConfig) Reset()

func (*GitBasedStrategyConfig) String

func (x *GitBasedStrategyConfig) String() string

type TestFile

type TestFile struct {

	// Source-absolute path to the test file, e.g.
	// "//chrome/renderer/autofill/password_autofill_agent_browsertest.cc".
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// Names of tests known to be defined in the the file.
	// The names are native to the test framework, e.g.
	// "PasswordAutofillAgentTest.NoMayUsePlaceholderAndPlaceholderOnForm".
	TestNames []string `protobuf:"bytes,2,rep,name=test_names,json=testNames,proto3" json:"test_names,omitempty"`
	// Test targets where the test file was observed, e.g. "browser_tests".
	TestTargets []string `protobuf:"bytes,3,rep,name=test_targets,json=testTargets,proto3" json:"test_targets,omitempty"`
	// contains filtered or unexported fields
}

A test file used in Chromium.

Used in an RTS model, in file "test-files.jsonl" encoded as JSON Lines of TestFile protojson messages.

func (*TestFile) Descriptor deprecated

func (*TestFile) Descriptor() ([]byte, []int)

Deprecated: Use TestFile.ProtoReflect.Descriptor instead.

func (*TestFile) GetPath

func (x *TestFile) GetPath() string

func (*TestFile) GetTestNames

func (x *TestFile) GetTestNames() []string

func (*TestFile) GetTestTargets

func (x *TestFile) GetTestTargets() []string

func (*TestFile) ProtoMessage

func (*TestFile) ProtoMessage()

func (*TestFile) ProtoReflect

func (x *TestFile) ProtoReflect() protoreflect.Message

func (*TestFile) Reset

func (x *TestFile) Reset()

func (*TestFile) String

func (x *TestFile) String() string

Jump to

Keyboard shortcuts

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