Documentation ¶
Overview ¶
Package util contains utility functions
Package util contains utility functions ¶
Package util contains utility functions ¶
Package util contains utility functions ¶
Package util contains utility functions
Index ¶
- Constants
- func BuilderFromConfigBuilder(builder *configpb.Builder) *bbpb.BuilderID
- func ConstructBuganizerURLForAnalysis(commitReviewURL string, analysisURL string) string
- func ConstructBuildURL(ctx context.Context, bbid int64) string
- func ConstructCompileAnalysisURL(project string, bbid int64) string
- func ConstructGerritCodeReviewURL(ctx context.Context, gerritClient *gerrit.Client, change *gerritpb.ChangeInfo) string
- func ConstructTestAnalysisURL(project string, analysisID int64) string
- func ConstructTestHistoryURL(project, testID, variantHash string) string
- func GetBuilderGroup(build *bbpb.Build) string
- func GetCanonicalFileName(fp string) string
- func GetDimensionWithKey(dims *pb.Dimensions, key string) *pb.Dimension
- func GetGitilesCommitForBuild(build *bbpb.Build) *bbpb.GitilesCommit
- func GetSheriffRotationsForBuild(build *bbpb.Build) []string
- func GetTaskDimensions(build *bbpb.Build) []*bbpb.RequestedDimension
- func IsCompileStep(step *bbpb.Step) bool
- func MatchedNamedGroup(r *regexp.Regexp, s string) (map[string]string, error)
- func NormalizeFilePath(fp string) string
- func SendHTTPRequest(c context.Context, req *http.Request, timeout time.Duration) (string, error)
- func SortDimension(dimensions []*pb.Dimension)
- func StripExtensionAndCommonSuffixFromFileName(fileName string) string
- func StripExtensionAndCommonSuffixFromFilePath(fp string) string
- func ToDimensionsPB(dimensions []*bbpb.RequestedDimension) *pb.Dimensions
- func ValidateProject(project string) error
- func ValidateRefHash(refHash string) error
- func ValidateVariantHash(variantHash string) error
- func VariantPB(variant string) (*pb.Variant, error)
Constants ¶
const ProjectRePattern = `[a-z0-9\-]{1,40}`
ProjectRePattern is the regular expression pattern that matches validly formed LUCI Project names. From https://source.chromium.org/chromium/infra/infra/+/main:luci/appengine/components/components/config/common.py?q=PROJECT_ID_PATTERN
const RefHashRePattern = `[0-9a-f]{16}`
RefHashRePattern is the regular expression pattern that matches validly formed ref hash. From https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/internal/config/constants.go;l=27
const VariantHashRePattern = `[0-9a-f]{16}`
VariantHashRePattern is the regular expression pattern that matches validly formed variant hash. From https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/internal/config/constants.go;l=23
Variables ¶
This section is empty.
Functions ¶
func ConstructBuganizerURLForAnalysis ¶
ConstructBuganizerURLForAnalysis returns a link to create a bug against LUCI Bisection for wrongly blamed commits
func ConstructBuildURL ¶
ConstructBuildURL returns a link to the build page in Milo given a Buildbucket ID
func ConstructCompileAnalysisURL ¶
ConstructCompileAnalysisURL returns a link to the analysis page in LUCI Bisection given a Buildbucket ID
func ConstructTestAnalysisURL ¶
ConstructTestAnalysisURL returns a link to the analysis page in LUCI Bisection given a Buildbucket ID
func ConstructTestHistoryURL ¶
func GetBuilderGroup ¶
GetBuilderGroup returns the builder group for a build. If there is no builder group set, return empty string.
func GetCanonicalFileName ¶
GetCanonicalFileName return the file name without extension and common suffixes.
func GetDimensionWithKey ¶
func GetDimensionWithKey(dims *pb.Dimensions, key string) *pb.Dimension
func GetGitilesCommitForBuild ¶
func GetGitilesCommitForBuild(build *bbpb.Build) *bbpb.GitilesCommit
GetGitilesCommitForBuild returns the gitiles commit for a build The commit position is taken from output properties if available.
func GetSheriffRotationsForBuild ¶
GetSheriffRotationsForBuild returns the sheriff rotations for a build. If there is no sheriff rotation set, return empty list.
func GetTaskDimensions ¶
func GetTaskDimensions(build *bbpb.Build) []*bbpb.RequestedDimension
func IsCompileStep ¶
Check if a step is compile step. For the moment, we only check for the step name. In the future, we may want to check for step tag (crbug.com/1353978)
func MatchedNamedGroup ¶
MatchedNamedGroup matches a string against a regex with named group and returns a mapping between the named group and the matches
func NormalizeFilePath ¶
NormalizeFilePath returns the normalized the file path. Strips leading "/" or "\" Converts "\\" and "//" to "/" Resolves ".." and "." from the file path e.g. //BUILD.gn -> BUILD.gn ../a/b/c.cc -> a/b/c.cc a/b/./c.cc -> a/b/c.cc
func SendHTTPRequest ¶
func SortDimension ¶
func StripExtensionAndCommonSuffixFromFileName ¶
StripExtensionAndCommonSuffix extension and common suffixes from file name. Examples: file_impl.cc, file_unittest.cc, file_impl_mac.h -> file
func StripExtensionAndCommonSuffixFromFilePath ¶
StripExtensionAndCommonSuffix extension and common suffixes from file path. Same as StripExtensionAndCommonSuffixFromFileName, but maintain the path. If the path is ".", just return the name.
func ToDimensionsPB ¶
func ToDimensionsPB(dimensions []*bbpb.RequestedDimension) *pb.Dimensions
func ValidateProject ¶
func ValidateRefHash ¶
func ValidateVariantHash ¶
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package bqutil contains utility functions for BigQuery.
|
Package bqutil contains utility functions for BigQuery. |
Package changelogutil contains utility functions for changelogs.
|
Package changelogutil contains utility functions for changelogs. |
Package datastoreutil contains utility functions related to datastore entities
|
Package datastoreutil contains utility functions related to datastore entities |
Package loggingutil contains utility functions for logging.
|
Package loggingutil contains utility functions for logging. |
Package protoutil contains the utility functions to convert to protobuf.
|
Package protoutil contains the utility functions to convert to protobuf. |
Package testutil contains utility functions for test.
|
Package testutil contains utility functions for test. |