rpc

package
v0.0.0-...-c2c6062 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Overview

Package rpc contains implementations for remote proceedure calls exposed by LUCI Analysis. Explore RPCs at https://luci-analysis.appspot.com/rpcexplorer/.

Index

Constants

View Source
const MaxBatchGetClustersRequestSize = 1000

MaxBatchGetClustersRequestSize is the maximum number of clusters to obtain impact for in one call to BatchGetClusters().

View Source
const MaxClusterRequestSize = 1000

MaxClusterRequestSize is the maximum number of test results to cluster in one call to Cluster(...).

Variables

View Source
var (
	GenericKeyPattern = "[a-z0-9\\-]+"
	// ClusterNameRe performs partial validation of a cluster resource name.
	// Cluster algorithm and ID must be further validated by
	// ClusterID.Validate().
	ClusterNameRe = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/clusters/(` + GenericKeyPattern + `)/(` + GenericKeyPattern + `)$`)
	// ClusterFailuresNameRe performs a partial validation of the resource
	// name for a cluster's failures.
	// Cluster algorithm and ID must be further validated by
	// ClusterID.Validate().
	ClusterFailuresNameRe = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/clusters/(` + GenericKeyPattern + `)/(` + GenericKeyPattern + `)/failures$`)
	// ClusterExoneratedTestVariantsNameRe and
	// ClusterExoneratedTestVariantBranchesNameRe performs a partial
	// validation of the resource name for a cluster's exonerated
	// test variant (branches).
	// Cluster algorithm and ID must be further validated by
	// ClusterID.Validate().
	ClusterExoneratedTestVariantsNameRe        = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/clusters/(` + GenericKeyPattern + `)/(` + GenericKeyPattern + `)/exoneratedTestVariants$`)
	ClusterExoneratedTestVariantBranchesNameRe = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/clusters/(` + GenericKeyPattern + `)/(` + GenericKeyPattern + `)/exoneratedTestVariantBranches$`)
	ProjectNameRe                              = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)$`)
	ProjectConfigNameRe                        = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/config$`)
	ProjectMetricNameRe                        = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/metrics/(` + metrics.MetricIDPattern + `)$`)
	ReclusteringProgressNameRe                 = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/reclusteringProgress$`)
	RuleNameRe                                 = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/rules/(` + rules.RuleIDRePattern + `)$`)
	// TestVariantBranchNameRe performs a partial validation of a TestVariantBranch name.
	// Test ID must be further validated with ValidateTestID.
	TestVariantBranchNameRe = regexp.MustCompile(`^projects/(` + pbutil.ProjectRePattern + `)/tests/([^/]+)/variants/(` + config.VariantHashRePattern + `)/refs/(` + config.RefHashRePattern + `)$`)
)

Regular expressions for matching resource names used in APIs.

Functions

func NewBuganizerTesterServer

func NewBuganizerTesterServer() *pb.DecoratedBuganizerTester

func NewChangepointsServer

func NewChangepointsServer(changePointClient ChangePointClient) pb.ChangepointsServer

NewChangepointsServer returns a new pb.ChangepointsServer.

func NewClustersServer

func NewClustersServer(analysisClient AnalysisClient) *pb.DecoratedClusters

func NewMetricsServer

func NewMetricsServer() *pb.DecoratedMetrics

func NewProjectsServer

func NewProjectsServer() *pb.DecoratedProjects

func NewRulesServer

func NewRulesServer(uiBaseURL string, client buganizer.Client, selfEmail string) pb.RulesServer

NewRulesServer returns a new pb.RulesServer.

func NewTestHistoryServer

func NewTestHistoryServer() pb.TestHistoryServer

NewTestHistoryServer returns a new pb.TestHistoryServer.

func NewTestVariantBranchesServer

func NewTestVariantBranchesServer(tvc TestVerdictClient, trc TestResultClient, sc sorbet.GenerateClient) pb.TestVariantBranchesServer

NewTestVariantBranchesServer returns a new pb.TestVariantBranchesServer.

func NewTestVariantsServer

func NewTestVariantsServer() pb.TestVariantsServer

NewTestVariantsServer returns a new pb.TestVariantServer.

func ValidateRefHash

func ValidateRefHash(refHash string) error

func ValidateVariantHash

func ValidateVariantHash(variantHash string) error

Types

type AnalysisClient

type AnalysisClient interface {
	ReadCluster(ctx context.Context, luciProject string, clusterID clustering.ClusterID) (*analysis.Cluster, error)
	ReadClusterFailures(ctx context.Context, options analysis.ReadClusterFailuresOptions) (cfs []*analysis.ClusterFailure, err error)
	ReadClusterExoneratedTestVariants(ctx context.Context, options analysis.ReadClusterExoneratedTestVariantsOptions) (tvs []*analysis.ExoneratedTestVariant, err error)
	ReadClusterExoneratedTestVariantBranches(ctx context.Context, options analysis.ReadClusterExoneratedTestVariantBranchesOptions) (tvbs []*analysis.ExoneratedTestVariantBranch, err error)
	ReadClusterHistory(ctx context.Context, options analysis.ReadClusterHistoryOptions) (ret []*analysis.ReadClusterHistoryDay, err error)
	QueryClusterSummaries(ctx context.Context, luciProject string, options *analysis.QueryClusterSummariesOptions) ([]*analysis.ClusterSummary, error)
}

type ChangePointClient

type ChangePointClient interface {
	// ReadChangepoints read changepoints for a certain week. The week is specified by any time at that week in UTC.
	ReadChangepoints(ctx context.Context, project string, week time.Time) ([]*changepoints.ChangepointDetailRow, error)
	ReadChangepointGroupSummaries(ctx context.Context, opts changepoints.ReadChangepointGroupSummariesOptions) ([]*changepoints.GroupSummary, string, error)
	ReadChangepointsInGroup(ctx context.Context, opts changepoints.ReadChangepointsInGroupOptions) (changepoints []*changepoints.ChangepointRow, err error)
}

type TestResultClient

type TestResultClient interface {
	ReadTestVerdictsPerSourcePosition(ctx context.Context, options testresults.ReadTestVerdictsPerSourcePositionOptions) ([]*testresults.CommitWithVerdicts, error)
	ReadSourceVerdicts(ctx context.Context, options testresults.ReadSourceVerdictsOptions) ([]testresults.SourceVerdict, error)
}

type TestVerdictClient

type TestVerdictClient interface {
	ReadTestVerdictAfterPosition(ctx context.Context, options testverdicts.ReadVerdictAtOrAfterPositionOptions) (*testverdicts.SourceVerdict, error)
}

Jump to

Keyboard shortcuts

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