[gold] JSON config: Replace option "lit_html_path" with "resources_dir".
Now that the legacy Polymer code has been deleted, there's no longer a reason to specify two separate directories with static assets. Therefore, this CL repurposes "resources_dir" as a replacement for the transitional "lit_html_path" JSON option, which can be deleted.
Bug: skia:9525
Change-Id: I75f17da6d3efa528c536fa134f1e7d3193f9cf15
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/326983
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/golden/cmd/skiacorrectness/skiacorrectness.go b/golden/cmd/skiacorrectness/skiacorrectness.go
index f501b76..4485cb8 100644
--- a/golden/cmd/skiacorrectness/skiacorrectness.go
+++ b/golden/cmd/skiacorrectness/skiacorrectness.go
@@ -112,9 +112,6 @@
// If this instance is simply a mirror of another instance's data.
IsPublicView bool `json:"is_public_view"`
- // File path to built lit-html files that should be served as part of the frontend.
- LitHTMLPath string `json:"lit_html_path"`
-
// The longest time negative expectations can go unused before being purged. (0 means infinity)
NegativesMaxAge config.Duration `json:"negatives_max_age" optional:"true"`
@@ -655,7 +652,7 @@
// placeholders such as {{.Title}}. These aren't used directly by client code. We should probably
// unexpose them and only serve the JS/CSS Webpack bundles from this route (and any other static
// assets such as the favicon).
- loggedRouter.PathPrefix("/dist/").HandlerFunc(web.MakeResourceHandler(fsc.LitHTMLPath))
+ loggedRouter.PathPrefix("/dist/").Handler(http.StripPrefix("/dist/", http.HandlerFunc(web.MakeResourceHandler(fsc.ResourcesPath))))
// Login endpoints.
loggedRouter.HandleFunc(callbackPath, login.OAuth2CallbackHandler)
@@ -753,7 +750,7 @@
var templates *template.Template
loadTemplates := func() {
- templates = template.Must(template.New("").ParseGlob(filepath.Join(fsc.LitHTMLPath, "dist", "*.html")))
+ templates = template.Must(template.New("").ParseGlob(filepath.Join(fsc.ResourcesPath, "*.html")))
}
loadTemplates()
@@ -777,7 +774,7 @@
}
}
- // These are the new lit-html pages.
+ // These routes serve the web UI.
loggedRouter.HandleFunc("/", templateHandler("byblame.html"))
loggedRouter.HandleFunc("/changelists", templateHandler("changelists.html"))
loggedRouter.HandleFunc("/cluster", templateHandler("cluster.html"))
diff --git a/golden/k8s-instances/angle/angle-skiacorrectness.json5 b/golden/k8s-instances/angle/angle-skiacorrectness.json5
index a84aab5..eb77db6 100644
--- a/golden/k8s-instances/angle/angle-skiacorrectness.json5
+++ b/golden/k8s-instances/angle/angle-skiacorrectness.json5
@@ -15,11 +15,10 @@
defaultCorpus: "angle",
title: "Gold for ANGLE",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 512,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://angle-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-angle",
diff --git a/golden/k8s-instances/chrome-gpu/chrome-gpu-skiacorrectness.json5 b/golden/k8s-instances/chrome-gpu/chrome-gpu-skiacorrectness.json5
index 7350f89..8079447 100644
--- a/golden/k8s-instances/chrome-gpu/chrome-gpu-skiacorrectness.json5
+++ b/golden/k8s-instances/chrome-gpu/chrome-gpu-skiacorrectness.json5
@@ -19,11 +19,10 @@
defaultCorpus: "chrome-gpu",
title: "Chrome GPU Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 512,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://chrome-gpu-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-chrome-gpu",
diff --git a/golden/k8s-instances/chrome-public/chrome-public-skiacorrectness.json5 b/golden/k8s-instances/chrome-public/chrome-public-skiacorrectness.json5
index cdcb341..638b2c7 100644
--- a/golden/k8s-instances/chrome-public/chrome-public-skiacorrectness.json5
+++ b/golden/k8s-instances/chrome-public/chrome-public-skiacorrectness.json5
@@ -14,11 +14,10 @@
defaultCorpus: "android-render-tests",
title: "Chrome Public Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 512,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://chrome-public-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-chrome",
diff --git a/golden/k8s-instances/chrome/chrome-skiacorrectness.json5 b/golden/k8s-instances/chrome/chrome-skiacorrectness.json5
index 0fc843a..22006fd 100644
--- a/golden/k8s-instances/chrome/chrome-skiacorrectness.json5
+++ b/golden/k8s-instances/chrome/chrome-skiacorrectness.json5
@@ -23,12 +23,11 @@
defaultCorpus: "android-render-tests",
title: "Chrome Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 512,
port: ":8000",
prom_port: ":20000",
public_site_url: "https://chrome-public-gold.skia.org",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://chrome-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-chrome",
diff --git a/golden/k8s-instances/flutter-engine/flutter-engine-skiacorrectness.json5 b/golden/k8s-instances/flutter-engine/flutter-engine-skiacorrectness.json5
index 42dbf31..f95db7e 100644
--- a/golden/k8s-instances/flutter-engine/flutter-engine-skiacorrectness.json5
+++ b/golden/k8s-instances/flutter-engine/flutter-engine-skiacorrectness.json5
@@ -13,11 +13,10 @@
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 200,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://flutter-engine-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
diff --git a/golden/k8s-instances/flutter/flutter-skiacorrectness.json5 b/golden/k8s-instances/flutter/flutter-skiacorrectness.json5
index 6862c1f..bf10c37 100644
--- a/golden/k8s-instances/flutter/flutter-skiacorrectness.json5
+++ b/golden/k8s-instances/flutter/flutter-skiacorrectness.json5
@@ -16,11 +16,10 @@
defaultCorpus: "flutter",
title: "Flutter Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 200,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://flutter-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-flutter",
diff --git a/golden/k8s-instances/fuchsia-public/fuchsia-public-skiacorrectness.json5 b/golden/k8s-instances/fuchsia-public/fuchsia-public-skiacorrectness.json5
index 0c0ba17..2c7c078 100644
--- a/golden/k8s-instances/fuchsia-public/fuchsia-public-skiacorrectness.json5
+++ b/golden/k8s-instances/fuchsia-public/fuchsia-public-skiacorrectness.json5
@@ -14,11 +14,10 @@
defaultCorpus: "test",
title: "Fuchsia Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 200,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://fuchsia-public-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-fuchsia-public",
diff --git a/golden/k8s-instances/lottie/lottie-skiacorrectness.json5 b/golden/k8s-instances/lottie/lottie-skiacorrectness.json5
index 44adf0a..4c1f57a 100644
--- a/golden/k8s-instances/lottie/lottie-skiacorrectness.json5
+++ b/golden/k8s-instances/lottie/lottie-skiacorrectness.json5
@@ -13,11 +13,10 @@
defaultCorpus: "lottie",
title: "Lottie Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 500,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://lottie-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-lottie",
diff --git a/golden/k8s-instances/pdfium/pdfium-skiacorrectness.json5 b/golden/k8s-instances/pdfium/pdfium-skiacorrectness.json5
index 318ce90..9357a34 100644
--- a/golden/k8s-instances/pdfium/pdfium-skiacorrectness.json5
+++ b/golden/k8s-instances/pdfium/pdfium-skiacorrectness.json5
@@ -13,11 +13,10 @@
defaultCorpus: "corpus",
title: "Pdfium Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 500,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://pdfium-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-pdfium",
diff --git a/golden/k8s-instances/skia-infra/skia-infra-skiacorrectness.json5 b/golden/k8s-instances/skia-infra/skia-infra-skiacorrectness.json5
index 976e20d..e97a5b5 100644
--- a/golden/k8s-instances/skia-infra/skia-infra-skiacorrectness.json5
+++ b/golden/k8s-instances/skia-infra/skia-infra-skiacorrectness.json5
@@ -13,13 +13,12 @@
defaultCorpus: "infra",
title: "Skia Infra Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
negatives_max_age: "4320h", // 180 days
num_commits: 200,
port: ":8000",
positives_max_age: "720h", // 30 days
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://skia-infra-gold.skia.org",
tile_freshness: "1m",
trace_bt_table: "gold-skia-infra",
diff --git a/golden/k8s-instances/skia-public/skia-public-skiacorrectness.json5 b/golden/k8s-instances/skia-public/skia-public-skiacorrectness.json5
index 0c490de..35b9c63 100644
--- a/golden/k8s-instances/skia-public/skia-public-skiacorrectness.json5
+++ b/golden/k8s-instances/skia-public/skia-public-skiacorrectness.json5
@@ -16,11 +16,10 @@
defaultCorpus: "gm",
title: "Skia Public Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
num_commits: 256,
port: ":8000",
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://public-gold.skia.org",
tile_freshness: "10m",
trace_bt_table: "gold-skia",
diff --git a/golden/k8s-instances/skia/skia-skiacorrectness.json5 b/golden/k8s-instances/skia/skia-skiacorrectness.json5
index bbe838e..3613eb9 100644
--- a/golden/k8s-instances/skia/skia-skiacorrectness.json5
+++ b/golden/k8s-instances/skia/skia-skiacorrectness.json5
@@ -14,13 +14,12 @@
defaultCorpus: "gm",
title: "Skia Gold",
},
- lit_html_path: "/usr/local/share/skiacorrectness",
negatives_max_age: "4320h", // 180 days
num_commits: 256,
port: ":8000",
positives_max_age: "720h", // 30 days
prom_port: ":20000",
- resources_path: "/usr/local/share/skiacorrectness/frontend",
+ resources_path: "/usr/local/share/skiacorrectness/dist",
site_url: "https://gold.skia.org",
tile_freshness: "5m",
trace_bt_table: "gold-skia",