repo
stringlengths
5
67
path
stringlengths
4
218
func_name
stringlengths
0
151
original_string
stringlengths
52
373k
language
stringclasses
6 values
code
stringlengths
52
373k
code_tokens
listlengths
10
512
docstring
stringlengths
3
47.2k
docstring_tokens
listlengths
3
234
sha
stringlengths
40
40
url
stringlengths
85
339
partition
stringclasses
3 values
kubernetes/test-infra
prow/metrics/metrics.go
PushMetrics
func PushMetrics(component, endpoint string, interval time.Duration) { sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, syscall.SIGTERM) for { select { case <-time.Tick(interval): if err := push.FromGatherer(component, push.HostnameGroupingKey(), endpoint, prometheus.DefaultGatherer); err != n...
go
func PushMetrics(component, endpoint string, interval time.Duration) { sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, syscall.SIGTERM) for { select { case <-time.Tick(interval): if err := push.FromGatherer(component, push.HostnameGroupingKey(), endpoint, prometheus.DefaultGatherer); err != n...
[ "func", "PushMetrics", "(", "component", ",", "endpoint", "string", ",", "interval", "time", ".", "Duration", ")", "{", "sig", ":=", "make", "(", "chan", "os", ".", "Signal", ",", "1", ")", "\n", "signal", ".", "Notify", "(", "sig", ",", "os", ".", ...
// PushMetrics is meant to run in a goroutine and continuously push // metrics to the provided endpoint.
[ "PushMetrics", "is", "meant", "to", "run", "in", "a", "goroutine", "and", "continuously", "push", "metrics", "to", "the", "provided", "endpoint", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/metrics/metrics.go#L33-L48
test
kubernetes/test-infra
prow/kube/ratelimiter.go
RateLimiter
func RateLimiter(controllerName string) workqueue.RateLimitingInterface { rl := workqueue.NewMaxOfRateLimiter( workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 120*time.Second), &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(1000), 50000)}, ) return workqueue.NewNamedRateLimit...
go
func RateLimiter(controllerName string) workqueue.RateLimitingInterface { rl := workqueue.NewMaxOfRateLimiter( workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 120*time.Second), &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(1000), 50000)}, ) return workqueue.NewNamedRateLimit...
[ "func", "RateLimiter", "(", "controllerName", "string", ")", "workqueue", ".", "RateLimitingInterface", "{", "rl", ":=", "workqueue", ".", "NewMaxOfRateLimiter", "(", "workqueue", ".", "NewItemExponentialFailureRateLimiter", "(", "5", "*", "time", ".", "Millisecond", ...
// RateLimiter creates a ratelimiting queue for a given prow controller.
[ "RateLimiter", "creates", "a", "ratelimiting", "queue", "for", "a", "given", "prow", "controller", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/kube/ratelimiter.go#L27-L33
test
kubernetes/test-infra
prow/plugins/dco/dco.go
checkExistingStatus
func checkExistingStatus(gc gitHubClient, l *logrus.Entry, org, repo, sha string) (string, error) { statuses, err := gc.ListStatuses(org, repo, sha) if err != nil { return "", fmt.Errorf("error listing pull request statuses: %v", err) } existingStatus := "" for _, status := range statuses { if status.Context ...
go
func checkExistingStatus(gc gitHubClient, l *logrus.Entry, org, repo, sha string) (string, error) { statuses, err := gc.ListStatuses(org, repo, sha) if err != nil { return "", fmt.Errorf("error listing pull request statuses: %v", err) } existingStatus := "" for _, status := range statuses { if status.Context ...
[ "func", "checkExistingStatus", "(", "gc", "gitHubClient", ",", "l", "*", "logrus", ".", "Entry", ",", "org", ",", "repo", ",", "sha", "string", ")", "(", "string", ",", "error", ")", "{", "statuses", ",", "err", ":=", "gc", ".", "ListStatuses", "(", ...
// checkExistingStatus will retrieve the current status of the DCO context for // the provided SHA.
[ "checkExistingStatus", "will", "retrieve", "the", "current", "status", "of", "the", "DCO", "context", "for", "the", "provided", "SHA", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/dco/dco.go#L125-L141
test
kubernetes/test-infra
prow/plugins/dco/dco.go
checkExistingLabels
func checkExistingLabels(gc gitHubClient, l *logrus.Entry, org, repo string, number int) (hasYesLabel, hasNoLabel bool, err error) { labels, err := gc.GetIssueLabels(org, repo, number) if err != nil { return false, false, fmt.Errorf("error getting pull request labels: %v", err) } for _, l := range labels { if ...
go
func checkExistingLabels(gc gitHubClient, l *logrus.Entry, org, repo string, number int) (hasYesLabel, hasNoLabel bool, err error) { labels, err := gc.GetIssueLabels(org, repo, number) if err != nil { return false, false, fmt.Errorf("error getting pull request labels: %v", err) } for _, l := range labels { if ...
[ "func", "checkExistingLabels", "(", "gc", "gitHubClient", ",", "l", "*", "logrus", ".", "Entry", ",", "org", ",", "repo", "string", ",", "number", "int", ")", "(", "hasYesLabel", ",", "hasNoLabel", "bool", ",", "err", "error", ")", "{", "labels", ",", ...
// checkExistingLabels will check the provided PR for the dco sign off labels, // returning bool's indicating whether the 'yes' and the 'no' label are present.
[ "checkExistingLabels", "will", "check", "the", "provided", "PR", "for", "the", "dco", "sign", "off", "labels", "returning", "bool", "s", "indicating", "whether", "the", "yes", "and", "the", "no", "label", "are", "present", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/dco/dco.go#L145-L161
test
kubernetes/test-infra
prow/plugins/dco/dco.go
handle
func handle(gc gitHubClient, cp commentPruner, log *logrus.Entry, org, repo string, pr github.PullRequest, addComment bool) error { l := log.WithField("pr", pr.Number) commitsMissingDCO, err := checkCommitMessages(gc, l, org, repo, pr.Number) if err != nil { l.WithError(err).Infof("Error running DCO check against...
go
func handle(gc gitHubClient, cp commentPruner, log *logrus.Entry, org, repo string, pr github.PullRequest, addComment bool) error { l := log.WithField("pr", pr.Number) commitsMissingDCO, err := checkCommitMessages(gc, l, org, repo, pr.Number) if err != nil { l.WithError(err).Infof("Error running DCO check against...
[ "func", "handle", "(", "gc", "gitHubClient", ",", "cp", "commentPruner", ",", "log", "*", "logrus", ".", "Entry", ",", "org", ",", "repo", "string", ",", "pr", "github", ".", "PullRequest", ",", "addComment", "bool", ")", "error", "{", "l", ":=", "log"...
// 1. Check commit messages in the pull request for the sign-off string // 2. Check the existing status context value // 3. Check the existing PR labels // 4. If signed off, apply appropriate labels and status context. // 5. If not signed off, apply appropriate labels and status context and add a comment.
[ "1", ".", "Check", "commit", "messages", "in", "the", "pull", "request", "for", "the", "sign", "-", "off", "string", "2", ".", "Check", "the", "existing", "status", "context", "value", "3", ".", "Check", "the", "existing", "PR", "labels", "4", ".", "If...
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/dco/dco.go#L248-L270
test
kubernetes/test-infra
prow/plugins/dco/dco.go
MarkdownSHAList
func MarkdownSHAList(org, repo string, list []github.GitCommit) string { lines := make([]string, len(list)) lineFmt := "- [%s](https://github.com/%s/%s/commits/%s) %s" for i, commit := range list { if commit.SHA == "" { continue } // if we somehow encounter a SHA that's less than 7 characters, we will // ...
go
func MarkdownSHAList(org, repo string, list []github.GitCommit) string { lines := make([]string, len(list)) lineFmt := "- [%s](https://github.com/%s/%s/commits/%s) %s" for i, commit := range list { if commit.SHA == "" { continue } // if we somehow encounter a SHA that's less than 7 characters, we will // ...
[ "func", "MarkdownSHAList", "(", "org", ",", "repo", "string", ",", "list", "[", "]", "github", ".", "GitCommit", ")", "string", "{", "lines", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "list", ")", ")", "\n", "lineFmt", ":=", "\"- [%s](h...
// MardkownSHAList prints the list of commits in a markdown-friendly way.
[ "MardkownSHAList", "prints", "the", "list", "of", "commits", "in", "a", "markdown", "-", "friendly", "way", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/dco/dco.go#L273-L293
test
kubernetes/test-infra
prow/pod-utils/gcs/target.go
PathForSpec
func PathForSpec(spec *downwardapi.JobSpec, pathSegment RepoPathBuilder) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob: return path.Join(NonPRLogs, spec.Job, spec.BuildID) case prowapi.PresubmitJob: return path.Join(PRLogs, "pull", pathSegment(spec.Refs.Org, spec.Refs.Repo), strconv...
go
func PathForSpec(spec *downwardapi.JobSpec, pathSegment RepoPathBuilder) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob: return path.Join(NonPRLogs, spec.Job, spec.BuildID) case prowapi.PresubmitJob: return path.Join(PRLogs, "pull", pathSegment(spec.Refs.Org, spec.Refs.Repo), strconv...
[ "func", "PathForSpec", "(", "spec", "*", "downwardapi", ".", "JobSpec", ",", "pathSegment", "RepoPathBuilder", ")", "string", "{", "switch", "spec", ".", "Type", "{", "case", "prowapi", ".", "PeriodicJob", ",", "prowapi", ".", "PostsubmitJob", ":", "return", ...
// PathForSpec determines the GCS path prefix for files uploaded // for a specific job spec
[ "PathForSpec", "determines", "the", "GCS", "path", "prefix", "for", "files", "uploaded", "for", "a", "specific", "job", "spec" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/gcs/target.go#L40-L52
test
kubernetes/test-infra
prow/pod-utils/gcs/target.go
AliasForSpec
func AliasForSpec(spec *downwardapi.JobSpec) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob, prowapi.BatchJob: return "" case prowapi.PresubmitJob: return path.Join(PRLogs, "directory", spec.Job, fmt.Sprintf("%s.txt", spec.BuildID)) default: logrus.Fatalf("unknown job spec type: %...
go
func AliasForSpec(spec *downwardapi.JobSpec) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob, prowapi.BatchJob: return "" case prowapi.PresubmitJob: return path.Join(PRLogs, "directory", spec.Job, fmt.Sprintf("%s.txt", spec.BuildID)) default: logrus.Fatalf("unknown job spec type: %...
[ "func", "AliasForSpec", "(", "spec", "*", "downwardapi", ".", "JobSpec", ")", "string", "{", "switch", "spec", ".", "Type", "{", "case", "prowapi", ".", "PeriodicJob", ",", "prowapi", ".", "PostsubmitJob", ",", "prowapi", ".", "BatchJob", ":", "return", "\...
// AliasForSpec determines the GCS path aliases for a job spec
[ "AliasForSpec", "determines", "the", "GCS", "path", "aliases", "for", "a", "job", "spec" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/gcs/target.go#L55-L65
test
kubernetes/test-infra
prow/pod-utils/gcs/target.go
RootForSpec
func RootForSpec(spec *downwardapi.JobSpec) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob: return path.Join(NonPRLogs, spec.Job) case prowapi.PresubmitJob, prowapi.BatchJob: return path.Join(PRLogs, "directory", spec.Job) default: logrus.Errorf("unknown job spec type: %v", spec.T...
go
func RootForSpec(spec *downwardapi.JobSpec) string { switch spec.Type { case prowapi.PeriodicJob, prowapi.PostsubmitJob: return path.Join(NonPRLogs, spec.Job) case prowapi.PresubmitJob, prowapi.BatchJob: return path.Join(PRLogs, "directory", spec.Job) default: logrus.Errorf("unknown job spec type: %v", spec.T...
[ "func", "RootForSpec", "(", "spec", "*", "downwardapi", ".", "JobSpec", ")", "string", "{", "switch", "spec", ".", "Type", "{", "case", "prowapi", ".", "PeriodicJob", ",", "prowapi", ".", "PostsubmitJob", ":", "return", "path", ".", "Join", "(", "NonPRLogs...
// RootForSpec determines the root GCS path for storing artifacts about // the provided job.
[ "RootForSpec", "determines", "the", "root", "GCS", "path", "for", "storing", "artifacts", "about", "the", "provided", "job", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/gcs/target.go#L94-L104
test
kubernetes/test-infra
prow/pod-utils/gcs/target.go
NewSingleDefaultRepoPathBuilder
func NewSingleDefaultRepoPathBuilder(defaultOrg, defaultRepo string) RepoPathBuilder { return func(org, repo string) string { if org == defaultOrg && repo == defaultRepo { return "" } // handle gerrit repo repo = strings.Replace(repo, "/", "_", -1) return fmt.Sprintf("%s_%s", org, repo) } }
go
func NewSingleDefaultRepoPathBuilder(defaultOrg, defaultRepo string) RepoPathBuilder { return func(org, repo string) string { if org == defaultOrg && repo == defaultRepo { return "" } // handle gerrit repo repo = strings.Replace(repo, "/", "_", -1) return fmt.Sprintf("%s_%s", org, repo) } }
[ "func", "NewSingleDefaultRepoPathBuilder", "(", "defaultOrg", ",", "defaultRepo", "string", ")", "RepoPathBuilder", "{", "return", "func", "(", "org", ",", "repo", "string", ")", "string", "{", "if", "org", "==", "defaultOrg", "&&", "repo", "==", "defaultRepo", ...
// NewSingleDefaultRepoPathBuilder returns a builder that handles the legacy path // encoding where a path will contain org and repo for all but one default repo
[ "NewSingleDefaultRepoPathBuilder", "returns", "a", "builder", "that", "handles", "the", "legacy", "path", "encoding", "where", "a", "path", "will", "contain", "org", "and", "repo", "for", "all", "but", "one", "default", "repo" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/gcs/target.go#L127-L136
test
kubernetes/test-infra
prow/pod-utils/gcs/target.go
NewExplicitRepoPathBuilder
func NewExplicitRepoPathBuilder() RepoPathBuilder { return func(org, repo string) string { // handle gerrit repo repo = strings.Replace(repo, "/", "_", -1) return fmt.Sprintf("%s_%s", org, repo) } }
go
func NewExplicitRepoPathBuilder() RepoPathBuilder { return func(org, repo string) string { // handle gerrit repo repo = strings.Replace(repo, "/", "_", -1) return fmt.Sprintf("%s_%s", org, repo) } }
[ "func", "NewExplicitRepoPathBuilder", "(", ")", "RepoPathBuilder", "{", "return", "func", "(", "org", ",", "repo", "string", ")", "string", "{", "repo", "=", "strings", ".", "Replace", "(", "repo", ",", "\"/\"", ",", "\"_\"", ",", "-", "1", ")", "\n", ...
// NewExplicitRepoPathBuilder returns a builder that handles the path encoding // where a path will always have an explicit "org_repo" path segment
[ "NewExplicitRepoPathBuilder", "returns", "a", "builder", "that", "handles", "the", "path", "encoding", "where", "a", "path", "will", "always", "have", "an", "explicit", "org_repo", "path", "segment" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/gcs/target.go#L140-L146
test
kubernetes/test-infra
robots/issue-creator/creator/creator.go
RegisterSourceOrDie
func RegisterSourceOrDie(name string, src IssueSource) { if _, ok := sources[name]; ok { glog.Fatalf("Cannot register an IssueSource with name %q, already exists!", name) } sources[name] = src glog.Infof("Registered issue source '%s'.", name) }
go
func RegisterSourceOrDie(name string, src IssueSource) { if _, ok := sources[name]; ok { glog.Fatalf("Cannot register an IssueSource with name %q, already exists!", name) } sources[name] = src glog.Infof("Registered issue source '%s'.", name) }
[ "func", "RegisterSourceOrDie", "(", "name", "string", ",", "src", "IssueSource", ")", "{", "if", "_", ",", "ok", ":=", "sources", "[", "name", "]", ";", "ok", "{", "glog", ".", "Fatalf", "(", "\"Cannot register an IssueSource with name %q, already exists!\"", ",...
// RegisterSourceOrDie registers a source of auto-filed issues.
[ "RegisterSourceOrDie", "registers", "a", "source", "of", "auto", "-", "filed", "issues", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/creator/creator.go#L142-L148
test
kubernetes/test-infra
robots/issue-creator/creator/creator.go
CreateAndSync
func (c *IssueCreator) CreateAndSync() { var err error if err = c.initialize(); err != nil { glog.Fatalf("Error initializing IssueCreator: %v.", err) } glog.Info("IssueCreator initialization complete.") for srcName, src := range sources { glog.Infof("Generating issues from source: %s.", srcName) var issues ...
go
func (c *IssueCreator) CreateAndSync() { var err error if err = c.initialize(); err != nil { glog.Fatalf("Error initializing IssueCreator: %v.", err) } glog.Info("IssueCreator initialization complete.") for srcName, src := range sources { glog.Infof("Generating issues from source: %s.", srcName) var issues ...
[ "func", "(", "c", "*", "IssueCreator", ")", "CreateAndSync", "(", ")", "{", "var", "err", "error", "\n", "if", "err", "=", "c", ".", "initialize", "(", ")", ";", "err", "!=", "nil", "{", "glog", ".", "Fatalf", "(", "\"Error initializing IssueCreator: %v....
// CreateAndSync is the main workhorse function of IssueCreator. It initializes the IssueCreator, // asks each source for its issues to sync, and syncs the issues.
[ "CreateAndSync", "is", "the", "main", "workhorse", "function", "of", "IssueCreator", ".", "It", "initializes", "the", "IssueCreator", "asks", "each", "source", "for", "its", "issues", "to", "sync", "and", "syncs", "the", "issues", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/creator/creator.go#L182-L215
test
kubernetes/test-infra
robots/issue-creator/creator/creator.go
loadCache
func (c *IssueCreator) loadCache() error { user, err := c.client.GetUser("") if err != nil { return fmt.Errorf("failed to fetch the User struct for the current authenticated user. errmsg: %v", err) } if user == nil { return fmt.Errorf("received a nil User struct pointer when trying to look up the currently auth...
go
func (c *IssueCreator) loadCache() error { user, err := c.client.GetUser("") if err != nil { return fmt.Errorf("failed to fetch the User struct for the current authenticated user. errmsg: %v", err) } if user == nil { return fmt.Errorf("received a nil User struct pointer when trying to look up the currently auth...
[ "func", "(", "c", "*", "IssueCreator", ")", "loadCache", "(", ")", "error", "{", "user", ",", "err", ":=", "c", ".", "client", ".", "GetUser", "(", "\"\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"failed to ...
// loadCache loads the valid labels for the repo, the currently authenticated user, and the issue cache from github.
[ "loadCache", "loads", "the", "valid", "labels", "for", "the", "repo", "the", "currently", "authenticated", "user", "and", "the", "issue", "cache", "from", "github", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/creator/creator.go#L218-L276
test
kubernetes/test-infra
robots/issue-creator/creator/creator.go
setIntersect
func setIntersect(a, b []string) (filtered, removed []string) { for _, elemA := range a { found := false for _, elemB := range b { if elemA == elemB { found = true break } } if found { filtered = append(filtered, elemA) } else { removed = append(removed, elemA) } } return }
go
func setIntersect(a, b []string) (filtered, removed []string) { for _, elemA := range a { found := false for _, elemB := range b { if elemA == elemB { found = true break } } if found { filtered = append(filtered, elemA) } else { removed = append(removed, elemA) } } return }
[ "func", "setIntersect", "(", "a", ",", "b", "[", "]", "string", ")", "(", "filtered", ",", "removed", "[", "]", "string", ")", "{", "for", "_", ",", "elemA", ":=", "range", "a", "{", "found", ":=", "false", "\n", "for", "_", ",", "elemB", ":=", ...
// setIntersect removes any elements from the first list that are not in the second, returning the // new set and the removed elements.
[ "setIntersect", "removes", "any", "elements", "from", "the", "first", "list", "that", "are", "not", "in", "the", "second", "returning", "the", "new", "set", "and", "the", "removed", "elements", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/creator/creator.go#L296-L312
test
kubernetes/test-infra
robots/issue-creator/creator/creator.go
sync
func (c *IssueCreator) sync(issue Issue) bool { // First look for existing issues with this ID. id := issue.ID() var closedIssues []*github.Issue for _, i := range c.allIssues { if strings.Contains(*i.Body, id) { switch *i.State { case "open": //if an open issue is found with the ID then the issue is al...
go
func (c *IssueCreator) sync(issue Issue) bool { // First look for existing issues with this ID. id := issue.ID() var closedIssues []*github.Issue for _, i := range c.allIssues { if strings.Contains(*i.Body, id) { switch *i.State { case "open": //if an open issue is found with the ID then the issue is al...
[ "func", "(", "c", "*", "IssueCreator", ")", "sync", "(", "issue", "Issue", ")", "bool", "{", "id", ":=", "issue", ".", "ID", "(", ")", "\n", "var", "closedIssues", "[", "]", "*", "github", ".", "Issue", "\n", "for", "_", ",", "i", ":=", "range", ...
// sync checks to see if an issue is already on github and tries to create a new issue for it if it is not. // True is returned iff a new issue is created.
[ "sync", "checks", "to", "see", "if", "an", "issue", "is", "already", "on", "github", "and", "tries", "to", "create", "a", "new", "issue", "for", "it", "if", "it", "is", "not", ".", "True", "is", "returned", "iff", "a", "new", "issue", "is", "created"...
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/creator/creator.go#L316-L378
test
kubernetes/test-infra
boskos/common/aws/common.go
GetAWSCreds
func GetAWSCreds(r *common.Resource) (credentials.Value, error) { val := credentials.Value{} if r.Type != ResourceType { return val, fmt.Errorf("Wanted resource of type %q, got %q", ResourceType, r.Type) } accessKey, ok := r.UserData.Map.Load(UserDataAccessIDKey) if !ok { return val, errors.New("No Access Ke...
go
func GetAWSCreds(r *common.Resource) (credentials.Value, error) { val := credentials.Value{} if r.Type != ResourceType { return val, fmt.Errorf("Wanted resource of type %q, got %q", ResourceType, r.Type) } accessKey, ok := r.UserData.Map.Load(UserDataAccessIDKey) if !ok { return val, errors.New("No Access Ke...
[ "func", "GetAWSCreds", "(", "r", "*", "common", ".", "Resource", ")", "(", "credentials", ".", "Value", ",", "error", ")", "{", "val", ":=", "credentials", ".", "Value", "{", "}", "\n", "if", "r", ".", "Type", "!=", "ResourceType", "{", "return", "va...
// GetAWSCreds tries to fetch AWS credentials from a resource
[ "GetAWSCreds", "tries", "to", "fetch", "AWS", "credentials", "from", "a", "resource" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/common/aws/common.go#L39-L60
test
kubernetes/test-infra
prow/cmd/pipeline/main.go
stopper
func stopper() chan struct{} { stop := make(chan struct{}) c := make(chan os.Signal, 2) signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c logrus.Warn("Interrupt received, attempting clean shutdown...") close(stop) <-c logrus.Error("Second interrupt received, force exiting...") os.Exit(1) ...
go
func stopper() chan struct{} { stop := make(chan struct{}) c := make(chan os.Signal, 2) signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c logrus.Warn("Interrupt received, attempting clean shutdown...") close(stop) <-c logrus.Error("Second interrupt received, force exiting...") os.Exit(1) ...
[ "func", "stopper", "(", ")", "chan", "struct", "{", "}", "{", "stop", ":=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "c", ":=", "make", "(", "chan", "os", ".", "Signal", ",", "2", ")", "\n", "signal", ".", "Notify", "(", "c", ",", ...
// stopper returns a channel that remains open until an interrupt is received.
[ "stopper", "returns", "a", "channel", "that", "remains", "open", "until", "an", "interrupt", "is", "received", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/pipeline/main.go#L84-L97
test
kubernetes/test-infra
prow/cmd/pipeline/main.go
newPipelineConfig
func newPipelineConfig(cfg rest.Config, stop chan struct{}) (*pipelineConfig, error) { bc, err := pipelineset.NewForConfig(&cfg) if err != nil { return nil, err } // Ensure the pipeline CRD is deployed // TODO(fejta): probably a better way to do this if _, err := bc.TektonV1alpha1().PipelineRuns("").List(metav...
go
func newPipelineConfig(cfg rest.Config, stop chan struct{}) (*pipelineConfig, error) { bc, err := pipelineset.NewForConfig(&cfg) if err != nil { return nil, err } // Ensure the pipeline CRD is deployed // TODO(fejta): probably a better way to do this if _, err := bc.TektonV1alpha1().PipelineRuns("").List(metav...
[ "func", "newPipelineConfig", "(", "cfg", "rest", ".", "Config", ",", "stop", "chan", "struct", "{", "}", ")", "(", "*", "pipelineConfig", ",", "error", ")", "{", "bc", ",", "err", ":=", "pipelineset", ".", "NewForConfig", "(", "&", "cfg", ")", "\n", ...
// newPipelineConfig returns a client and informer capable of mutating and monitoring the specified config.
[ "newPipelineConfig", "returns", "a", "client", "and", "informer", "capable", "of", "mutating", "and", "monitoring", "the", "specified", "config", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/pipeline/main.go#L105-L125
test
kubernetes/test-infra
prow/flagutil/k8s_client.go
KubeClient
func (o *KubernetesClientOptions) KubeClient() (kubernetes.Interface, error) { return kube.GetKubernetesClient(o.masterURL, o.kubeConfig) }
go
func (o *KubernetesClientOptions) KubeClient() (kubernetes.Interface, error) { return kube.GetKubernetesClient(o.masterURL, o.kubeConfig) }
[ "func", "(", "o", "*", "KubernetesClientOptions", ")", "KubeClient", "(", ")", "(", "kubernetes", ".", "Interface", ",", "error", ")", "{", "return", "kube", ".", "GetKubernetesClient", "(", "o", ".", "masterURL", ",", "o", ".", "kubeConfig", ")", "\n", ...
// KubeClient returns a Kubernetes client.
[ "KubeClient", "returns", "a", "Kubernetes", "client", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/flagutil/k8s_client.go#L64-L66
test
kubernetes/test-infra
prow/flagutil/k8s_client.go
ProwJobClient
func (o *KubernetesClientOptions) ProwJobClient() (versioned.Interface, error) { return kube.GetProwJobClient(o.masterURL, o.kubeConfig) }
go
func (o *KubernetesClientOptions) ProwJobClient() (versioned.Interface, error) { return kube.GetProwJobClient(o.masterURL, o.kubeConfig) }
[ "func", "(", "o", "*", "KubernetesClientOptions", ")", "ProwJobClient", "(", ")", "(", "versioned", ".", "Interface", ",", "error", ")", "{", "return", "kube", ".", "GetProwJobClient", "(", "o", ".", "masterURL", ",", "o", ".", "kubeConfig", ")", "\n", "...
// ProwJobClient returns a Kubernetes client.
[ "ProwJobClient", "returns", "a", "Kubernetes", "client", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/flagutil/k8s_client.go#L69-L71
test
kubernetes/test-infra
prow/cmd/deck/job_history.go
resolveSymLink
func (bucket gcsBucket) resolveSymLink(symLink string) (string, error) { data, err := bucket.readObject(symLink) if err != nil { return "", fmt.Errorf("failed to read %s: %v", symLink, err) } // strip gs://<bucket-name> from global address `u` u := string(data) return prefixRe.ReplaceAllString(u, ""), nil }
go
func (bucket gcsBucket) resolveSymLink(symLink string) (string, error) { data, err := bucket.readObject(symLink) if err != nil { return "", fmt.Errorf("failed to read %s: %v", symLink, err) } // strip gs://<bucket-name> from global address `u` u := string(data) return prefixRe.ReplaceAllString(u, ""), nil }
[ "func", "(", "bucket", "gcsBucket", ")", "resolveSymLink", "(", "symLink", "string", ")", "(", "string", ",", "error", ")", "{", "data", ",", "err", ":=", "bucket", ".", "readObject", "(", "symLink", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// resolve sym links into the actual log directory for a particular test run
[ "resolve", "sym", "links", "into", "the", "actual", "log", "directory", "for", "a", "particular", "test", "run" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/deck/job_history.go#L119-L127
test
kubernetes/test-infra
prow/cmd/deck/job_history.go
readJSON
func readJSON(bucket storageBucket, key string, data interface{}) error { rawData, err := bucket.readObject(key) if err != nil { return fmt.Errorf("failed to read %s: %v", key, err) } err = json.Unmarshal(rawData, &data) if err != nil { return fmt.Errorf("failed to parse %s: %v", key, err) } return nil }
go
func readJSON(bucket storageBucket, key string, data interface{}) error { rawData, err := bucket.readObject(key) if err != nil { return fmt.Errorf("failed to read %s: %v", key, err) } err = json.Unmarshal(rawData, &data) if err != nil { return fmt.Errorf("failed to parse %s: %v", key, err) } return nil }
[ "func", "readJSON", "(", "bucket", "storageBucket", ",", "key", "string", ",", "data", "interface", "{", "}", ")", "error", "{", "rawData", ",", "err", ":=", "bucket", ".", "readObject", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// reads specified JSON file in to `data`
[ "reads", "specified", "JSON", "file", "in", "to", "data" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/deck/job_history.go#L150-L160
test
kubernetes/test-infra
prow/cmd/deck/job_history.go
listSubDirs
func (bucket gcsBucket) listSubDirs(prefix string) ([]string, error) { if !strings.HasSuffix(prefix, "/") { prefix += "/" } dirs := []string{} it := bucket.Objects(context.Background(), &storage.Query{ Prefix: prefix, Delimiter: "/", }) for { attrs, err := it.Next() if err == iterator.Done { break...
go
func (bucket gcsBucket) listSubDirs(prefix string) ([]string, error) { if !strings.HasSuffix(prefix, "/") { prefix += "/" } dirs := []string{} it := bucket.Objects(context.Background(), &storage.Query{ Prefix: prefix, Delimiter: "/", }) for { attrs, err := it.Next() if err == iterator.Done { break...
[ "func", "(", "bucket", "gcsBucket", ")", "listSubDirs", "(", "prefix", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "if", "!", "strings", ".", "HasSuffix", "(", "prefix", ",", "\"/\"", ")", "{", "prefix", "+=", "\"/\"", "\n", "}", ...
// Lists the GCS "directory paths" immediately under prefix.
[ "Lists", "the", "GCS", "directory", "paths", "immediately", "under", "prefix", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/deck/job_history.go#L163-L185
test
kubernetes/test-infra
prow/cmd/deck/job_history.go
listAll
func (bucket gcsBucket) listAll(prefix string) ([]string, error) { keys := []string{} it := bucket.Objects(context.Background(), &storage.Query{ Prefix: prefix, }) for { attrs, err := it.Next() if err == iterator.Done { break } if err != nil { return keys, err } keys = append(keys, attrs.Name) ...
go
func (bucket gcsBucket) listAll(prefix string) ([]string, error) { keys := []string{} it := bucket.Objects(context.Background(), &storage.Query{ Prefix: prefix, }) for { attrs, err := it.Next() if err == iterator.Done { break } if err != nil { return keys, err } keys = append(keys, attrs.Name) ...
[ "func", "(", "bucket", "gcsBucket", ")", "listAll", "(", "prefix", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "keys", ":=", "[", "]", "string", "{", "}", "\n", "it", ":=", "bucket", ".", "Objects", "(", "context", ".", "Backgro...
// Lists all GCS keys with given prefix.
[ "Lists", "all", "GCS", "keys", "with", "given", "prefix", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/deck/job_history.go#L188-L204
test
kubernetes/test-infra
prow/cmd/deck/job_history.go
listBuildIDs
func (bucket gcsBucket) listBuildIDs(root string) ([]int64, error) { ids := []int64{} if strings.HasPrefix(root, logsPrefix) { dirs, err := bucket.listSubDirs(root) if err != nil { return ids, fmt.Errorf("failed to list GCS directories: %v", err) } for _, dir := range dirs { i, err := strconv.ParseInt(p...
go
func (bucket gcsBucket) listBuildIDs(root string) ([]int64, error) { ids := []int64{} if strings.HasPrefix(root, logsPrefix) { dirs, err := bucket.listSubDirs(root) if err != nil { return ids, fmt.Errorf("failed to list GCS directories: %v", err) } for _, dir := range dirs { i, err := strconv.ParseInt(p...
[ "func", "(", "bucket", "gcsBucket", ")", "listBuildIDs", "(", "root", "string", ")", "(", "[", "]", "int64", ",", "error", ")", "{", "ids", ":=", "[", "]", "int64", "{", "}", "\n", "if", "strings", ".", "HasPrefix", "(", "root", ",", "logsPrefix", ...
// Gets all build ids for a job.
[ "Gets", "all", "build", "ids", "for", "a", "job", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/deck/job_history.go#L207-L240
test
kubernetes/test-infra
gopherage/pkg/cov/filter.go
FilterProfilePaths
func FilterProfilePaths(profile []*cover.Profile, paths []string, include bool) ([]*cover.Profile, error) { parenPaths := make([]string, len(paths)) for i, path := range paths { parenPaths[i] = "(" + path + ")" } joined := strings.Join(parenPaths, "|") re, err := regexp.Compile(joined) if err != nil { return ...
go
func FilterProfilePaths(profile []*cover.Profile, paths []string, include bool) ([]*cover.Profile, error) { parenPaths := make([]string, len(paths)) for i, path := range paths { parenPaths[i] = "(" + path + ")" } joined := strings.Join(parenPaths, "|") re, err := regexp.Compile(joined) if err != nil { return ...
[ "func", "FilterProfilePaths", "(", "profile", "[", "]", "*", "cover", ".", "Profile", ",", "paths", "[", "]", "string", ",", "include", "bool", ")", "(", "[", "]", "*", "cover", ".", "Profile", ",", "error", ")", "{", "parenPaths", ":=", "make", "(",...
// FilterProfilePaths produces a new profile that removes either everything matching or everything // not matching the provided paths, depending on the value of include. // Paths are interpreted as regular expressions. // If include is true, paths is treated as a whitelist; otherwise it is treated as a blacklist.
[ "FilterProfilePaths", "produces", "a", "new", "profile", "that", "removes", "either", "everything", "matching", "or", "everything", "not", "matching", "the", "provided", "paths", "depending", "on", "the", "value", "of", "include", ".", "Paths", "are", "interpreted...
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gopherage/pkg/cov/filter.go#L29-L46
test
kubernetes/test-infra
prow/config/secret/secret.go
LoadSecrets
func LoadSecrets(paths []string) (map[string][]byte, error) { secretsMap := make(map[string][]byte, len(paths)) for _, path := range paths { secretValue, err := LoadSingleSecret(path) if err != nil { return nil, err } secretsMap[path] = secretValue } return secretsMap, nil }
go
func LoadSecrets(paths []string) (map[string][]byte, error) { secretsMap := make(map[string][]byte, len(paths)) for _, path := range paths { secretValue, err := LoadSingleSecret(path) if err != nil { return nil, err } secretsMap[path] = secretValue } return secretsMap, nil }
[ "func", "LoadSecrets", "(", "paths", "[", "]", "string", ")", "(", "map", "[", "string", "]", "[", "]", "byte", ",", "error", ")", "{", "secretsMap", ":=", "make", "(", "map", "[", "string", "]", "[", "]", "byte", ",", "len", "(", "paths", ")", ...
// LoadSecrets loads multiple paths of secrets and add them in a map.
[ "LoadSecrets", "loads", "multiple", "paths", "of", "secrets", "and", "add", "them", "in", "a", "map", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/config/secret/secret.go#L26-L37
test
kubernetes/test-infra
prow/config/secret/secret.go
LoadSingleSecret
func LoadSingleSecret(path string) ([]byte, error) { b, err := ioutil.ReadFile(path) if err != nil { return nil, fmt.Errorf("error reading %s: %v", path, err) } return bytes.TrimSpace(b), nil }
go
func LoadSingleSecret(path string) ([]byte, error) { b, err := ioutil.ReadFile(path) if err != nil { return nil, fmt.Errorf("error reading %s: %v", path, err) } return bytes.TrimSpace(b), nil }
[ "func", "LoadSingleSecret", "(", "path", "string", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "b", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Err...
// LoadSingleSecret reads and returns the value of a single file.
[ "LoadSingleSecret", "reads", "and", "returns", "the", "value", "of", "a", "single", "file", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/config/secret/secret.go#L40-L46
test
kubernetes/test-infra
prow/flagutil/bool.go
Set
func (b *Bool) Set(s string) error { v, err := strconv.ParseBool(s) if err != nil { return err } b.Explicit = true b.Value = v return nil }
go
func (b *Bool) Set(s string) error { v, err := strconv.ParseBool(s) if err != nil { return err } b.Explicit = true b.Value = v return nil }
[ "func", "(", "b", "*", "Bool", ")", "Set", "(", "s", "string", ")", "error", "{", "v", ",", "err", ":=", "strconv", ".", "ParseBool", "(", "s", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "b", ".", "Explicit", ...
// Set the bool according to the string.
[ "Set", "the", "bool", "according", "to", "the", "string", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/flagutil/bool.go#L40-L48
test
kubernetes/test-infra
pkg/io/opener.go
NewOpener
func NewOpener(ctx context.Context, creds string) (Opener, error) { var options []option.ClientOption if creds != "" { options = append(options, option.WithCredentialsFile(creds)) } client, err := storage.NewClient(ctx, options...) if err != nil { if creds != "" { return nil, err } logrus.WithError(err)...
go
func NewOpener(ctx context.Context, creds string) (Opener, error) { var options []option.ClientOption if creds != "" { options = append(options, option.WithCredentialsFile(creds)) } client, err := storage.NewClient(ctx, options...) if err != nil { if creds != "" { return nil, err } logrus.WithError(err)...
[ "func", "NewOpener", "(", "ctx", "context", ".", "Context", ",", "creds", "string", ")", "(", "Opener", ",", "error", ")", "{", "var", "options", "[", "]", "option", ".", "ClientOption", "\n", "if", "creds", "!=", "\"\"", "{", "options", "=", "append",...
// NewOpener returns an opener that can read GCS and local paths.
[ "NewOpener", "returns", "an", "opener", "that", "can", "read", "GCS", "and", "local", "paths", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/pkg/io/opener.go#L55-L69
test
kubernetes/test-infra
pkg/io/opener.go
IsNotExist
func IsNotExist(err error) bool { return os.IsNotExist(err) || err == storage.ErrObjectNotExist }
go
func IsNotExist(err error) bool { return os.IsNotExist(err) || err == storage.ErrObjectNotExist }
[ "func", "IsNotExist", "(", "err", "error", ")", "bool", "{", "return", "os", ".", "IsNotExist", "(", "err", ")", "||", "err", "==", "storage", ".", "ErrObjectNotExist", "\n", "}" ]
// IsNotExist will return true if the error is because the object does not exist.
[ "IsNotExist", "will", "return", "true", "if", "the", "error", "is", "because", "the", "object", "does", "not", "exist", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/pkg/io/opener.go#L72-L74
test
kubernetes/test-infra
pkg/io/opener.go
LogClose
func LogClose(c io.Closer) { if err := c.Close(); err != nil { logrus.WithError(err).Error("Failed to close") } }
go
func LogClose(c io.Closer) { if err := c.Close(); err != nil { logrus.WithError(err).Error("Failed to close") } }
[ "func", "LogClose", "(", "c", "io", ".", "Closer", ")", "{", "if", "err", ":=", "c", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "logrus", ".", "WithError", "(", "err", ")", ".", "Error", "(", "\"Failed to close\"", ")", "\n", "}", "\n"...
// LogClose will attempt a close an log any error
[ "LogClose", "will", "attempt", "a", "close", "an", "log", "any", "error" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/pkg/io/opener.go#L77-L81
test
kubernetes/test-infra
pkg/io/opener.go
Writer
func (o opener) Writer(ctx context.Context, path string) (io.WriteCloser, error) { g, err := o.openGCS(path) if err != nil { return nil, fmt.Errorf("bad gcs path: %v", err) } if g == nil { return os.Create(path) } return g.NewWriter(ctx), nil }
go
func (o opener) Writer(ctx context.Context, path string) (io.WriteCloser, error) { g, err := o.openGCS(path) if err != nil { return nil, fmt.Errorf("bad gcs path: %v", err) } if g == nil { return os.Create(path) } return g.NewWriter(ctx), nil }
[ "func", "(", "o", "opener", ")", "Writer", "(", "ctx", "context", ".", "Context", ",", "path", "string", ")", "(", "io", ".", "WriteCloser", ",", "error", ")", "{", "g", ",", "err", ":=", "o", ".", "openGCS", "(", "path", ")", "\n", "if", "err", ...
// Writer returns a writer that overwrites the path.
[ "Writer", "returns", "a", "writer", "that", "overwrites", "the", "path", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/pkg/io/opener.go#L113-L122
test
kubernetes/test-infra
prow/config/githuboauth.go
InitGitHubOAuthConfig
func (gac *GitHubOAuthConfig) InitGitHubOAuthConfig(cookie *sessions.CookieStore) { gob.Register(&oauth2.Token{}) gac.CookieStore = cookie }
go
func (gac *GitHubOAuthConfig) InitGitHubOAuthConfig(cookie *sessions.CookieStore) { gob.Register(&oauth2.Token{}) gac.CookieStore = cookie }
[ "func", "(", "gac", "*", "GitHubOAuthConfig", ")", "InitGitHubOAuthConfig", "(", "cookie", "*", "sessions", ".", "CookieStore", ")", "{", "gob", ".", "Register", "(", "&", "oauth2", ".", "Token", "{", "}", ")", "\n", "gac", ".", "CookieStore", "=", "cook...
// InitGitHubOAuthConfig creates an OAuthClient using GitHubOAuth config and a Cookie Store // to retain user credentials.
[ "InitGitHubOAuthConfig", "creates", "an", "OAuthClient", "using", "GitHubOAuth", "config", "and", "a", "Cookie", "Store", "to", "retain", "user", "credentials", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/config/githuboauth.go#L45-L48
test
kubernetes/test-infra
robots/coverage/diff/view.go
deltaDisplayed
func deltaDisplayed(change *coverageChange) string { if change.baseRatio < 0 { return "" } return fmt.Sprintf("%.1f", (change.newRatio-change.baseRatio)*100) }
go
func deltaDisplayed(change *coverageChange) string { if change.baseRatio < 0 { return "" } return fmt.Sprintf("%.1f", (change.newRatio-change.baseRatio)*100) }
[ "func", "deltaDisplayed", "(", "change", "*", "coverageChange", ")", "string", "{", "if", "change", ".", "baseRatio", "<", "0", "{", "return", "\"\"", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"%.1f\"", ",", "(", "change", ".", "newRatio",...
// deltaDisplayed converts a coverage ratio delta into a string value to be displayed by coverage robot
[ "deltaDisplayed", "converts", "a", "coverage", "ratio", "delta", "into", "a", "string", "value", "to", "be", "displayed", "by", "coverage", "robot" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/coverage/diff/view.go#L36-L41
test
kubernetes/test-infra
robots/coverage/diff/view.go
makeTable
func makeTable(baseCovList, newCovList *calculation.CoverageList, coverageThreshold float32) (string, bool) { var rows []string isCoverageLow := false for _, change := range findChanges(baseCovList, newCovList) { filePath := change.name rows = append(rows, fmt.Sprintf("%s | %s | %s | %s", filePath, formatP...
go
func makeTable(baseCovList, newCovList *calculation.CoverageList, coverageThreshold float32) (string, bool) { var rows []string isCoverageLow := false for _, change := range findChanges(baseCovList, newCovList) { filePath := change.name rows = append(rows, fmt.Sprintf("%s | %s | %s | %s", filePath, formatP...
[ "func", "makeTable", "(", "baseCovList", ",", "newCovList", "*", "calculation", ".", "CoverageList", ",", "coverageThreshold", "float32", ")", "(", "string", ",", "bool", ")", "{", "var", "rows", "[", "]", "string", "\n", "isCoverageLow", ":=", "false", "\n"...
// makeTable checks each coverage change and produce the table content for coverage bot post // It also report on whether any coverage fells below the given threshold
[ "makeTable", "checks", "each", "coverage", "change", "and", "produce", "the", "table", "content", "for", "coverage", "bot", "post", "It", "also", "report", "on", "whether", "any", "coverage", "fells", "below", "the", "given", "threshold" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/coverage/diff/view.go#L45-L61
test
kubernetes/test-infra
robots/coverage/diff/view.go
ContentForGitHubPost
func ContentForGitHubPost(baseProfiles, newProfiles []*cover.Profile, jobName string, coverageThreshold float32) ( string, bool) { rows := []string{ "The following is the code coverage report", fmt.Sprintf("Say `/test %s` to re-run this coverage report", jobName), "", "File | Old Coverage | New Coverage | De...
go
func ContentForGitHubPost(baseProfiles, newProfiles []*cover.Profile, jobName string, coverageThreshold float32) ( string, bool) { rows := []string{ "The following is the code coverage report", fmt.Sprintf("Say `/test %s` to re-run this coverage report", jobName), "", "File | Old Coverage | New Coverage | De...
[ "func", "ContentForGitHubPost", "(", "baseProfiles", ",", "newProfiles", "[", "]", "*", "cover", ".", "Profile", ",", "jobName", "string", ",", "coverageThreshold", "float32", ")", "(", "string", ",", "bool", ")", "{", "rows", ":=", "[", "]", "string", "{"...
// ContentForGitHubPost constructs the message covbot posts
[ "ContentForGitHubPost", "constructs", "the", "message", "covbot", "posts" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/coverage/diff/view.go#L64-L85
test
kubernetes/test-infra
velodrome/fetcher/client.go
AddFlags
func (client *Client) AddFlags(cmd *cobra.Command) { cmd.PersistentFlags().StringVar(&client.Token, "token", "", "The OAuth Token to use for requests.") cmd.PersistentFlags().StringVar(&client.TokenFile, "token-file", "", "The file containing the OAuth Token to use for requests.") cmd.PersistentFlags().StringVar...
go
func (client *Client) AddFlags(cmd *cobra.Command) { cmd.PersistentFlags().StringVar(&client.Token, "token", "", "The OAuth Token to use for requests.") cmd.PersistentFlags().StringVar(&client.TokenFile, "token-file", "", "The file containing the OAuth Token to use for requests.") cmd.PersistentFlags().StringVar...
[ "func", "(", "client", "*", "Client", ")", "AddFlags", "(", "cmd", "*", "cobra", ".", "Command", ")", "{", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "client", ".", "Token", ",", "\"token\"", ",", "\"\"", ",", "\"The OAuth Tok...
// AddFlags parses options for github client
[ "AddFlags", "parses", "options", "for", "github", "client" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L48-L57
test
kubernetes/test-infra
velodrome/fetcher/client.go
CheckFlags
func (client *Client) CheckFlags() error { if client.Org == "" { return fmt.Errorf("organization flag must be set") } client.Org = strings.ToLower(client.Org) if client.Project == "" { return fmt.Errorf("project flag must be set") } client.Project = strings.ToLower(client.Project) return nil }
go
func (client *Client) CheckFlags() error { if client.Org == "" { return fmt.Errorf("organization flag must be set") } client.Org = strings.ToLower(client.Org) if client.Project == "" { return fmt.Errorf("project flag must be set") } client.Project = strings.ToLower(client.Project) return nil }
[ "func", "(", "client", "*", "Client", ")", "CheckFlags", "(", ")", "error", "{", "if", "client", ".", "Org", "==", "\"\"", "{", "return", "fmt", ".", "Errorf", "(", "\"organization flag must be set\"", ")", "\n", "}", "\n", "client", ".", "Org", "=", "...
// CheckFlags looks for organization and project flags to configure the client
[ "CheckFlags", "looks", "for", "organization", "and", "project", "flags", "to", "configure", "the", "client" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L60-L72
test
kubernetes/test-infra
velodrome/fetcher/client.go
getGitHubClient
func (client *Client) getGitHubClient() (*github.Client, error) { if client.githubClient != nil { return client.githubClient, nil } token := client.Token if len(token) == 0 && len(client.TokenFile) != 0 { data, err := ioutil.ReadFile(client.TokenFile) if err != nil { return nil, err } token = strings.T...
go
func (client *Client) getGitHubClient() (*github.Client, error) { if client.githubClient != nil { return client.githubClient, nil } token := client.Token if len(token) == 0 && len(client.TokenFile) != 0 { data, err := ioutil.ReadFile(client.TokenFile) if err != nil { return nil, err } token = strings.T...
[ "func", "(", "client", "*", "Client", ")", "getGitHubClient", "(", ")", "(", "*", "github", ".", "Client", ",", "error", ")", "{", "if", "client", ".", "githubClient", "!=", "nil", "{", "return", "client", ".", "githubClient", ",", "nil", "\n", "}", ...
// getGitHubClient create the github client that we use to communicate with github
[ "getGitHubClient", "create", "the", "github", "client", "that", "we", "use", "to", "communicate", "with", "github" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L75-L96
test
kubernetes/test-infra
velodrome/fetcher/client.go
limitsCheckAndWait
func (client *Client) limitsCheckAndWait() { var sleep time.Duration githubClient, err := client.getGitHubClient() if err != nil { glog.Error("Failed to get RateLimits: ", err) sleep = time.Minute } else { limits, _, err := githubClient.RateLimits(context.Background()) if err != nil { glog.Error("Failed ...
go
func (client *Client) limitsCheckAndWait() { var sleep time.Duration githubClient, err := client.getGitHubClient() if err != nil { glog.Error("Failed to get RateLimits: ", err) sleep = time.Minute } else { limits, _, err := githubClient.RateLimits(context.Background()) if err != nil { glog.Error("Failed ...
[ "func", "(", "client", "*", "Client", ")", "limitsCheckAndWait", "(", ")", "{", "var", "sleep", "time", ".", "Duration", "\n", "githubClient", ",", "err", ":=", "client", ".", "getGitHubClient", "(", ")", "\n", "if", "err", "!=", "nil", "{", "glog", "....
// limitsCheckAndWait make sure we have not reached the limit or wait
[ "limitsCheckAndWait", "make", "sure", "we", "have", "not", "reached", "the", "limit", "or", "wait" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L99-L118
test
kubernetes/test-infra
velodrome/fetcher/client.go
FetchIssues
func (client *Client) FetchIssues(latest time.Time, c chan *github.Issue) { opt := &github.IssueListByRepoOptions{Since: latest, Sort: "updated", State: "all", Direction: "asc"} githubClient, err := client.getGitHubClient() if err != nil { close(c) glog.Error(err) return } count := 0 for { client.limits...
go
func (client *Client) FetchIssues(latest time.Time, c chan *github.Issue) { opt := &github.IssueListByRepoOptions{Since: latest, Sort: "updated", State: "all", Direction: "asc"} githubClient, err := client.getGitHubClient() if err != nil { close(c) glog.Error(err) return } count := 0 for { client.limits...
[ "func", "(", "client", "*", "Client", ")", "FetchIssues", "(", "latest", "time", ".", "Time", ",", "c", "chan", "*", "github", ".", "Issue", ")", "{", "opt", ":=", "&", "github", ".", "IssueListByRepoOptions", "{", "Since", ":", "latest", ",", "Sort", ...
// FetchIssues from GitHub, until 'latest' time
[ "FetchIssues", "from", "GitHub", "until", "latest", "time" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L135-L174
test
kubernetes/test-infra
velodrome/fetcher/client.go
hasID
func hasID(events []*github.IssueEvent, id int) bool { for _, event := range events { if *event.ID == int64(id) { return true } } return false }
go
func hasID(events []*github.IssueEvent, id int) bool { for _, event := range events { if *event.ID == int64(id) { return true } } return false }
[ "func", "hasID", "(", "events", "[", "]", "*", "github", ".", "IssueEvent", ",", "id", "int", ")", "bool", "{", "for", "_", ",", "event", ":=", "range", "events", "{", "if", "*", "event", ".", "ID", "==", "int64", "(", "id", ")", "{", "return", ...
// hasID look for a specific id in a list of events
[ "hasID", "look", "for", "a", "specific", "id", "in", "a", "list", "of", "events" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L177-L184
test
kubernetes/test-infra
velodrome/fetcher/client.go
FetchIssueEvents
func (client *Client) FetchIssueEvents(issueID int, latest *int, c chan *github.IssueEvent) { opt := &github.ListOptions{PerPage: 100} githubClient, err := client.getGitHubClient() if err != nil { close(c) glog.Error(err) return } count := 0 for { client.limitsCheckAndWait() events, resp, err := gith...
go
func (client *Client) FetchIssueEvents(issueID int, latest *int, c chan *github.IssueEvent) { opt := &github.ListOptions{PerPage: 100} githubClient, err := client.getGitHubClient() if err != nil { close(c) glog.Error(err) return } count := 0 for { client.limitsCheckAndWait() events, resp, err := gith...
[ "func", "(", "client", "*", "Client", ")", "FetchIssueEvents", "(", "issueID", "int", ",", "latest", "*", "int", ",", "c", "chan", "*", "github", ".", "IssueEvent", ")", "{", "opt", ":=", "&", "github", ".", "ListOptions", "{", "PerPage", ":", "100", ...
// FetchIssueEvents from github and return the full list, until it matches 'latest' // The entire last page will be included so you can have redundancy.
[ "FetchIssueEvents", "from", "github", "and", "return", "the", "full", "list", "until", "it", "matches", "latest", "The", "entire", "last", "page", "will", "be", "included", "so", "you", "can", "have", "redundancy", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/fetcher/client.go#L188-L227
test
kubernetes/test-infra
prow/plugins/size/size.go
isPRChanged
func isPRChanged(pe github.PullRequestEvent) bool { switch pe.Action { case github.PullRequestActionOpened: return true case github.PullRequestActionReopened: return true case github.PullRequestActionSynchronize: return true case github.PullRequestActionEdited: return true default: return false } }
go
func isPRChanged(pe github.PullRequestEvent) bool { switch pe.Action { case github.PullRequestActionOpened: return true case github.PullRequestActionReopened: return true case github.PullRequestActionSynchronize: return true case github.PullRequestActionEdited: return true default: return false } }
[ "func", "isPRChanged", "(", "pe", "github", ".", "PullRequestEvent", ")", "bool", "{", "switch", "pe", ".", "Action", "{", "case", "github", ".", "PullRequestActionOpened", ":", "return", "true", "\n", "case", "github", ".", "PullRequestActionReopened", ":", "...
// These are the only actions indicating the code diffs may have changed.
[ "These", "are", "the", "only", "actions", "indicating", "the", "code", "diffs", "may", "have", "changed", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/size/size.go#L217-L230
test
kubernetes/test-infra
velodrome/transform/fetcher.go
NewFetcher
func NewFetcher(repository string) *Fetcher { return &Fetcher{ IssuesChannel: make(chan sql.Issue, 100), EventsCommentsChannel: make(chan interface{}, 100), repository: repository, } }
go
func NewFetcher(repository string) *Fetcher { return &Fetcher{ IssuesChannel: make(chan sql.Issue, 100), EventsCommentsChannel: make(chan interface{}, 100), repository: repository, } }
[ "func", "NewFetcher", "(", "repository", "string", ")", "*", "Fetcher", "{", "return", "&", "Fetcher", "{", "IssuesChannel", ":", "make", "(", "chan", "sql", ".", "Issue", ",", "100", ")", ",", "EventsCommentsChannel", ":", "make", "(", "chan", "interface"...
// NewFetcher creates a new Fetcher and initializes the output channels
[ "NewFetcher", "creates", "a", "new", "Fetcher", "and", "initializes", "the", "output", "channels" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/fetcher.go#L41-L47
test
kubernetes/test-infra
velodrome/transform/fetcher.go
fetchRecentIssues
func (f *Fetcher) fetchRecentIssues(db *gorm.DB) error { glog.Infof("Fetching issues updated after %s", f.lastIssue) var issues []sql.Issue query := db. Where("issue_updated_at >= ?", f.lastIssue). Where("repository = ?", f.repository). Order("issue_updated_at"). Preload("Labels"). Find(&issues) if query...
go
func (f *Fetcher) fetchRecentIssues(db *gorm.DB) error { glog.Infof("Fetching issues updated after %s", f.lastIssue) var issues []sql.Issue query := db. Where("issue_updated_at >= ?", f.lastIssue). Where("repository = ?", f.repository). Order("issue_updated_at"). Preload("Labels"). Find(&issues) if query...
[ "func", "(", "f", "*", "Fetcher", ")", "fetchRecentIssues", "(", "db", "*", "gorm", ".", "DB", ")", "error", "{", "glog", ".", "Infof", "(", "\"Fetching issues updated after %s\"", ",", "f", ".", "lastIssue", ")", "\n", "var", "issues", "[", "]", "sql", ...
// fetchRecentIssues retrieves issues from DB, but only fetches issues modified since last call
[ "fetchRecentIssues", "retrieves", "issues", "from", "DB", "but", "only", "fetches", "issues", "modified", "since", "last", "call" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/fetcher.go#L50-L72
test
kubernetes/test-infra
velodrome/transform/fetcher.go
fetchRecentEventsAndComments
func (f *Fetcher) fetchRecentEventsAndComments(db *gorm.DB) error { glog.Infof("Fetching issue-events with id bigger than %s", f.lastEvent) glog.Infof("Fetching comments with id bigger than %s", f.lastComment) eventRows, err := db. Model(sql.IssueEvent{}). Where("repository = ?", f.repository). Where("event_c...
go
func (f *Fetcher) fetchRecentEventsAndComments(db *gorm.DB) error { glog.Infof("Fetching issue-events with id bigger than %s", f.lastEvent) glog.Infof("Fetching comments with id bigger than %s", f.lastComment) eventRows, err := db. Model(sql.IssueEvent{}). Where("repository = ?", f.repository). Where("event_c...
[ "func", "(", "f", "*", "Fetcher", ")", "fetchRecentEventsAndComments", "(", "db", "*", "gorm", ".", "DB", ")", "error", "{", "glog", ".", "Infof", "(", "\"Fetching issue-events with id bigger than %s\"", ",", "f", ".", "lastEvent", ")", "\n", "glog", ".", "I...
// fetchRecentEventsAndComments retrieves events from DB, but only fetches events created since last call
[ "fetchRecentEventsAndComments", "retrieves", "events", "from", "DB", "but", "only", "fetches", "events", "created", "since", "last", "call" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/fetcher.go#L75-L137
test
kubernetes/test-infra
velodrome/transform/fetcher.go
Fetch
func (f *Fetcher) Fetch(db *gorm.DB) error { if err := f.fetchRecentIssues(db); err != nil { return err } if err := f.fetchRecentEventsAndComments(db); err != nil { return err } return nil }
go
func (f *Fetcher) Fetch(db *gorm.DB) error { if err := f.fetchRecentIssues(db); err != nil { return err } if err := f.fetchRecentEventsAndComments(db); err != nil { return err } return nil }
[ "func", "(", "f", "*", "Fetcher", ")", "Fetch", "(", "db", "*", "gorm", ".", "DB", ")", "error", "{", "if", "err", ":=", "f", ".", "fetchRecentIssues", "(", "db", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "err",...
// Fetch retrieves all types of events, and push them to output channels
[ "Fetch", "retrieves", "all", "types", "of", "events", "and", "push", "them", "to", "output", "channels" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/fetcher.go#L140-L148
test
kubernetes/test-infra
robots/issue-creator/sources/flakyjob-reporter.go
Issues
func (fjr *FlakyJobReporter) Issues(c *creator.IssueCreator) ([]creator.Issue, error) { fjr.creator = c json, err := ReadHTTP(fjr.flakyJobDataURL) if err != nil { return nil, err } flakyJobs, err := fjr.parseFlakyJobs(json) if err != nil { return nil, err } count := fjr.syncCount if len(flakyJobs) < coun...
go
func (fjr *FlakyJobReporter) Issues(c *creator.IssueCreator) ([]creator.Issue, error) { fjr.creator = c json, err := ReadHTTP(fjr.flakyJobDataURL) if err != nil { return nil, err } flakyJobs, err := fjr.parseFlakyJobs(json) if err != nil { return nil, err } count := fjr.syncCount if len(flakyJobs) < coun...
[ "func", "(", "fjr", "*", "FlakyJobReporter", ")", "Issues", "(", "c", "*", "creator", ".", "IssueCreator", ")", "(", "[", "]", "creator", ".", "Issue", ",", "error", ")", "{", "fjr", ".", "creator", "=", "c", "\n", "json", ",", "err", ":=", "ReadHT...
// 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.
[ "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", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/sources/flakyjob-reporter.go#L76-L98
test
kubernetes/test-infra
robots/issue-creator/sources/flakyjob-reporter.go
Title
func (fj *FlakyJob) Title() string { return fmt.Sprintf("%s flaked %d times in the past week", fj.Name, *fj.FlakeCount) }
go
func (fj *FlakyJob) Title() string { return fmt.Sprintf("%s flaked %d times in the past week", fj.Name, *fj.FlakeCount) }
[ "func", "(", "fj", "*", "FlakyJob", ")", "Title", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"%s flaked %d times in the past week\"", ",", "fj", ".", "Name", ",", "*", "fj", ".", "FlakeCount", ")", "\n", "}" ]
// Title yields the initial title text of the github issue.
[ "Title", "yields", "the", "initial", "title", "text", "of", "the", "github", "issue", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/sources/flakyjob-reporter.go#L165-L167
test
kubernetes/test-infra
robots/issue-creator/sources/flakyjob-reporter.go
Labels
func (fj *FlakyJob) Labels() []string { labels := []string{"kind/flake"} // get sig labels for sig := range fj.reporter.creator.TestsSIGs(fj.TestsSorted()) { labels = append(labels, "sig/"+sig) } return labels }
go
func (fj *FlakyJob) Labels() []string { labels := []string{"kind/flake"} // get sig labels for sig := range fj.reporter.creator.TestsSIGs(fj.TestsSorted()) { labels = append(labels, "sig/"+sig) } return labels }
[ "func", "(", "fj", "*", "FlakyJob", ")", "Labels", "(", ")", "[", "]", "string", "{", "labels", ":=", "[", "]", "string", "{", "\"kind/flake\"", "}", "\n", "for", "sig", ":=", "range", "fj", ".", "reporter", ".", "creator", ".", "TestsSIGs", "(", "...
// Labels returns the labels to apply to the issue created for this flaky job on github.
[ "Labels", "returns", "the", "labels", "to", "apply", "to", "the", "issue", "created", "for", "this", "flaky", "job", "on", "github", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/sources/flakyjob-reporter.go#L231-L238
test
kubernetes/test-infra
robots/issue-creator/sources/flakyjob-reporter.go
ReadHTTP
func ReadHTTP(url string) ([]byte, error) { var err error retryDelay := time.Duration(2) * time.Second for retryCount := 0; retryCount < 5; retryCount++ { if retryCount > 0 { time.Sleep(retryDelay) retryDelay *= time.Duration(2) } resp, err := http.Get(url) if resp != nil && resp.StatusCode >= 500 { ...
go
func ReadHTTP(url string) ([]byte, error) { var err error retryDelay := time.Duration(2) * time.Second for retryCount := 0; retryCount < 5; retryCount++ { if retryCount > 0 { time.Sleep(retryDelay) retryDelay *= time.Duration(2) } resp, err := http.Get(url) if resp != nil && resp.StatusCode >= 500 { ...
[ "func", "ReadHTTP", "(", "url", "string", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "err", "error", "\n", "retryDelay", ":=", "time", ".", "Duration", "(", "2", ")", "*", "time", ".", "Second", "\n", "for", "retryCount", ":=", "0",...
// ReadHTTP fetches file contents from a URL with retries.
[ "ReadHTTP", "fetches", "file", "contents", "from", "a", "URL", "with", "retries", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/robots/issue-creator/sources/flakyjob-reporter.go#L256-L282
test
kubernetes/test-infra
experiment/tracer/trace.go
String
func (l linesByTimestamp) String() string { sort.Sort(l) var log string for i, line := range l { switch i { case len(l) - 1: log += string(line.actual) default: // buf.ReadBytes('\n') does not remove the newline log += fmt.Sprintf("%s,\n", strings.TrimSuffix(string(line.actual), "\n")) } } retur...
go
func (l linesByTimestamp) String() string { sort.Sort(l) var log string for i, line := range l { switch i { case len(l) - 1: log += string(line.actual) default: // buf.ReadBytes('\n') does not remove the newline log += fmt.Sprintf("%s,\n", strings.TrimSuffix(string(line.actual), "\n")) } } retur...
[ "func", "(", "l", "linesByTimestamp", ")", "String", "(", ")", "string", "{", "sort", ".", "Sort", "(", "l", ")", "\n", "var", "log", "string", "\n", "for", "i", ",", "line", ":=", "range", "l", "{", "switch", "i", "{", "case", "len", "(", "l", ...
// Return valid json.
[ "Return", "valid", "json", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/experiment/tracer/trace.go#L71-L86
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
NewJobSpec
func NewJobSpec(spec prowapi.ProwJobSpec, buildID, prowJobID string) JobSpec { return JobSpec{ Type: spec.Type, Job: spec.Job, BuildID: buildID, ProwJobID: prowJobID, Refs: spec.Refs, ExtraRefs: spec.ExtraRefs, agent: spec.Agent, } }
go
func NewJobSpec(spec prowapi.ProwJobSpec, buildID, prowJobID string) JobSpec { return JobSpec{ Type: spec.Type, Job: spec.Job, BuildID: buildID, ProwJobID: prowJobID, Refs: spec.Refs, ExtraRefs: spec.ExtraRefs, agent: spec.Agent, } }
[ "func", "NewJobSpec", "(", "spec", "prowapi", ".", "ProwJobSpec", ",", "buildID", ",", "prowJobID", "string", ")", "JobSpec", "{", "return", "JobSpec", "{", "Type", ":", "spec", ".", "Type", ",", "Job", ":", "spec", ".", "Job", ",", "BuildID", ":", "bu...
// NewJobSpec converts a prowapi.ProwJobSpec invocation into a JobSpec
[ "NewJobSpec", "converts", "a", "prowapi", ".", "ProwJobSpec", "invocation", "into", "a", "JobSpec" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L50-L60
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
ResolveSpecFromEnv
func ResolveSpecFromEnv() (*JobSpec, error) { specEnv, ok := os.LookupEnv(JobSpecEnv) if !ok { return nil, fmt.Errorf("$%s unset", JobSpecEnv) } spec := &JobSpec{} if err := json.Unmarshal([]byte(specEnv), spec); err != nil { return nil, fmt.Errorf("malformed $%s: %v", JobSpecEnv, err) } return spec, nil }
go
func ResolveSpecFromEnv() (*JobSpec, error) { specEnv, ok := os.LookupEnv(JobSpecEnv) if !ok { return nil, fmt.Errorf("$%s unset", JobSpecEnv) } spec := &JobSpec{} if err := json.Unmarshal([]byte(specEnv), spec); err != nil { return nil, fmt.Errorf("malformed $%s: %v", JobSpecEnv, err) } return spec, nil }
[ "func", "ResolveSpecFromEnv", "(", ")", "(", "*", "JobSpec", ",", "error", ")", "{", "specEnv", ",", "ok", ":=", "os", ".", "LookupEnv", "(", "JobSpecEnv", ")", "\n", "if", "!", "ok", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"$%s unset...
// ResolveSpecFromEnv will determine the Refs being // tested in by parsing Prow environment variable contents
[ "ResolveSpecFromEnv", "will", "determine", "the", "Refs", "being", "tested", "in", "by", "parsing", "Prow", "environment", "variable", "contents" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L64-L76
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
EnvForSpec
func EnvForSpec(spec JobSpec) (map[string]string, error) { env := map[string]string{ jobNameEnv: spec.Job, buildIDEnv: spec.BuildID, prowJobIDEnv: spec.ProwJobID, jobTypeEnv: string(spec.Type), } // for backwards compatibility, we provide the build ID // in both $BUILD_ID and $BUILD_NUMBER for Prow a...
go
func EnvForSpec(spec JobSpec) (map[string]string, error) { env := map[string]string{ jobNameEnv: spec.Job, buildIDEnv: spec.BuildID, prowJobIDEnv: spec.ProwJobID, jobTypeEnv: string(spec.Type), } // for backwards compatibility, we provide the build ID // in both $BUILD_ID and $BUILD_NUMBER for Prow a...
[ "func", "EnvForSpec", "(", "spec", "JobSpec", ")", "(", "map", "[", "string", "]", "string", ",", "error", ")", "{", "env", ":=", "map", "[", "string", "]", "string", "{", "jobNameEnv", ":", "spec", ".", "Job", ",", "buildIDEnv", ":", "spec", ".", ...
// EnvForSpec returns a mapping of environment variables // to their values that should be available for a job spec
[ "EnvForSpec", "returns", "a", "mapping", "of", "environment", "variables", "to", "their", "values", "that", "should", "be", "available", "for", "a", "job", "spec" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L100-L138
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
EnvForType
func EnvForType(jobType prowapi.ProwJobType) []string { baseEnv := []string{jobNameEnv, JobSpecEnv, jobTypeEnv, prowJobIDEnv, buildIDEnv, prowBuildIDEnv} refsEnv := []string{repoOwnerEnv, repoNameEnv, pullBaseRefEnv, pullBaseShaEnv, pullRefsEnv} pullEnv := []string{pullNumberEnv, pullPullShaEnv} switch jobType { ...
go
func EnvForType(jobType prowapi.ProwJobType) []string { baseEnv := []string{jobNameEnv, JobSpecEnv, jobTypeEnv, prowJobIDEnv, buildIDEnv, prowBuildIDEnv} refsEnv := []string{repoOwnerEnv, repoNameEnv, pullBaseRefEnv, pullBaseShaEnv, pullRefsEnv} pullEnv := []string{pullNumberEnv, pullPullShaEnv} switch jobType { ...
[ "func", "EnvForType", "(", "jobType", "prowapi", ".", "ProwJobType", ")", "[", "]", "string", "{", "baseEnv", ":=", "[", "]", "string", "{", "jobNameEnv", ",", "JobSpecEnv", ",", "jobTypeEnv", ",", "prowJobIDEnv", ",", "buildIDEnv", ",", "prowBuildIDEnv", "}...
// EnvForType returns the slice of environment variables to export for jobType
[ "EnvForType", "returns", "the", "slice", "of", "environment", "variables", "to", "export", "for", "jobType" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L141-L156
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
getRevisionFromRef
func getRevisionFromRef(refs *prowapi.Refs) string { if len(refs.Pulls) > 0 { return refs.Pulls[0].SHA } if refs.BaseSHA != "" { return refs.BaseSHA } return refs.BaseRef }
go
func getRevisionFromRef(refs *prowapi.Refs) string { if len(refs.Pulls) > 0 { return refs.Pulls[0].SHA } if refs.BaseSHA != "" { return refs.BaseSHA } return refs.BaseRef }
[ "func", "getRevisionFromRef", "(", "refs", "*", "prowapi", ".", "Refs", ")", "string", "{", "if", "len", "(", "refs", ".", "Pulls", ")", ">", "0", "{", "return", "refs", ".", "Pulls", "[", "0", "]", ".", "SHA", "\n", "}", "\n", "if", "refs", ".",...
// getRevisionFromRef returns a ref or sha from a refs object
[ "getRevisionFromRef", "returns", "a", "ref", "or", "sha", "from", "a", "refs", "object" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L159-L169
test
kubernetes/test-infra
prow/pod-utils/downwardapi/jobspec.go
GetRevisionFromSpec
func GetRevisionFromSpec(spec *JobSpec) string { if spec.Refs != nil { return getRevisionFromRef(spec.Refs) } else if len(spec.ExtraRefs) > 0 { return getRevisionFromRef(&spec.ExtraRefs[0]) } return "" }
go
func GetRevisionFromSpec(spec *JobSpec) string { if spec.Refs != nil { return getRevisionFromRef(spec.Refs) } else if len(spec.ExtraRefs) > 0 { return getRevisionFromRef(&spec.ExtraRefs[0]) } return "" }
[ "func", "GetRevisionFromSpec", "(", "spec", "*", "JobSpec", ")", "string", "{", "if", "spec", ".", "Refs", "!=", "nil", "{", "return", "getRevisionFromRef", "(", "spec", ".", "Refs", ")", "\n", "}", "else", "if", "len", "(", "spec", ".", "ExtraRefs", "...
// GetRevisionFromSpec returns a main ref or sha from a spec object
[ "GetRevisionFromSpec", "returns", "a", "main", "ref", "or", "sha", "from", "a", "spec", "object" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/pod-utils/downwardapi/jobspec.go#L172-L179
test
kubernetes/test-infra
prow/plugins/mergecommitblocker/mergecommitblocker.go
helpProvider
func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) { // Only the Description field is specified because this plugin is not triggered with commands and is not configurable. return &pluginhelp.PluginHelp{ Description: fmt.Sprintf("The merge commit blocker plugin ad...
go
func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) { // Only the Description field is specified because this plugin is not triggered with commands and is not configurable. return &pluginhelp.PluginHelp{ Description: fmt.Sprintf("The merge commit blocker plugin ad...
[ "func", "helpProvider", "(", "config", "*", "plugins", ".", "Configuration", ",", "enabledRepos", "[", "]", "string", ")", "(", "*", "pluginhelp", ".", "PluginHelp", ",", "error", ")", "{", "return", "&", "pluginhelp", ".", "PluginHelp", "{", "Description", ...
// helpProvider provides information on the plugin
[ "helpProvider", "provides", "information", "on", "the", "plugin" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/plugins/mergecommitblocker/mergecommitblocker.go#L48-L53
test
kubernetes/test-infra
prow/genfiles/genfiles.go
load
func (g *Group) load(r io.Reader) ([]string, error) { var repoPaths []string s := bufio.NewScanner(r) for s.Scan() { l := strings.TrimSpace(s.Text()) if l == "" || l[0] == '#' { // Ignore comments and empty lines. continue } fs := strings.Fields(l) if len(fs) != 2 { return repoPaths, &ParseError{...
go
func (g *Group) load(r io.Reader) ([]string, error) { var repoPaths []string s := bufio.NewScanner(r) for s.Scan() { l := strings.TrimSpace(s.Text()) if l == "" || l[0] == '#' { // Ignore comments and empty lines. continue } fs := strings.Fields(l) if len(fs) != 2 { return repoPaths, &ParseError{...
[ "func", "(", "g", "*", "Group", ")", "load", "(", "r", "io", ".", "Reader", ")", "(", "[", "]", "string", ",", "error", ")", "{", "var", "repoPaths", "[", "]", "string", "\n", "s", ":=", "bufio", ".", "NewScanner", "(", "r", ")", "\n", "for", ...
// Use load to read a generated files config file, and populate g with the commands. // "paths-from-repo" commands are aggregated into repoPaths. It is the caller's // responsibility to fetch these and load them via g.loadPaths.
[ "Use", "load", "to", "read", "a", "generated", "files", "config", "file", "and", "populate", "g", "with", "the", "commands", ".", "paths", "-", "from", "-", "repo", "commands", "are", "aggregated", "into", "repoPaths", ".", "It", "is", "the", "caller", "...
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/genfiles/genfiles.go#L109-L148
test
kubernetes/test-infra
prow/genfiles/genfiles.go
loadPaths
func (g *Group) loadPaths(r io.Reader) error { s := bufio.NewScanner(r) for s.Scan() { l := strings.TrimSpace(s.Text()) if l == "" || l[0] == '#' { // Ignore comments and empty lines. continue } g.Paths[l] = true } if err := s.Err(); err != nil { return fmt.Errorf("scan error: %v", err) } retu...
go
func (g *Group) loadPaths(r io.Reader) error { s := bufio.NewScanner(r) for s.Scan() { l := strings.TrimSpace(s.Text()) if l == "" || l[0] == '#' { // Ignore comments and empty lines. continue } g.Paths[l] = true } if err := s.Err(); err != nil { return fmt.Errorf("scan error: %v", err) } retu...
[ "func", "(", "g", "*", "Group", ")", "loadPaths", "(", "r", "io", ".", "Reader", ")", "error", "{", "s", ":=", "bufio", ".", "NewScanner", "(", "r", ")", "\n", "for", "s", ".", "Scan", "(", ")", "{", "l", ":=", "strings", ".", "TrimSpace", "(",...
// Use loadPaths to load a file of new-line delimited paths, such as // resolving file data referenced in a "paths-from-repo" command.
[ "Use", "loadPaths", "to", "load", "a", "file", "of", "new", "-", "line", "delimited", "paths", "such", "as", "resolving", "file", "data", "referenced", "in", "a", "paths", "-", "from", "-", "repo", "command", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/genfiles/genfiles.go#L152-L170
test
kubernetes/test-infra
prow/genfiles/genfiles.go
Match
func (g *Group) Match(path string) bool { if g.Paths[path] { return true } for prefix := range g.PathPrefixes { if strings.HasPrefix(path, prefix) { return true } } base := filepath.Base(path) if g.FileNames[base] { return true } for prefix := range g.FilePrefixes { if strings.HasPrefix(base, p...
go
func (g *Group) Match(path string) bool { if g.Paths[path] { return true } for prefix := range g.PathPrefixes { if strings.HasPrefix(path, prefix) { return true } } base := filepath.Base(path) if g.FileNames[base] { return true } for prefix := range g.FilePrefixes { if strings.HasPrefix(base, p...
[ "func", "(", "g", "*", "Group", ")", "Match", "(", "path", "string", ")", "bool", "{", "if", "g", ".", "Paths", "[", "path", "]", "{", "return", "true", "\n", "}", "\n", "for", "prefix", ":=", "range", "g", ".", "PathPrefixes", "{", "if", "string...
// Match determines whether a file, given here by its full path // is included in the generated files group.
[ "Match", "determines", "whether", "a", "file", "given", "here", "by", "its", "full", "path", "is", "included", "in", "the", "generated", "files", "group", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/genfiles/genfiles.go#L174-L198
test
kubernetes/test-infra
velodrome/transform/influx.go
CreateDatabase
func (config *InfluxConfig) CreateDatabase(tags map[string]string, measurement string) (*InfluxDB, error) { client, err := influxdb.NewHTTPClient(influxdb.HTTPConfig{ Addr: config.Host, Username: config.User, Password: config.Password, }) if err != nil { return nil, err } err = dropSeries(client, meas...
go
func (config *InfluxConfig) CreateDatabase(tags map[string]string, measurement string) (*InfluxDB, error) { client, err := influxdb.NewHTTPClient(influxdb.HTTPConfig{ Addr: config.Host, Username: config.User, Password: config.Password, }) if err != nil { return nil, err } err = dropSeries(client, meas...
[ "func", "(", "config", "*", "InfluxConfig", ")", "CreateDatabase", "(", "tags", "map", "[", "string", "]", "string", ",", "measurement", "string", ")", "(", "*", "InfluxDB", ",", "error", ")", "{", "client", ",", "err", ":=", "influxdb", ".", "NewHTTPCli...
// CreateDatabase creates and connects a new instance of an InfluxDB // It is created based on the fields set in the configuration.
[ "CreateDatabase", "creates", "and", "connects", "a", "new", "instance", "of", "an", "InfluxDB", "It", "is", "created", "based", "on", "the", "fields", "set", "in", "the", "configuration", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/influx.go#L58-L88
test
kubernetes/test-infra
velodrome/transform/influx.go
mergeTags
func mergeTags(defaultTags, extraTags map[string]string) map[string]string { newTags := map[string]string{} for k, v := range defaultTags { newTags[k] = v } for k, v := range extraTags { newTags[k] = v } return newTags }
go
func mergeTags(defaultTags, extraTags map[string]string) map[string]string { newTags := map[string]string{} for k, v := range defaultTags { newTags[k] = v } for k, v := range extraTags { newTags[k] = v } return newTags }
[ "func", "mergeTags", "(", "defaultTags", ",", "extraTags", "map", "[", "string", "]", "string", ")", "map", "[", "string", "]", "string", "{", "newTags", ":=", "map", "[", "string", "]", "string", "{", "}", "\n", "for", "k", ",", "v", ":=", "range", ...
// mergeTags merges the default tags with the exta tags. Default will be overridden if it conflicts.
[ "mergeTags", "merges", "the", "default", "tags", "with", "the", "exta", "tags", ".", "Default", "will", "be", "overridden", "if", "it", "conflicts", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/influx.go#L101-L112
test
kubernetes/test-infra
velodrome/transform/influx.go
tagsToWhere
func tagsToWhere(tags map[string]string) string { if len(tags) == 0 { return "" } sortedKeys := []string{} for k := range tags { sortedKeys = append(sortedKeys, k) } sort.Strings(sortedKeys) conditions := []string{} for _, key := range sortedKeys { conditions = append(conditions, fmt.Sprintf(`"%s" = '%v...
go
func tagsToWhere(tags map[string]string) string { if len(tags) == 0 { return "" } sortedKeys := []string{} for k := range tags { sortedKeys = append(sortedKeys, k) } sort.Strings(sortedKeys) conditions := []string{} for _, key := range sortedKeys { conditions = append(conditions, fmt.Sprintf(`"%s" = '%v...
[ "func", "tagsToWhere", "(", "tags", "map", "[", "string", "]", "string", ")", "string", "{", "if", "len", "(", "tags", ")", "==", "0", "{", "return", "\"\"", "\n", "}", "\n", "sortedKeys", ":=", "[", "]", "string", "{", "}", "\n", "for", "k", ":=...
// tagsToWhere creates a where query to match tags element
[ "tagsToWhere", "creates", "a", "where", "query", "to", "match", "tags", "element" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/influx.go#L115-L131
test
kubernetes/test-infra
velodrome/transform/influx.go
Push
func (i *InfluxDB) Push(tags map[string]string, fields map[string]interface{}, date time.Time) error { pt, err := influxdb.NewPoint(i.measurement, mergeTags(i.tags, tags), fields, date) if err != nil { return err } i.batch.AddPoint(pt) i.batchSize++ return nil }
go
func (i *InfluxDB) Push(tags map[string]string, fields map[string]interface{}, date time.Time) error { pt, err := influxdb.NewPoint(i.measurement, mergeTags(i.tags, tags), fields, date) if err != nil { return err } i.batch.AddPoint(pt) i.batchSize++ return nil }
[ "func", "(", "i", "*", "InfluxDB", ")", "Push", "(", "tags", "map", "[", "string", "]", "string", ",", "fields", "map", "[", "string", "]", "interface", "{", "}", ",", "date", "time", ".", "Time", ")", "error", "{", "pt", ",", "err", ":=", "influ...
// Push a point to the database. This appends to current batchpoint
[ "Push", "a", "point", "to", "the", "database", ".", "This", "appends", "to", "current", "batchpoint" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/influx.go#L134-L144
test
kubernetes/test-infra
prow/spyglass/podlogartifact_fetcher.go
artifact
func (af *PodLogArtifactFetcher) artifact(jobName, buildID string, sizeLimit int64) (lenses.Artifact, error) { podLog, err := NewPodLogArtifact(jobName, buildID, sizeLimit, af.jobAgent) if err != nil { return nil, fmt.Errorf("Error accessing pod log from given source: %v", err) } return podLog, nil }
go
func (af *PodLogArtifactFetcher) artifact(jobName, buildID string, sizeLimit int64) (lenses.Artifact, error) { podLog, err := NewPodLogArtifact(jobName, buildID, sizeLimit, af.jobAgent) if err != nil { return nil, fmt.Errorf("Error accessing pod log from given source: %v", err) } return podLog, nil }
[ "func", "(", "af", "*", "PodLogArtifactFetcher", ")", "artifact", "(", "jobName", ",", "buildID", "string", ",", "sizeLimit", "int64", ")", "(", "lenses", ".", "Artifact", ",", "error", ")", "{", "podLog", ",", "err", ":=", "NewPodLogArtifact", "(", "jobNa...
// artifact constructs an artifact handle for the given job build
[ "artifact", "constructs", "an", "artifact", "handle", "for", "the", "given", "job", "build" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/spyglass/podlogartifact_fetcher.go#L36-L43
test
kubernetes/test-infra
prow/cmd/plank/main.go
serve
func serve() { http.Handle("/metrics", promhttp.Handler()) logrus.WithError(http.ListenAndServe(":8080", nil)).Fatal("ListenAndServe returned.") }
go
func serve() { http.Handle("/metrics", promhttp.Handler()) logrus.WithError(http.ListenAndServe(":8080", nil)).Fatal("ListenAndServe returned.") }
[ "func", "serve", "(", ")", "{", "http", ".", "Handle", "(", "\"/metrics\"", ",", "promhttp", ".", "Handler", "(", ")", ")", "\n", "logrus", ".", "WithError", "(", "http", ".", "ListenAndServe", "(", "\":8080\"", ",", "nil", ")", ")", ".", "Fatal", "(...
// serve starts a http server and serves prometheus metrics. // Meant to be called inside a goroutine.
[ "serve", "starts", "a", "http", "server", "and", "serves", "prometheus", "metrics", ".", "Meant", "to", "be", "called", "inside", "a", "goroutine", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/plank/main.go#L180-L183
test
kubernetes/test-infra
prow/cmd/plank/main.go
gather
func gather(c *plank.Controller) { tick := time.Tick(30 * time.Second) sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, syscall.SIGTERM) for { select { case <-tick: start := time.Now() c.SyncMetrics() logrus.WithField("metrics-duration", fmt.Sprintf("%v", time.Since(start))).Debug("Metr...
go
func gather(c *plank.Controller) { tick := time.Tick(30 * time.Second) sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, syscall.SIGTERM) for { select { case <-tick: start := time.Now() c.SyncMetrics() logrus.WithField("metrics-duration", fmt.Sprintf("%v", time.Since(start))).Debug("Metr...
[ "func", "gather", "(", "c", "*", "plank", ".", "Controller", ")", "{", "tick", ":=", "time", ".", "Tick", "(", "30", "*", "time", ".", "Second", ")", "\n", "sig", ":=", "make", "(", "chan", "os", ".", "Signal", ",", "1", ")", "\n", "signal", "....
// gather metrics from plank. // Meant to be called inside a goroutine.
[ "gather", "metrics", "from", "plank", ".", "Meant", "to", "be", "called", "inside", "a", "goroutine", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/plank/main.go#L187-L203
test
kubernetes/test-infra
prow/cmd/branchprotector/request.go
makeRequest
func makeRequest(policy branchprotection.Policy) github.BranchProtectionRequest { return github.BranchProtectionRequest{ EnforceAdmins: makeAdmins(policy.Admins), RequiredPullRequestReviews: makeReviews(policy.RequiredPullRequestReviews), RequiredStatusChecks: makeChecks(policy.RequiredStatusC...
go
func makeRequest(policy branchprotection.Policy) github.BranchProtectionRequest { return github.BranchProtectionRequest{ EnforceAdmins: makeAdmins(policy.Admins), RequiredPullRequestReviews: makeReviews(policy.RequiredPullRequestReviews), RequiredStatusChecks: makeChecks(policy.RequiredStatusC...
[ "func", "makeRequest", "(", "policy", "branchprotection", ".", "Policy", ")", "github", ".", "BranchProtectionRequest", "{", "return", "github", ".", "BranchProtectionRequest", "{", "EnforceAdmins", ":", "makeAdmins", "(", "policy", ".", "Admins", ")", ",", "Requi...
// makeRequest renders a branch protection policy into the corresponding GitHub api request.
[ "makeRequest", "renders", "a", "branch", "protection", "policy", "into", "the", "corresponding", "GitHub", "api", "request", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/branchprotector/request.go#L28-L36
test
kubernetes/test-infra
prow/cmd/branchprotector/request.go
makeReviews
func makeReviews(rp *branchprotection.ReviewPolicy) *github.RequiredPullRequestReviews { switch { case rp == nil: return nil case rp.Approvals == nil: logrus.Warn("WARNING: required_pull_request_reviews policy does not specify required_approving_review_count, disabling") return nil case *rp.Approvals == 0: ...
go
func makeReviews(rp *branchprotection.ReviewPolicy) *github.RequiredPullRequestReviews { switch { case rp == nil: return nil case rp.Approvals == nil: logrus.Warn("WARNING: required_pull_request_reviews policy does not specify required_approving_review_count, disabling") return nil case *rp.Approvals == 0: ...
[ "func", "makeReviews", "(", "rp", "*", "branchprotection", ".", "ReviewPolicy", ")", "*", "github", ".", "RequiredPullRequestReviews", "{", "switch", "{", "case", "rp", "==", "nil", ":", "return", "nil", "\n", "case", "rp", ".", "Approvals", "==", "nil", "...
// makeReviews renders review policy into the corresponding GitHub api object. // // Returns nil if the policy is nil, or approvals is nil or 0.
[ "makeReviews", "renders", "review", "policy", "into", "the", "corresponding", "GitHub", "api", "object", ".", "Returns", "nil", "if", "the", "policy", "is", "nil", "or", "approvals", "is", "nil", "or", "0", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/branchprotector/request.go#L84-L103
test
kubernetes/test-infra
prow/spyglass/lenses/buildlog/lens.go
Header
func (lens Lens) Header(artifacts []lenses.Artifact, resourceDir string) string { return executeTemplate(resourceDir, "header", BuildLogsView{}) }
go
func (lens Lens) Header(artifacts []lenses.Artifact, resourceDir string) string { return executeTemplate(resourceDir, "header", BuildLogsView{}) }
[ "func", "(", "lens", "Lens", ")", "Header", "(", "artifacts", "[", "]", "lenses", ".", "Artifact", ",", "resourceDir", "string", ")", "string", "{", "return", "executeTemplate", "(", "resourceDir", ",", "\"header\"", ",", "BuildLogsView", "{", "}", ")", "\...
// Header executes the "header" section of the template.
[ "Header", "executes", "the", "header", "section", "of", "the", "template", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/spyglass/lenses/buildlog/lens.go#L56-L58
test
kubernetes/test-infra
prow/spyglass/lenses/buildlog/lens.go
Callback
func (lens Lens) Callback(artifacts []lenses.Artifact, resourceDir string, data string) string { var request LineRequest err := json.Unmarshal([]byte(data), &request) if err != nil { return "failed to unmarshal request" } artifact, ok := artifactByName(artifacts, request.Artifact) if !ok { return "no artifact...
go
func (lens Lens) Callback(artifacts []lenses.Artifact, resourceDir string, data string) string { var request LineRequest err := json.Unmarshal([]byte(data), &request) if err != nil { return "failed to unmarshal request" } artifact, ok := artifactByName(artifacts, request.Artifact) if !ok { return "no artifact...
[ "func", "(", "lens", "Lens", ")", "Callback", "(", "artifacts", "[", "]", "lenses", ".", "Artifact", ",", "resourceDir", "string", ",", "data", "string", ")", "string", "{", "var", "request", "LineRequest", "\n", "err", ":=", "json", ".", "Unmarshal", "(...
// Callback is used to retrieve new log segments
[ "Callback", "is", "used", "to", "retrieve", "new", "log", "segments" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/spyglass/lenses/buildlog/lens.go#L147-L170
test
kubernetes/test-infra
prow/spyglass/lenses/buildlog/lens.go
logLinesAll
func logLinesAll(artifact lenses.Artifact) ([]string, error) { read, err := artifact.ReadAll() if err != nil { return nil, fmt.Errorf("failed to read log %q: %v", artifact.JobPath(), err) } logLines := strings.Split(string(read), "\n") return logLines, nil }
go
func logLinesAll(artifact lenses.Artifact) ([]string, error) { read, err := artifact.ReadAll() if err != nil { return nil, fmt.Errorf("failed to read log %q: %v", artifact.JobPath(), err) } logLines := strings.Split(string(read), "\n") return logLines, nil }
[ "func", "logLinesAll", "(", "artifact", "lenses", ".", "Artifact", ")", "(", "[", "]", "string", ",", "error", ")", "{", "read", ",", "err", ":=", "artifact", ".", "ReadAll", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt...
// logLinesAll reads all of an artifact and splits it into lines.
[ "logLinesAll", "reads", "all", "of", "an", "artifact", "and", "splits", "it", "into", "lines", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/spyglass/lenses/buildlog/lens.go#L182-L190
test
kubernetes/test-infra
prow/spyglass/lenses/buildlog/lens.go
executeTemplate
func executeTemplate(resourceDir, templateName string, data interface{}) string { t := template.New("template.html") _, err := t.ParseFiles(filepath.Join(resourceDir, "template.html")) if err != nil { return fmt.Sprintf("Failed to load template: %v", err) } var buf bytes.Buffer if err := t.ExecuteTemplate(&buf,...
go
func executeTemplate(resourceDir, templateName string, data interface{}) string { t := template.New("template.html") _, err := t.ParseFiles(filepath.Join(resourceDir, "template.html")) if err != nil { return fmt.Sprintf("Failed to load template: %v", err) } var buf bytes.Buffer if err := t.ExecuteTemplate(&buf,...
[ "func", "executeTemplate", "(", "resourceDir", ",", "templateName", "string", ",", "data", "interface", "{", "}", ")", "string", "{", "t", ":=", "template", ".", "New", "(", "\"template.html\"", ")", "\n", "_", ",", "err", ":=", "t", ".", "ParseFiles", "...
// LogViewTemplate executes the log viewer template ready for rendering
[ "LogViewTemplate", "executes", "the", "log", "viewer", "template", "ready", "for", "rendering" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/spyglass/lenses/buildlog/lens.go#L295-L306
test
kubernetes/test-infra
boskos/crds/resource_crd.go
DeepCopyObject
func (in *ResourceObject) DeepCopyObject() runtime.Object { if c := in.deepCopy(); c != nil { return c } return nil }
go
func (in *ResourceObject) DeepCopyObject() runtime.Object { if c := in.deepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "ResourceObject", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "deepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "\n", "}" ]
// DeepCopyObject implements runtime.Object interface
[ "DeepCopyObject", "implements", "runtime", ".", "Object", "interface" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/crds/resource_crd.go#L97-L102
test
kubernetes/test-infra
boskos/crds/resource_crd.go
FromItem
func (in *ResourceObject) FromItem(i common.Item) { r, err := common.ItemToResource(i) if err == nil { in.fromResource(r) } }
go
func (in *ResourceObject) FromItem(i common.Item) { r, err := common.ItemToResource(i) if err == nil { in.fromResource(r) } }
[ "func", "(", "in", "*", "ResourceObject", ")", "FromItem", "(", "i", "common", ".", "Item", ")", "{", "r", ",", "err", ":=", "common", ".", "ItemToResource", "(", "i", ")", "\n", "if", "err", "==", "nil", "{", "in", ".", "fromResource", "(", "r", ...
// FromItem implements Object interface
[ "FromItem", "implements", "Object", "interface" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/crds/resource_crd.go#L130-L135
test
kubernetes/test-infra
boskos/crds/resource_crd.go
SetItems
func (in *ResourceCollection) SetItems(objects []Object) { var items []*ResourceObject for _, b := range objects { items = append(items, b.(*ResourceObject)) } in.Items = items }
go
func (in *ResourceCollection) SetItems(objects []Object) { var items []*ResourceObject for _, b := range objects { items = append(items, b.(*ResourceObject)) } in.Items = items }
[ "func", "(", "in", "*", "ResourceCollection", ")", "SetItems", "(", "objects", "[", "]", "Object", ")", "{", "var", "items", "[", "]", "*", "ResourceObject", "\n", "for", "_", ",", "b", ":=", "range", "objects", "{", "items", "=", "append", "(", "ite...
// SetItems implements Collection interface
[ "SetItems", "implements", "Collection", "interface" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/crds/resource_crd.go#L147-L153
test
kubernetes/test-infra
boskos/crds/resource_crd.go
DeepCopyObject
func (in *ResourceCollection) DeepCopyObject() runtime.Object { if c := in.deepCopy(); c != nil { return c } return nil }
go
func (in *ResourceCollection) DeepCopyObject() runtime.Object { if c := in.deepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "ResourceCollection", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "deepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "\n", "}" ]
// DeepCopyObject implements Collection interface
[ "DeepCopyObject", "implements", "Collection", "interface" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/crds/resource_crd.go#L172-L177
test
kubernetes/test-infra
prow/cmd/mkbuild-cluster/main.go
useContext
func useContext(o options, ctx string) error { _, cmd := command("kubectl", "config", "use-context", ctx) return cmd.Run() }
go
func useContext(o options, ctx string) error { _, cmd := command("kubectl", "config", "use-context", ctx) return cmd.Run() }
[ "func", "useContext", "(", "o", "options", ",", "ctx", "string", ")", "error", "{", "_", ",", "cmd", ":=", "command", "(", "\"kubectl\"", ",", "\"config\"", ",", "\"use-context\"", ",", "ctx", ")", "\n", "return", "cmd", ".", "Run", "(", ")", "\n", "...
// useContext calls kubectl config use-context ctx
[ "useContext", "calls", "kubectl", "config", "use", "-", "context", "ctx" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/mkbuild-cluster/main.go#L107-L110
test
kubernetes/test-infra
prow/cmd/mkbuild-cluster/main.go
currentContext
func currentContext(o options) (string, error) { _, cmd := command("kubectl", "config", "current-context") b, err := cmd.Output() return strings.TrimSpace(string(b)), err }
go
func currentContext(o options) (string, error) { _, cmd := command("kubectl", "config", "current-context") b, err := cmd.Output() return strings.TrimSpace(string(b)), err }
[ "func", "currentContext", "(", "o", "options", ")", "(", "string", ",", "error", ")", "{", "_", ",", "cmd", ":=", "command", "(", "\"kubectl\"", ",", "\"config\"", ",", "\"current-context\"", ")", "\n", "b", ",", "err", ":=", "cmd", ".", "Output", "(",...
// currentContext returns kubectl config current-context
[ "currentContext", "returns", "kubectl", "config", "current", "-", "context" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/mkbuild-cluster/main.go#L113-L117
test
kubernetes/test-infra
prow/cmd/mkbuild-cluster/main.go
command
func command(bin string, args ...string) ([]string, *exec.Cmd) { cmd := exec.Command(bin, args...) cmd.Stderr = os.Stderr return append([]string{bin}, args...), cmd }
go
func command(bin string, args ...string) ([]string, *exec.Cmd) { cmd := exec.Command(bin, args...) cmd.Stderr = os.Stderr return append([]string{bin}, args...), cmd }
[ "func", "command", "(", "bin", "string", ",", "args", "...", "string", ")", "(", "[", "]", "string", ",", "*", "exec", ".", "Cmd", ")", "{", "cmd", ":=", "exec", ".", "Command", "(", "bin", ",", "args", "...", ")", "\n", "cmd", ".", "Stderr", "...
// command creates an exec.Cmd with Stderr piped to os.Stderr and returns the args
[ "command", "creates", "an", "exec", ".", "Cmd", "with", "Stderr", "piped", "to", "os", ".", "Stderr", "and", "returns", "the", "args" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/mkbuild-cluster/main.go#L150-L154
test
kubernetes/test-infra
prow/cmd/mkbuild-cluster/main.go
describeCluster
func describeCluster(o options) (*describe, error) { if o.account != "" { act, err := getAccount() if err != nil { return nil, fmt.Errorf("get current account: %v", err) } defer setAccount(act) if err = setAccount(o.account); err != nil { return nil, fmt.Errorf("set account %s: %v", o.account, err) }...
go
func describeCluster(o options) (*describe, error) { if o.account != "" { act, err := getAccount() if err != nil { return nil, fmt.Errorf("get current account: %v", err) } defer setAccount(act) if err = setAccount(o.account); err != nil { return nil, fmt.Errorf("set account %s: %v", o.account, err) }...
[ "func", "describeCluster", "(", "o", "options", ")", "(", "*", "describe", ",", "error", ")", "{", "if", "o", ".", "account", "!=", "\"\"", "{", "act", ",", "err", ":=", "getAccount", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ...
// describeCluster returns details from gcloud container clusters describe.
[ "describeCluster", "returns", "details", "from", "gcloud", "container", "clusters", "describe", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/cmd/mkbuild-cluster/main.go#L173-L214
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
Set
func (ss *strslice) Set(value string) error { *ss = append(*ss, value) return nil }
go
func (ss *strslice) Set(value string) error { *ss = append(*ss, value) return nil }
[ "func", "(", "ss", "*", "strslice", ")", "Set", "(", "value", "string", ")", "error", "{", "*", "ss", "=", "append", "(", "*", "ss", ",", "value", ")", "\n", "return", "nil", "\n", "}" ]
// Set appends a value onto the strslice.
[ "Set", "appends", "a", "value", "onto", "the", "strslice", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L65-L68
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
parseXML
func parseXML(body []byte, object string) (*gcsDir, error) { dir := new(gcsDir) if err := xml.Unmarshal(body, &dir); err != nil { return nil, err } // We think this is a dir if the object is "/" (just the bucket) or if we // find any Contents or CommonPrefixes. isDir := object == "/" || len(dir.Contents)+len(di...
go
func parseXML(body []byte, object string) (*gcsDir, error) { dir := new(gcsDir) if err := xml.Unmarshal(body, &dir); err != nil { return nil, err } // We think this is a dir if the object is "/" (just the bucket) or if we // find any Contents or CommonPrefixes. isDir := object == "/" || len(dir.Contents)+len(di...
[ "func", "parseXML", "(", "body", "[", "]", "byte", ",", "object", "string", ")", "(", "*", "gcsDir", ",", "error", ")", "{", "dir", ":=", "new", "(", "gcsDir", ")", "\n", "if", "err", ":=", "xml", ".", "Unmarshal", "(", "body", ",", "&", "dir", ...
// parseXML extracts a gcsDir object from XML. If this returns a nil gcsDir, // the XML indicated that this was not a directory at all.
[ "parseXML", "extracts", "a", "gcsDir", "object", "from", "XML", ".", "If", "this", "returns", "a", "nil", "gcsDir", "the", "XML", "indicated", "that", "this", "was", "not", "a", "directory", "at", "all", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L297-L333
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
Render
func (dir *gcsDir) Render(out http.ResponseWriter, inPath string) { htmlPageHeader(out, dir.Name) if !strings.HasSuffix(inPath, "/") { inPath += "/" } htmlContentHeader(out, dir.Name, inPath) if dir.NextMarker != "" { htmlNextButton(out, gcsPath+inPath, dir.NextMarker) } htmlGridHeader(out) if parent :=...
go
func (dir *gcsDir) Render(out http.ResponseWriter, inPath string) { htmlPageHeader(out, dir.Name) if !strings.HasSuffix(inPath, "/") { inPath += "/" } htmlContentHeader(out, dir.Name, inPath) if dir.NextMarker != "" { htmlNextButton(out, gcsPath+inPath, dir.NextMarker) } htmlGridHeader(out) if parent :=...
[ "func", "(", "dir", "*", "gcsDir", ")", "Render", "(", "out", "http", ".", "ResponseWriter", ",", "inPath", "string", ")", "{", "htmlPageHeader", "(", "out", ",", "dir", ".", "Name", ")", "\n", "if", "!", "strings", ".", "HasSuffix", "(", "inPath", "...
// Render writes HTML representing this gcsDir to the provided output.
[ "Render", "writes", "HTML", "representing", "this", "gcsDir", "to", "the", "provided", "output", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L500-L532
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
Render
func (rec *Record) Render(out http.ResponseWriter, inPath string) { mtime := "<unknown>" ts, err := time.Parse(time.RFC3339, rec.MTime) if err == nil { mtime = ts.Format("02 Jan 2006 15:04:05") } var url, size string if rec.isDir { url = gcsPath + inPath + rec.Name size = "-" } else { url = gcsBaseURL + ...
go
func (rec *Record) Render(out http.ResponseWriter, inPath string) { mtime := "<unknown>" ts, err := time.Parse(time.RFC3339, rec.MTime) if err == nil { mtime = ts.Format("02 Jan 2006 15:04:05") } var url, size string if rec.isDir { url = gcsPath + inPath + rec.Name size = "-" } else { url = gcsBaseURL + ...
[ "func", "(", "rec", "*", "Record", ")", "Render", "(", "out", "http", ".", "ResponseWriter", ",", "inPath", "string", ")", "{", "mtime", ":=", "\"<unknown>\"", "\n", "ts", ",", "err", ":=", "time", ".", "Parse", "(", "time", ".", "RFC3339", ",", "rec...
// Render writes HTML representing this Record to the provided output.
[ "Render", "writes", "HTML", "representing", "this", "Record", "to", "the", "provided", "output", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L543-L558
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
Render
func (pfx *Prefix) Render(out http.ResponseWriter, inPath string) { url := gcsPath + inPath + pfx.Prefix htmlGridItem(out, iconDir, url, pfx.Prefix, "-", "-") }
go
func (pfx *Prefix) Render(out http.ResponseWriter, inPath string) { url := gcsPath + inPath + pfx.Prefix htmlGridItem(out, iconDir, url, pfx.Prefix, "-", "-") }
[ "func", "(", "pfx", "*", "Prefix", ")", "Render", "(", "out", "http", ".", "ResponseWriter", ",", "inPath", "string", ")", "{", "url", ":=", "gcsPath", "+", "inPath", "+", "pfx", ".", "Prefix", "\n", "htmlGridItem", "(", "out", ",", "iconDir", ",", "...
// Render writes HTML representing this Prefix to the provided output.
[ "Render", "writes", "HTML", "representing", "this", "Prefix", "to", "the", "provided", "output", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L566-L569
test
kubernetes/test-infra
gcsweb/cmd/gcsweb/gcsweb.go
Printf
func (tl txnLogger) Printf(fmt string, args ...interface{}) { args = append([]interface{}{tl.nonce}, args...) log.Printf("[txn-%s] "+fmt, args...) }
go
func (tl txnLogger) Printf(fmt string, args ...interface{}) { args = append([]interface{}{tl.nonce}, args...) log.Printf("[txn-%s] "+fmt, args...) }
[ "func", "(", "tl", "txnLogger", ")", "Printf", "(", "fmt", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "args", "=", "append", "(", "[", "]", "interface", "{", "}", "{", "tl", ".", "nonce", "}", ",", "args", "...", ")", "\n", ...
// Printf logs a formatted line to the logging output.
[ "Printf", "logs", "a", "formatted", "line", "to", "the", "logging", "output", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/gcsweb/cmd/gcsweb/gcsweb.go#L577-L580
test
kubernetes/test-infra
prow/gerrit/client/client.go
NewClient
func NewClient(instances map[string][]string) (*Client, error) { c := &Client{ handlers: map[string]*gerritInstanceHandler{}, } for instance := range instances { gc, err := gerrit.NewClient(instance, nil) if err != nil { return nil, err } c.handlers[instance] = &gerritInstanceHandler{ instance: ...
go
func NewClient(instances map[string][]string) (*Client, error) { c := &Client{ handlers: map[string]*gerritInstanceHandler{}, } for instance := range instances { gc, err := gerrit.NewClient(instance, nil) if err != nil { return nil, err } c.handlers[instance] = &gerritInstanceHandler{ instance: ...
[ "func", "NewClient", "(", "instances", "map", "[", "string", "]", "[", "]", "string", ")", "(", "*", "Client", ",", "error", ")", "{", "c", ":=", "&", "Client", "{", "handlers", ":", "map", "[", "string", "]", "*", "gerritInstanceHandler", "{", "}", ...
// NewClient returns a new gerrit client
[ "NewClient", "returns", "a", "new", "gerrit", "client" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/gerrit/client/client.go#L124-L145
test
kubernetes/test-infra
prow/gerrit/client/client.go
SetReview
func (c *Client) SetReview(instance, id, revision, message string, labels map[string]string) error { h, ok := c.handlers[instance] if !ok { return fmt.Errorf("not activated gerrit instance: %s", instance) } if _, _, err := h.changeService.SetReview(id, revision, &gerrit.ReviewInput{ Message: message, Labels:...
go
func (c *Client) SetReview(instance, id, revision, message string, labels map[string]string) error { h, ok := c.handlers[instance] if !ok { return fmt.Errorf("not activated gerrit instance: %s", instance) } if _, _, err := h.changeService.SetReview(id, revision, &gerrit.ReviewInput{ Message: message, Labels:...
[ "func", "(", "c", "*", "Client", ")", "SetReview", "(", "instance", ",", "id", ",", "revision", ",", "message", "string", ",", "labels", "map", "[", "string", "]", "string", ")", "error", "{", "h", ",", "ok", ":=", "c", ".", "handlers", "[", "insta...
// SetReview writes a review comment base on the change id + revision
[ "SetReview", "writes", "a", "review", "comment", "base", "on", "the", "change", "id", "+", "revision" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/gerrit/client/client.go#L208-L222
test
kubernetes/test-infra
prow/gerrit/client/client.go
GetBranchRevision
func (c *Client) GetBranchRevision(instance, project, branch string) (string, error) { h, ok := c.handlers[instance] if !ok { return "", fmt.Errorf("not activated gerrit instance: %s", instance) } res, _, err := h.projectService.GetBranch(project, branch) if err != nil { return "", err } return res.Revisio...
go
func (c *Client) GetBranchRevision(instance, project, branch string) (string, error) { h, ok := c.handlers[instance] if !ok { return "", fmt.Errorf("not activated gerrit instance: %s", instance) } res, _, err := h.projectService.GetBranch(project, branch) if err != nil { return "", err } return res.Revisio...
[ "func", "(", "c", "*", "Client", ")", "GetBranchRevision", "(", "instance", ",", "project", ",", "branch", "string", ")", "(", "string", ",", "error", ")", "{", "h", ",", "ok", ":=", "c", ".", "handlers", "[", "instance", "]", "\n", "if", "!", "ok"...
// GetBranchRevision returns SHA of HEAD of a branch
[ "GetBranchRevision", "returns", "SHA", "of", "HEAD", "of", "a", "branch" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/gerrit/client/client.go#L225-L237
test
kubernetes/test-infra
prow/gerrit/client/client.go
queryAllChanges
func (h *gerritInstanceHandler) queryAllChanges(lastUpdate time.Time, rateLimit int) []gerrit.ChangeInfo { result := []gerrit.ChangeInfo{} for _, project := range h.projects { changes, err := h.queryChangesForProject(project, lastUpdate, rateLimit) if err != nil { // don't halt on error from one project, log &...
go
func (h *gerritInstanceHandler) queryAllChanges(lastUpdate time.Time, rateLimit int) []gerrit.ChangeInfo { result := []gerrit.ChangeInfo{} for _, project := range h.projects { changes, err := h.queryChangesForProject(project, lastUpdate, rateLimit) if err != nil { // don't halt on error from one project, log &...
[ "func", "(", "h", "*", "gerritInstanceHandler", ")", "queryAllChanges", "(", "lastUpdate", "time", ".", "Time", ",", "rateLimit", "int", ")", "[", "]", "gerrit", ".", "ChangeInfo", "{", "result", ":=", "[", "]", "gerrit", ".", "ChangeInfo", "{", "}", "\n...
// private handler implementation details
[ "private", "handler", "implementation", "details" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/prow/gerrit/client/client.go#L241-L254
test
kubernetes/test-infra
velodrome/transform/plugins/type_filter_wrapper.go
NewTypeFilterWrapperPlugin
func NewTypeFilterWrapperPlugin(plugin Plugin) *TypeFilterWrapperPlugin { return &TypeFilterWrapperPlugin{ plugin: plugin, pass: map[string]bool{}, } }
go
func NewTypeFilterWrapperPlugin(plugin Plugin) *TypeFilterWrapperPlugin { return &TypeFilterWrapperPlugin{ plugin: plugin, pass: map[string]bool{}, } }
[ "func", "NewTypeFilterWrapperPlugin", "(", "plugin", "Plugin", ")", "*", "TypeFilterWrapperPlugin", "{", "return", "&", "TypeFilterWrapperPlugin", "{", "plugin", ":", "plugin", ",", "pass", ":", "map", "[", "string", "]", "bool", "{", "}", ",", "}", "\n", "}...
// NewTypeFilterWrapperPlugin is the constructor of TypeFilterWrapperPlugin
[ "NewTypeFilterWrapperPlugin", "is", "the", "constructor", "of", "TypeFilterWrapperPlugin" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/plugins/type_filter_wrapper.go#L41-L46
test
kubernetes/test-infra
velodrome/transform/plugins/type_filter_wrapper.go
AddFlags
func (t *TypeFilterWrapperPlugin) AddFlags(cmd *cobra.Command) { cmd.Flags().BoolVar(&t.pullRequests, "no-pull-requests", false, "Ignore pull-requests") cmd.Flags().BoolVar(&t.issues, "no-issues", false, "Ignore issues") }
go
func (t *TypeFilterWrapperPlugin) AddFlags(cmd *cobra.Command) { cmd.Flags().BoolVar(&t.pullRequests, "no-pull-requests", false, "Ignore pull-requests") cmd.Flags().BoolVar(&t.issues, "no-issues", false, "Ignore issues") }
[ "func", "(", "t", "*", "TypeFilterWrapperPlugin", ")", "AddFlags", "(", "cmd", "*", "cobra", ".", "Command", ")", "{", "cmd", ".", "Flags", "(", ")", ".", "BoolVar", "(", "&", "t", ".", "pullRequests", ",", "\"no-pull-requests\"", ",", "false", ",", "\...
// AddFlags adds "no-pull-requests" and "no-issues" to the command help
[ "AddFlags", "adds", "no", "-", "pull", "-", "requests", "and", "no", "-", "issues", "to", "the", "command", "help" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/plugins/type_filter_wrapper.go#L49-L52
test
kubernetes/test-infra
velodrome/transform/plugins/type_filter_wrapper.go
CheckFlags
func (t *TypeFilterWrapperPlugin) CheckFlags() error { if t.pullRequests && t.issues { return fmt.Errorf( "you can't ignore both pull-requests and issues") } return nil }
go
func (t *TypeFilterWrapperPlugin) CheckFlags() error { if t.pullRequests && t.issues { return fmt.Errorf( "you can't ignore both pull-requests and issues") } return nil }
[ "func", "(", "t", "*", "TypeFilterWrapperPlugin", ")", "CheckFlags", "(", ")", "error", "{", "if", "t", ".", "pullRequests", "&&", "t", ".", "issues", "{", "return", "fmt", ".", "Errorf", "(", "\"you can't ignore both pull-requests and issues\"", ")", "\n", "}...
// CheckFlags makes sure not both PR and issues are ignored
[ "CheckFlags", "makes", "sure", "not", "both", "PR", "and", "issues", "are", "ignored" ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/velodrome/transform/plugins/type_filter_wrapper.go#L55-L61
test
kubernetes/test-infra
boskos/crds/client.go
AddFlags
func (o *KubernetesClientOptions) AddFlags(fs *flag.FlagSet) { fs.StringVar(&o.namespace, "namespace", v1.NamespaceDefault, "namespace to install on") fs.StringVar(&o.kubeConfig, "kubeconfig", "", "absolute path to the kubeConfig file") fs.BoolVar(&o.inMemory, "in_memory", false, "Use in memory client instead of CRD...
go
func (o *KubernetesClientOptions) AddFlags(fs *flag.FlagSet) { fs.StringVar(&o.namespace, "namespace", v1.NamespaceDefault, "namespace to install on") fs.StringVar(&o.kubeConfig, "kubeconfig", "", "absolute path to the kubeConfig file") fs.BoolVar(&o.inMemory, "in_memory", false, "Use in memory client instead of CRD...
[ "func", "(", "o", "*", "KubernetesClientOptions", ")", "AddFlags", "(", "fs", "*", "flag", ".", "FlagSet", ")", "{", "fs", ".", "StringVar", "(", "&", "o", ".", "namespace", ",", "\"namespace\"", ",", "v1", ".", "NamespaceDefault", ",", "\"namespace to ins...
// AddFlags adds kube client flags to existing FlagSet.
[ "AddFlags", "adds", "kube", "client", "flags", "to", "existing", "FlagSet", "." ]
8125fbda10178887be5dff9e901d6a0a519b67bc
https://github.com/kubernetes/test-infra/blob/8125fbda10178887be5dff9e901d6a0a519b67bc/boskos/crds/client.go#L50-L54
test