From c673ca06b23cea94091ab496ef62c3513e434585 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 30 Aug 2024 12:02:30 +0200 Subject: dashboard/app: add file coverage page It directly uses the coverage signals from BigQuery. There is no need to wait for the coverage_batch cron jobs. Looks good for debugging. Limitations: 1. It is slow. I know how to speed up but want to stabilize the UI first. 2. It is expensive because of the direct BQ requests. Limited to admin only because of it. 3. It merges only the commits reachable on github because of the gitweb throttling. After the UI stabilization I'll save all the required artifacts to spanner and make this page publicly available. To merge all the commits, not the github reachable only, http git caching instance is needed. --- pkg/validator/validator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/validator') diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index 420830835..723cf2384 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -9,6 +9,7 @@ import ( "regexp" "github.com/google/syzkaller/pkg/auth" + "github.com/google/syzkaller/pkg/coveragedb" ) type Result struct { @@ -50,11 +51,14 @@ var ( EmptyStr = makeStrLenFunc("not empty", 0) AlphaNumeric = makeStrReFunc("not an alphanum", "^[a-zA-Z0-9]*$") CommitHash = makeCombinedStrFunc("not a hash", AlphaNumeric, makeStrLenFunc("len is not 40", 40)) - KernelFilePath = makeStrReFunc("not a kernel file path", "^[./_a-zA-Z0-9]*$") + KernelFilePath = makeStrReFunc("not a kernel file path", "^[./-_a-zA-Z0-9]*$") NamespaceName = makeStrReFunc("not a namespace name", "^[a-zA-Z0-9-_.]{4,32}$") DashClientName = makeStrReFunc("not a dashboard client name", "^[a-zA-Z0-9-_.]{4,100}$") DashClientKey = makeStrReFunc("not a dashboard client key", "^([a-zA-Z0-9]{16,128})|("+regexp.QuoteMeta(auth.OauthMagic)+".*)$") + TimePeriodType = makeStrReFunc(fmt.Sprintf("bad time period, use (%s|%s|%s)", + coveragedb.DayPeriod, coveragedb.MonthPeriod, coveragedb.QuarterPeriod), + fmt.Sprintf("^(%s|%s|%s)$", coveragedb.DayPeriod, coveragedb.MonthPeriod, coveragedb.QuarterPeriod)) ) type strValidationFunc func(string, ...string) Result -- cgit mrf-deployment