diff --git a/apps/webapp/app/src.old/apollo.js b/apps/webapp/app/src.old/apollo.js
deleted file mode 100644
index 6e33faf4e..000000000
--- a/apps/webapp/app/src.old/apollo.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import ApolloClient from 'apollo-boost';
-import fetch from 'node-fetch';
-
-const GQL_ENDPOINT = 'http://hasura:8080/v1/graphql'
-// const GQL_ENDPOINT = 'http://localhost/hasura/v1/graphql';
-
-export default new ApolloClient({
- uri: GQL_ENDPOINT,
- fetch: fetch
-});
diff --git a/apps/webapp/app/src.old/client.js b/apps/webapp/app/src.old/client.js
deleted file mode 100644
index d32e54c64..000000000
--- a/apps/webapp/app/src.old/client.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import * as sapper from '@sapper/app';
-
-sapper.start({
- target: document.querySelector('#sapper')
-});
diff --git a/apps/webapp/app/src.old/components/Breadcrumb.svelte b/apps/webapp/app/src.old/components/Breadcrumb.svelte
deleted file mode 100644
index ab362b037..000000000
--- a/apps/webapp/app/src.old/components/Breadcrumb.svelte
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- {#if $mouseOverPath.length > 0}
-
{#if level}{level}{/if}{#if category}{category}{/if}{#if operation_id} {operation_id}{/if}
- {/if}
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/CoverageContainer.svelte b/apps/webapp/app/src.old/components/CoverageContainer.svelte
deleted file mode 100644
index 4423db07e..000000000
--- a/apps/webapp/app/src.old/components/CoverageContainer.svelte
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/CoverageHeader.svelte b/apps/webapp/app/src.old/components/CoverageHeader.svelte
deleted file mode 100644
index c79fabd06..000000000
--- a/apps/webapp/app/src.old/components/CoverageHeader.svelte
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
- {bucket}
- Change
-
- {timestamp}
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/CoverageOverTime.svelte b/apps/webapp/app/src.old/components/CoverageOverTime.svelte
deleted file mode 100644
index 868e85e57..000000000
--- a/apps/webapp/app/src.old/components/CoverageOverTime.svelte
+++ /dev/null
@@ -1,188 +0,0 @@
-
-
-Coverage Over Time
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/CoverageStats.svelte b/apps/webapp/app/src.old/components/CoverageStats.svelte
deleted file mode 100644
index 84d100674..000000000
--- a/apps/webapp/app/src.old/components/CoverageStats.svelte
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-{#if $currentDepth === 'endpoint'}
-
-{:else}
-
-
{level} {category}
-
Coverage
-
- - {total} total endpoints
- - {percentTested} tested ({tested} endpoints)
- - {percentConfTested} conformance tested ({confTested} endpoints)
-
-
-{/if}
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/EndpointCoverageStats.svelte b/apps/webapp/app/src.old/components/EndpointCoverageStats.svelte
deleted file mode 100644
index ef294a333..000000000
--- a/apps/webapp/app/src.old/components/EndpointCoverageStats.svelte
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
-
{path}
-
{operation_id}
-
-
- - description
- {description}
- {#if group}- group
- {group}
{/if}
- {#if version}- version
- {version}
{/if}
- {#if kind}- kind
- {kind}
{/if}
-
-
- {#if tested}
-
Tested!
- {:else}
-
Untested
- {/if}
-
- {#if confTested}
-
Conformance Tested
- {:else}
-
No Conformance Tests
- {/if}
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/Filters.svelte b/apps/webapp/app/src.old/components/Filters.svelte
deleted file mode 100644
index 673af90a4..000000000
--- a/apps/webapp/app/src.old/components/Filters.svelte
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-{#if !filtersVisible}
-
-
-
-{:else}
-
-
-
Set Filters
-
-
-{/if}
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/Nav.svelte b/apps/webapp/app/src.old/components/Nav.svelte
deleted file mode 100644
index 6830c0795..000000000
--- a/apps/webapp/app/src.old/components/Nav.svelte
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
diff --git a/apps/webapp/app/src.old/components/Sunburst.svelte b/apps/webapp/app/src.old/components/Sunburst.svelte
deleted file mode 100644
index b3733c8d3..000000000
--- a/apps/webapp/app/src.old/components/Sunburst.svelte
+++ /dev/null
@@ -1,222 +0,0 @@
-
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/TestTagsList.svelte b/apps/webapp/app/src.old/components/TestTagsList.svelte
deleted file mode 100644
index 536c10dcc..000000000
--- a/apps/webapp/app/src.old/components/TestTagsList.svelte
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-{#if $testTagsForEndpoint.length > 0}
-
-{/if}
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/components/TestsList.svelte b/apps/webapp/app/src.old/components/TestsList.svelte
deleted file mode 100644
index 58d0f1b40..000000000
--- a/apps/webapp/app/src.old/components/TestsList.svelte
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-{#if $testsForEndpoint.length > 0 }
-
-
Tests for {$breadcrumb[2]}
-
-
filter by test tag:
-
- {#each $testTagsForEndpoint as testTag}
- - toggleFilter(testTag)}>{testTag}
- {/each}
-
-
-
- {#each $filteredTests as fTest}
- - {fTest.test}
- {/each}
-
-
-{/if}
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/lib/colours.js b/apps/webapp/app/src.old/lib/colours.js
deleted file mode 100644
index 110eab03e..000000000
--- a/apps/webapp/app/src.old/lib/colours.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import {
- inRange,
- parseInt,
- words
-} from 'lodash-es';
-
-export const GRAY = 'rgba(244, 244, 244, 1)';
-
-export const levelColours = {
- alpha: 'rgba(230, 25, 75, 1)',
- beta: 'rgba(0, 130, 200, 1)',
- stable: 'rgba(60, 180, 75, 1)',
- unused: 'rgba(244, 244, 244, 1)'
-};
-
-
-export const categoryColours = {
- admissionregistration: 'rgba(183, 28, 28, 1)',
- apiextensions: 'rgba(49, 27, 146, 1)',
- apiregistration: 'rgba(1, 87, 155, 1)',
- apis: 'rgba(27, 94, 32, 1)',
- apps: 'rgba(245, 127, 23, 1)',
- authentication: 'rgba(191, 54, 12, 1)',
- authorization: 'rgba(156, 39, 176, 1)',
- autoscaling: 'rgba(33, 150, 243, 1)',
- batch: 'rgba(0, 150, 136, 1)',
- certificates: 'rgba(205, 220, 57, 1)',
- core: 'rgba(255, 152, 0, 1)',
- discovery: 'rgba(136, 14, 79, 1)',
- events: 'rgba(136, 14, 79, 1)',
- extensions: 'rgba(26, 35, 126, 1)',
- logs: 'rgba(0, 96, 100, 1)',
- networking: 'rgba(51, 105, 30, 1)',
- node: 'rgba(53, 105, 30, 1)',
- policy: 'rgba(255, 111, 0, 1)',
- rbacAuthorization: 'rgba(244, 67, 54, 1)',
- scheduling: 'rgba(103, 58, 183, 1)',
- settings: 'rgba(3, 169, 244, 1)',
- storage: 'rgba(255, 215, 0, 1)',
- version: 'rgba(255, 235, 59, 1)',
- auditregistration: 'rgba(255, 87, 34, 1)',
- coordination: 'rgba(74, 20, 140, 1)'
-};
-
-export function endpointColour (endpoint) {
- let endpointColor = categoryColours[endpoint.category]
- if (!endpoint.tested) {
- return GRAY;
- } else if (!endpoint.conf_tested) {
- return fadeColour(endpointColor, 0.75);
- } else {
- return endpointColor;
- }
-};
-
-export function fadeColour (colour, desiredOpacity) {
- let rgbaPattern = /rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(1|0\.[0-9])\)/g
- let rgbaIsValid = rgbaPattern.test(colour.replace(/\s+/g, ''));
- let opacityIsValid = inRange(parseInt(desiredOpacity), 0, 1.1);
- if (!rgbaIsValid) {
- console.log('color given to fadeColour does not match rgba pattern: ', colour);
- return `rgba(244,244,244,1)`
- } else if (!opacityIsValid) {
- console.log('opacity is not valid: ', desiredOpacity);
- return `rgba(244,244,244,1)`
- } else {
- let rgba = words(colour);
- let c = {
- red: rgba[1],
- green: rgba[2],
- blue: rgba[3]
- };
- return `rgba(${c.red}, ${c.green}, ${c.blue}, ${desiredOpacity})`
- };
-};
diff --git a/apps/webapp/app/src.old/lib/helpers.js b/apps/webapp/app/src.old/lib/helpers.js
deleted file mode 100644
index 03dd69726..000000000
--- a/apps/webapp/app/src.old/lib/helpers.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import {
- forEach,
- trimEnd,
- groupBy,
- mapValues,
- trimStart,
- flatten,
- uniq
-} from 'lodash-es';
-
-export const updateQueryParams = (page, query) => {
- // given a sapper page store, and new queries
- // construct a url string with old and new queries.
- let newQueries = {
- ...page.query,
- ...query
- };
-
- let queryStrings = {};
- forEach(newQueries, (v, k) => {
- queryStrings[k] = trimStart(v.reduce((acc, cur) => `${acc}${k}=${cur}&`, ''), '&');
- });
-
- let queryNames = Object.keys(queryStrings);
- let fullQueryString = trimEnd(queryNames.reduce((acc, cur) => `${acc}${queryStrings[cur]}`, '?'), '&');
- return fullQueryString;
-};
-
-export const toBoolean = (str) => {
- str = str.toString().toLowerCase();
- let truths = ["true", "t", "yes", "1", "truth"]
- return truths.includes(str)
-}
-
-export const isValidRegex = (regex) => {
- try {
- new RegExp(regex);
- } catch (e) {
- return false;
- }
- return true;
-};
-
-export const hitByMatchingItems = (items, key, regex, endpoint) => {
- // given an array of objects, items, a key to compare, and the regex to match.
- // return true if endpoint is hit by any item whose key value matches the regex.
- regex = new RegExp(regex);
- let matchingItems = items.filter(ua => regex.test(ua[key]));
- let endpointsHitByItems = uniq(flatten(matchingItems.map(item => item.operation_ids)));
- return endpointsHitByItems.includes(endpoint.operation_id);
-};
-
-export const hitByMatchingTestTags = (tests, regex, endpoint) => {
- // given an array of tests, each containing an array of test_tags, and the regex to match.
- // filter tests by those with at least one tag that matches regex filter.
- // return true if endpoint is hit by any of these filtered tests.
- regex = new RegExp(regex);
- let matchingTests = tests.filter(test => test.test_tags.some((tag) => regex.test(tag)));
- let endpointsHitByTests = uniq(flatten(matchingTests.map(test => test.operation_ids)));
- return endpointsHitByTests.includes(endpoint.operation_id);
-};
-
-export const determineBucketAndJob = (bucketsAndJobs, bucketParam, jobParam) => {
- let bucket;
- let job;
- let buckets = groupBy(bucketsAndJobs, 'bucket');
- let bj = mapValues(buckets, (allJobs) => {
- let jobs = allJobs
- .sort((a,b) => new Date(b.job_timestamp) > new Date(a.job_timestamp))
- .map(j => ({job: j.job, timestamp: j.job_timestamp}));
- let [latestJob] = allJobs.map(j => ({job: j.job, timestamp: j.job_timestamp}));
- return {
- latestJob,
- jobs
- };
- });
-
- let releaseBlocking = 'ci-kubernetes-e2e-gci-gce';
- let defaultBucket = Object.keys(bj).includes(releaseBlocking)
- ? releaseBlocking
- : Object.keys(bj)[0];
- let defaultJob = bj[defaultBucket]['latestJob'].job;
-
- if (!bucketParam) {
- bucket = defaultBucket;
- job = defaultJob;
- } else if (bucketParam && !jobParam) {
- bucket = isValidBucket(bucketParam, bj)
- ? bucketParam
- : defaultBucket;
- job = bj[bucket]['latestJob'].job
- } else {
- bucket = isValidBucket(bucketParam, bj)
- ? bucketParam
- : defaultBucket;
- job = isValidJob(bj[bucket], jobParam)
- ? jobParam
- : bj[bucket]['latestJob'].job
- }
- return {
- bucket,
- job
- };
-}
-
-function isValidBucket (bucket, bjs) {
- return Object.keys(bjs).includes(bucket);
-}
-
-function isValidJob (bucket, job) {
- let jobs = bucket.jobs.map(job => job.job);
- return jobs.includes(job);
-}
diff --git a/apps/webapp/app/src.old/queries/index.js b/apps/webapp/app/src.old/queries/index.js
deleted file mode 100644
index 32e2320c0..000000000
--- a/apps/webapp/app/src.old/queries/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import { gql } from 'apollo-boost';
-export const ENDPOINTS_USERAGENTS_AND_TESTS = gql`
-query ENDPOINTS_TESTS_AND_USERAGENTS($bucket: String, $job: String) {
- endpoints: endpoint_coverage(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- operation_id
- level
- category
- conf_tested
- tested
- hit
- details {
- description
- path
- k8s_group
- k8s_kind
- }
- }
- tests(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- test
- test_tags
- operation_ids
- }
- useragents(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- useragent
- operation_ids
- }
-}
-`
-
-export const ENDPOINTS_TESTS_AND_USERAGENTS = gql`
-query ENDPOINTS_TESTS_AND_USERAGENTS($bucket: String, $job: String) {
- endpoints: endpoint_coverage(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- operation_id
- level
- category
- conf_tested
- tested
- hit
- details {
- description
- path
- k8s_group
- k8s_kind
- }
- }
- tests(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- test
- test_tags
- operation_ids
- }
- useragents(where: {bucket: {_eq: $bucket}, job: {_eq: $job}}) {
- useragent
- operation_ids
- }
-}
-`
-
-
-// All buckets and jobs available in db that are not 'live'
-export const ALL_BUCKETS_AND_JOBS_SANS_LIVE = gql`
-{
- bucket_job_swagger(where: {bucket: {_neq: "apisnoop"}}) {
- bucket
- job
- job_timestamp
- }
-}
-`;
-
-export const STABLE_ENDPOINT_STATS = gql`
-query STABLE_ENDPOINT_STATS {
- stable_endpoint_stats(where: {job: {_neq: "live"}}) {
- conf_hits
- date
- job
- percent_conf_tested
- percent_tested
- test_hits
- total_endpoints
- }
-}
-`;
diff --git a/apps/webapp/app/src.old/routes/_error.svelte b/apps/webapp/app/src.old/routes/_error.svelte
deleted file mode 100644
index 320e58702..000000000
--- a/apps/webapp/app/src.old/routes/_error.svelte
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
- {status}
-
-
-{status}
-
-{error.message}
-
-{#if dev && error.stack}
- {error.stack}
-{/if}
diff --git a/apps/webapp/app/src.old/routes/_layout.svelte b/apps/webapp/app/src.old/routes/_layout.svelte
deleted file mode 100644
index 4ce17a0d3..000000000
--- a/apps/webapp/app/src.old/routes/_layout.svelte
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/routes/about.svelte b/apps/webapp/app/src.old/routes/about.svelte
deleted file mode 100644
index e1734b3c4..000000000
--- a/apps/webapp/app/src.old/routes/about.svelte
+++ /dev/null
@@ -1,7 +0,0 @@
-
- About
-
-
-About this site
-
-This is the 'about' page. There's not much here.
\ No newline at end of file
diff --git a/apps/webapp/app/src.old/routes/coverage/[...coverage].json.js b/apps/webapp/app/src.old/routes/coverage/[...coverage].json.js
deleted file mode 100644
index e5b017ee8..000000000
--- a/apps/webapp/app/src.old/routes/coverage/[...coverage].json.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import client from "../../apollo.js";
-import { determineBucketAndJob } from '../../lib/helpers.js';
-import { ENDPOINTS_TESTS_AND_USERAGENTS, ALL_BUCKETS_AND_JOBS_SANS_LIVE} from '../../queries';
-
-export async function get (req, res, next) {
- let bucketAndJobsQuery = await client.query({query: ALL_BUCKETS_AND_JOBS_SANS_LIVE});
- let rawBucketsAndJobsPayload = bucketAndJobsQuery.data.bucket_job_swagger;
- let query = req.query;
- let [bucketParam, jobParam, level, category, operation_id] = req.params.coverage;
- let {bucket, job} = determineBucketAndJob(rawBucketsAndJobsPayload, bucketParam, jobParam);
- let endpointsTestsAndUseragentsFromQuery = await client.query(
- {query: ENDPOINTS_TESTS_AND_USERAGENTS,
- variables: {bucket, job}
- });
-
- let allTheThings = {
- bucket,
- bucketParam,
- category,
- endpointsTestsAndUseragentsFromQuery,
- job,
- jobParam,
- level,
- operation_id,
- query,
- rawBucketsAndJobsPayload
- };
-
- let payload = JSON.stringify(allTheThings);
-
- res.writeHead(200, {
- 'Content-Type': 'application/json' ,
- });
- res.end(payload);
-};
diff --git a/apps/webapp/app/src.old/routes/coverage/[...coverage].svelte b/apps/webapp/app/src.old/routes/coverage/[...coverage].svelte
deleted file mode 100644
index dd95648ef..000000000
--- a/apps/webapp/app/src.old/routes/coverage/[...coverage].svelte
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-{#if $warnings.invalidBucket}
- Note: Could not find data for {bucketParam}
. Displaying latest job for {bucket} instead.
-
-{/if}
-{#if !$warnings.invalidBucket && $warnings.invalidJob}
- Note: Could not find data for {jobParam}
. Displaying latest job for {bucket} instead.
-
-{/if}
-
diff --git a/apps/webapp/app/src.old/routes/coverage/index.svelte b/apps/webapp/app/src.old/routes/coverage/index.svelte
deleted file mode 100644
index f83720453..000000000
--- a/apps/webapp/app/src.old/routes/coverage/index.svelte
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
diff --git a/apps/webapp/app/src.old/routes/coverage/select.svelte b/apps/webapp/app/src.old/routes/coverage/select.svelte
deleted file mode 100644
index e21a9c097..000000000
--- a/apps/webapp/app/src.old/routes/coverage/select.svelte
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-{#if selectedBucket === ''}
-Select A Bucket:
-
-{#each Object.keys($bucketsAndJobs) as bucket}
- - selectedBucket = bucket}>{bucket}
-{/each}
-
-{:else}
- {#if selectedJob === ''}
- Select a Job:
- for {selectedBucket}
-
- {#each jobs as job}
- - jobClick(job)}>{jobDate(job.timestamp)}
- {/each}
-
- {:else}
-
-
loading {selectedBucket} on {jobDate(selectedJob.timestamp)}...
-
- {/if}
-{/if}
-
-
-
diff --git a/apps/webapp/app/src.old/routes/index.json.js b/apps/webapp/app/src.old/routes/index.json.js
deleted file mode 100644
index fcfc57d1e..000000000
--- a/apps/webapp/app/src.old/routes/index.json.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import client from "../apollo.js";
-import { determineBucketAndJob } from '../lib/helpers.js';
-import { ALL_BUCKETS_AND_JOBS_SANS_LIVE, STABLE_ENDPOINT_STATS } from '../queries';
-
-export async function get(req, res) {
- let bucketAndJobsQuery = await client.query({query: ALL_BUCKETS_AND_JOBS_SANS_LIVE});
- let statsQuery = await client.query({query: STABLE_ENDPOINT_STATS});
- let rawBucketsAndJobsPayload = bucketAndJobsQuery.data.bucket_job_swagger;
- let stableEndpointStatsPayload = statsQuery.data.stable_endpoint_stats;
- let statsAndBucketsAndJob = {stableEndpointStatsPayload, rawBucketsAndJobsPayload}
- const payload = JSON.stringify(statsAndBucketsAndJob);
-
- res.writeHead(200, {
- 'Content-Type': 'application/json'
- });
- res.end(payload);
-}
diff --git a/apps/webapp/app/src.old/routes/index.svelte b/apps/webapp/app/src.old/routes/index.svelte
deleted file mode 100644
index 3bfb4b488..000000000
--- a/apps/webapp/app/src.old/routes/index.svelte
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
- APISnoop
-
-
-
-
diff --git a/apps/webapp/app/src.old/server.js b/apps/webapp/app/src.old/server.js
deleted file mode 100644
index 6a4973c6b..000000000
--- a/apps/webapp/app/src.old/server.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import sirv from 'sirv';
-import polka from 'polka';
-import compression from 'compression';
-import * as sapper from '@sapper/server';
-
-const { PORT, NODE_ENV } = process.env;
-const dev = NODE_ENV === 'development';
-
-polka() // You can also use Express
- .use(
- compression({ threshold: 0 }),
- sirv('static', { dev }),
- sapper.middleware()
- )
- .listen(PORT, err => {
- if (err) console.log('error', err);
- });
diff --git a/apps/webapp/app/src.old/service-worker.js b/apps/webapp/app/src.old/service-worker.js
deleted file mode 100644
index 176d781c1..000000000
--- a/apps/webapp/app/src.old/service-worker.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import { timestamp, files, shell, routes } from '@sapper/service-worker';
-
-const ASSETS = `cache${timestamp}`;
-
-// `shell` is an array of all the files generated by the bundler,
-// `files` is an array of everything in the `static` directory
-const to_cache = shell.concat(files);
-const cached = new Set(to_cache);
-
-self.addEventListener('install', event => {
- event.waitUntil(
- caches
- .open(ASSETS)
- .then(cache => cache.addAll(to_cache))
- .then(() => {
- self.skipWaiting();
- })
- );
-});
-
-self.addEventListener('activate', event => {
- event.waitUntil(
- caches.keys().then(async keys => {
- // delete old caches
- for (const key of keys) {
- if (key !== ASSETS) await caches.delete(key);
- }
-
- self.clients.claim();
- })
- );
-});
-
-self.addEventListener('fetch', event => {
- if (event.request.method !== 'GET' || event.request.headers.has('range')) return;
-
- const url = new URL(event.request.url);
-
- // don't try to handle e.g. data: URIs
- if (!url.protocol.startsWith('http')) return;
-
- // ignore dev server requests
- if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
-
- // always serve static files and bundler-generated assets from cache
- if (url.host === self.location.host && cached.has(url.pathname)) {
- event.respondWith(caches.match(event.request));
- return;
- }
-
- // for pages, you might want to serve a shell `service-worker-index.html` file,
- // which Sapper has generated for you. It's not right for every
- // app, but if it's right for yours then uncomment this section
- /*
- if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) {
- event.respondWith(caches.match('/service-worker-index.html'));
- return;
- }
- */
-
- if (event.request.cache === 'only-if-cached') return;
-
- // for everything else, try the network first, falling back to
- // cache if the user is offline. (If the pages never change, you
- // might prefer a cache-first approach to a network-first one.)
- event.respondWith(
- caches
- .open(`offline${timestamp}`)
- .then(async cache => {
- try {
- const response = await fetch(event.request);
- cache.put(event.request, response.clone());
- return response;
- } catch(err) {
- const response = await cache.match(event.request);
- if (response) return response;
-
- throw err;
- }
- })
- );
-});
diff --git a/apps/webapp/app/src.old/stores/coverage-over-time.js b/apps/webapp/app/src.old/stores/coverage-over-time.js
deleted file mode 100644
index b2f8001ac..000000000
--- a/apps/webapp/app/src.old/stores/coverage-over-time.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import dayjs from 'dayjs';
-import { derived } from 'svelte/store';
-import {
- findKey,
- flatten,
- sortBy
-} from 'lodash-es';
-import {
- bucketsAndJobs,
- defaultBucketAndJob,
- stableEndpointStats
-} from './index.js';
-
-
-export const dates = derived(
- [bucketsAndJobs, defaultBucketAndJob],
- ([$bjs, $default], set) => {
- if ($bjs.length === 0) {
- set([])
- } else {
- // let bucket = $default.bucket;
- let buckets = Object.keys($bjs);
- let allJobs = buckets.reduce((acc, cur) => {
- let jobs = sortBy($bjs[cur]['jobs'], 'timestamp');
- return [...acc, ...jobs];
- }, []);
-
- allJobs = sortBy(allJobs,'timestamp');
- set(allJobs.map(job => job.timestamp));
- }
- }
-);
-
-export const coverage = derived(
- [defaultBucketAndJob, stableEndpointStats, bucketsAndJobs],
- ([$default, $stats, $bjs], set) => {
- if ($default.bucket === '') {
- set([]);
- } else {
- let coverageStats = $stats
- .filter(stat => stat.job !== 'live')
- .map(stat => {
- let bucket = findKey($bjs, (o) => o.jobs.map(job => job.job).includes(stat.job))
- console.log({bucket});
- return {
- ...stat,
- bucket,
- timestamp: dayjs(stat.date)
- };
- });
- coverageStats = sortBy(coverageStats, 'timestamp');
- set(coverageStats);
- }
- }
-);
-
-
diff --git a/apps/webapp/app/src.old/stores/index.js b/apps/webapp/app/src.old/stores/index.js
deleted file mode 100644
index 96cc49ce7..000000000
--- a/apps/webapp/app/src.old/stores/index.js
+++ /dev/null
@@ -1,404 +0,0 @@
-import { writable, derived } from 'svelte/store';
-import client from '../apollo.js';
-import {
- hitByMatchingItems,
- hitByMatchingTestTags,
- isValidRegex,
- toBoolean
-} from '../lib/helpers.js';
-
-import {
- compact,
- concat,
- isArray,
- isEmpty,
- flattenDeep,
- groupBy,
- intersection,
- keyBy,
- map,
- mapValues,
- orderBy,
- sortBy,
- take,
- uniq
-} from 'lodash-es';
-
-import {
- levelColours,
- categoryColours,
- endpointColour
-} from '../lib/colours.js';
-
-// Based on url query params, any filters being set.
-export const activeFilters = writable({
- test_tags: [],
- hide_tested: "false",
- hide_conf_tested: "false",
- hide_untested: "false",
- useragent: '',
- tests_match: '',
- test_tags_match: '',
- bucket: '',
- job: '',
- level: '',
- category: '',
- operation_id: ''
-})
-
-export const mouseOverPath = writable([]);
-export const stableEndpointStats = writable([]);
-
-export const breadcrumb = derived(
- [activeFilters, mouseOverPath],
- ([$active, $mouse], set) => {
- let mouseCrumbs = $mouse.map(m => m.data.name);
- let activeAndMouseCrumbs = compact(uniq([$active.level, $active.category, $active.operation_id, ...mouseCrumbs]));
- let crumbs = [];
- // if length is 4, it means we are zoomed into an endpoint, and hovering over a different endpoint.
- if (activeAndMouseCrumbs.length === 4) {
- // if that's the case, we want to show the one we are hovered on.
- crumbs = activeAndMouseCrumbs.filter(crumb => crumb !== $active.operation_id);
- } else {
- crumbs = take(compact(uniq([$active.level, $active.category, $active.operation_id, ...mouseCrumbs])), 3);
- }
- set(crumbs)
- }
-);
-
-export const warnings = writable({
- invalidBucket: false,
- invalidJob: false,
- invalidLevel: false,
- invalidCategory: false,
- invalidEndpoint: false
-})
-
-// Buckets and Jobs
-export const rawBucketsAndJobs = writable([]);
-
-export const bucketsAndJobs = derived(
- rawBucketsAndJobs,
- ($raw, set) => {
- if ($raw.length === 0) {
- set([]);
- } else {
- let buckets = groupBy($raw, 'bucket');
- let bjs = mapValues(buckets, (allJobs) => {
- let jobs = allJobs
- .sort((a,b) => new Date(b.job_timestamp) > new Date(a.job_timestamp))
- .map(j => ({
- job: j.job,
- timestamp: j.job_timestamp
- }));
-
- let [latestJob] = jobs;
-
- return {
- latestJob,
- jobs
- };
- });
- set(bjs);
- };
- }
-);
-
-export const defaultBucketAndJob = derived(
- bucketsAndJobs,
- ($bjs, set) => {
- if ($bjs.length === 0) {
- set({
- bucket: '',
- job: '',
- timestamp: ''
- });
- } else {
- let releaseBlocking = 'ci-kubernetes-e2e-gci-gce';
- let defaultBucket = Object.keys($bjs).includes(releaseBlocking)
- ? releaseBlocking
- : Object.keys($bjs)[0];
-
- set({
- bucket: defaultBucket,
- job: $bjs[defaultBucket].latestJob.job,
- timestamp: $bjs[defaultBucket].latestJob.job_timestamp
- });
- };
- }
-);
-
-export const activeBucketAndJob = derived(
- [activeFilters, defaultBucketAndJob, bucketsAndJobs],
- ([$filters, $default, $all], set) => {
- let base = {
- bucket: '',
- job: '',
- timestamp: ''
- };
- if ($default.bucket === '') {
- set({...base});
- } else if ($filters.bucket === '') {
- set({
- ...base,
- bucket: $default.bucket,
- job: $default.job,
- timestamp: $default.timestamp
- });
- } else {
- let timestamp = $all[$filters.bucket]['jobs'].find(job => job.job === $filters.job)['timestamp'];
- set({
- ...base,
- bucket: $filters.bucket,
- job: $filters.job,
- timestamp: timestamp
- });
- };
- });
-
-// All our data, for the active bucket and job.
-export const endpointsTestsAndUseragents = writable({endpoints: '', tests: '', useragents: ''});
-export const endpoints = derived(endpointsTestsAndUseragents, $etu => $etu.endpoints);
-export const allTestsAndTags = derived(endpointsTestsAndUseragents, $etu => $etu.tests);
-export const allUseragents = derived(endpointsTestsAndUseragents, $etu => $etu.useragents);
-// Based on the url params, the exact [level, category, endpoint] we are focused on.
-export const activePath = writable([]);
-
-export const opIDs = derived(endpoints, ($ep, set) => {
- if ($ep.length > 0) {
- set(keyBy($ep, 'operation_id'));
- } else {
- set([]);
- }
-});
-
-export const filteredEndpoints = derived(
- [activeFilters, endpoints, allUseragents, allTestsAndTags],
- ([$af, $ep, $ua, $tt], set) => {
- if ($ep.length === 0) {
- set([]);
- } else {
- let endpoints = $ep
- .filter(ep => toBoolean($af.hide_tested) ? (ep.tested === false || ep.conf_tested === true) : ep)
- .filter(ep => toBoolean($af.hide_conf_tested) ? ep.conf_tested === false : ep)
- .filter(ep => toBoolean($af.hide_untested) ? ep.tested === true : ep)
- .filter(ep => ($af.useragent.length > 0 && isValidRegex($af.useragent) && $ua)
- ? hitByMatchingItems($ua, 'useragent', $af.useragent, ep)
- : ep)
- .filter(ep => ($af.tests_match.length > 0 && isValidRegex($af.tests_match) && $tt)
- ? hitByMatchingItems($tt, 'test', $af.tests_match, ep)
- : ep)
- .filter(ep => ($af.test_tags_match.length > 0 && isValidRegex($af.test_tags_match) && $tt)
- ? hitByMatchingTestTags($tt, $af.test_tags_match, ep)
- : ep);
- set(endpoints)
- }
- });
-
-export const groupedEndpoints = derived(filteredEndpoints, ($ep, set) => {
- if ($ep.length > 0) {
- let endpointsByLevel = groupBy($ep, 'level')
- set(mapValues(endpointsByLevel, endpointsInLevel => {
- let endpointsByCategory = groupBy(endpointsInLevel, 'category')
- return mapValues(endpointsByCategory, endpointsInCategory => {
- return endpointsInCategory.map (endpoint => {
- return {
- ...endpoint,
- name: endpoint.operation_id,
- value: 1,
- color: endpointColour(endpoint)
- };
- });
- });
- }));
- } else {
- set({});
- }
-});
-
-
-export const sunburst = derived(groupedEndpoints, ($gep, set) => {
- if (!isEmpty($gep)) {
- var sunburst = {
- name: 'root',
- color: 'white',
- children: map($gep, (endpointsByCategoryAndOpID, level) => {
- return {
- name: level,
- color: levelColours[level] || levelColours['unused'],
- level: level,
- category: '',
- operation_id: '',
- children: map(endpointsByCategoryAndOpID, (endpointsByOpID, category) => {
- return {
- name: category,
- level: level,
- category: category,
- operation_id: '',
- color: categoryColours[category] || 'rgba(183, 28, 28, 1)', // basic color so things compile right.
- children: sortBy(endpointsByOpID, [
- (endpoint) => endpoint.testHits > 0,
- (endpoint) => endpoint.conformanceHits > 0
- ])
- };
- })
- };
- })
- };
- sunburst.children = orderBy(sunburst.children, 'name', 'desc');
- set(sunburst)
- } else {
- set({})
- }
-});
-
-export const zoomedSunburst = derived(
- [sunburst, activeFilters],
- ([$sunburst, $filters], set) => {
- let level = $filters.level;
- let category = $filters.category
- if (category) {
- let sunburstAtLevel = $sunburst.children.find(child => child.name === level);
- let sunburstAtCategory = sunburstAtLevel.children.find(child => child.name === category);
- set(sunburstAtCategory);
- } else if (!category && level) {
- let sunburstAtLevel = $sunburst.children.find(child => child.name === level);
- set(sunburstAtLevel);
- } else {
- set($sunburst)
- }
- })
-
-export const currentDepth = derived(breadcrumb, ($breadcrumb, set) => {
- let depths = ['root', 'level', 'category', 'endpoint']
- let depth = $breadcrumb.length;
- set(depths[depth])
-});
-
-export const coverageAtDepth = derived([breadcrumb, currentDepth, filteredEndpoints], ([$bc, $depth, $eps], set) => {
- let eps;
- if (isEmpty($eps)) {
- set({})
- return;
- } else if ($bc.length === 0) {
- eps = $eps;
- } else if ($bc.length === 1) {
- eps = $eps.filter(ep => ep.level === $bc[0])
- } else if ($bc.length === 2) {
- eps = $eps.filter(ep => ep.level === $bc[0] && ep.category === $bc[1])
- } else if ($bc.length === 3) {
- eps = $eps.filter(ep => ep.level === $bc[0] && ep.category === $bc[1] && ep.operation_id === $bc[2])
- } else {
- eps = $eps;
- }
- let totalEndpoints = eps.length;
- let testedEndpoints = eps.filter(ep => ep.tested).length;
- let confTestedEndpoints = eps.filter(ep => ep.conf_tested).length;
- set({
- totalEndpoints,
- testedEndpoints,
- confTestedEndpoints
- });
-});
-
-export const endpointCoverage = derived([breadcrumb, currentDepth, filteredEndpoints], ([$bc, $cd, $eps], set) => {
- let endpoint;
- let opId;
- let defaultCoverage = {
- tested: '',
- operation_id : '',
- confTested: '',
- description: '',
- path: '',
- group: '',
- version: '',
- kind: ''
- };
- if (isEmpty($eps) || $cd !== 'endpoint') {
- set(defaultCoverage);
- } else {
- opId = $bc[2]
- endpoint = $eps.find(ep => ep.operation_id === opId)
- let {
- tested,
- conf_tested: confTested,
- operation_id,
- details : {
- path,
- description,
- k8s_group: group,
- k8s_version: version,
- k8s_kind: kind
- }
- } = endpoint;
- set({
- tested,
- confTested,
- operation_id,
- path,
- description,
- group,
- version,
- kind
- });
- }
-});
-
-export const testsForEndpoint = derived(
- [allTestsAndTags, breadcrumb, currentDepth],
- ([$tt, $ap, $cd], set) => {
- if (isEmpty($tt) || $cd !== 'endpoint') {
- set([]);
- } else {
- let opID = $ap[2];
- let tests = $tt
- .filter(t => t.operation_ids.includes(opID))
- set(tests);
- }
- }
-);
-
-
-export const testTagsForEndpoint = derived(
- [allTestsAndTags, breadcrumb, currentDepth],
- ([$tt, $ap, $cd], set) => {
- if (isEmpty($tt) || $cd !== 'endpoint') {
- set([]);
- } else {
- let opID = $ap[2];
- let testTags = $tt
- .filter(t => t.operation_ids.includes(opID))
- .map(t => t.test_tags);
- let testTagsUniq = uniq(flattenDeep(testTags))
- set(testTagsUniq);
- }
- }
-);
-
-export const validTestTagFilters = derived(
- [activeFilters, testTagsForEndpoint],
- ([$af, $tt], set) => {
- if ($af.test_tags.length === 0 || $tt.length === 0) {
- set([]);
- } else {
- let validFilters = isArray($af.test_tags)
- ? $af.test_tags.filter(f => $tt.includes(f))
- : [$af.test_tags].filter(f => $tt.includes(f));
- set(validFilters);
- }
- });
-
-export const filteredTests = derived(
- [testsForEndpoint, validTestTagFilters],
- ([$t, $vf]) => {
- let tests;
- if ($vf.length === 0) {
- tests = $t;
- } else {
- tests = $t.filter(test => {
- return intersection(test.test_tags, $vf).length > 0;
- });
- }
- return tests;
- });
-
diff --git a/apps/webapp/app/src.old/template.html b/apps/webapp/app/src.old/template.html
deleted file mode 100644
index 9b2f74b6f..000000000
--- a/apps/webapp/app/src.old/template.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
- %sapper.base%
-
-
-
-
-
-
- %sapper.styles%
-
-
- %sapper.head%
-
-
-
- %sapper.html%
-
-
- %sapper.scripts%
-
-