From f7f6b368820563ac03b6c73b7c0f7f9eb49997df Mon Sep 17 00:00:00 2001 From: Zach Mandeville Date: Tue, 7 Apr 2020 15:22:23 +1200 Subject: [PATCH] remove older src as its moved to new src --- apps/webapp/app/src.old/apollo.js | 10 - apps/webapp/app/src.old/client.js | 5 - .../app/src.old/components/Breadcrumb.svelte | 40 -- .../components/CoverageContainer.svelte | 32 -- .../src.old/components/CoverageHeader.svelte | 42 -- .../components/CoverageOverTime.svelte | 188 -------- .../src.old/components/CoverageStats.svelte | 67 --- .../components/EndpointCoverageStats.svelte | 139 ------ .../app/src.old/components/Filters.svelte | 41 -- apps/webapp/app/src.old/components/Nav.svelte | 24 -- .../app/src.old/components/Sunburst.svelte | 222 ---------- .../src.old/components/TestTagsList.svelte | 41 -- .../app/src.old/components/TestsList.svelte | 95 ---- apps/webapp/app/src.old/lib/colours.js | 75 ---- apps/webapp/app/src.old/lib/helpers.js | 113 ----- apps/webapp/app/src.old/queries/index.js | 82 ---- apps/webapp/app/src.old/routes/_error.svelte | 40 -- apps/webapp/app/src.old/routes/_layout.svelte | 20 - apps/webapp/app/src.old/routes/about.svelte | 7 - .../routes/coverage/[...coverage].json.js | 35 -- .../routes/coverage/[...coverage].svelte | 64 --- .../app/src.old/routes/coverage/index.svelte | 32 -- .../app/src.old/routes/coverage/select.svelte | 103 ----- apps/webapp/app/src.old/routes/index.json.js | 17 - apps/webapp/app/src.old/routes/index.svelte | 41 -- apps/webapp/app/src.old/server.js | 17 - apps/webapp/app/src.old/service-worker.js | 82 ---- .../app/src.old/stores/coverage-over-time.js | 57 --- apps/webapp/app/src.old/stores/index.js | 404 ------------------ apps/webapp/app/src.old/template.html | 33 -- 30 files changed, 2168 deletions(-) delete mode 100644 apps/webapp/app/src.old/apollo.js delete mode 100644 apps/webapp/app/src.old/client.js delete mode 100644 apps/webapp/app/src.old/components/Breadcrumb.svelte delete mode 100644 apps/webapp/app/src.old/components/CoverageContainer.svelte delete mode 100644 apps/webapp/app/src.old/components/CoverageHeader.svelte delete mode 100644 apps/webapp/app/src.old/components/CoverageOverTime.svelte delete mode 100644 apps/webapp/app/src.old/components/CoverageStats.svelte delete mode 100644 apps/webapp/app/src.old/components/EndpointCoverageStats.svelte delete mode 100644 apps/webapp/app/src.old/components/Filters.svelte delete mode 100644 apps/webapp/app/src.old/components/Nav.svelte delete mode 100644 apps/webapp/app/src.old/components/Sunburst.svelte delete mode 100644 apps/webapp/app/src.old/components/TestTagsList.svelte delete mode 100644 apps/webapp/app/src.old/components/TestsList.svelte delete mode 100644 apps/webapp/app/src.old/lib/colours.js delete mode 100644 apps/webapp/app/src.old/lib/helpers.js delete mode 100644 apps/webapp/app/src.old/queries/index.js delete mode 100644 apps/webapp/app/src.old/routes/_error.svelte delete mode 100644 apps/webapp/app/src.old/routes/_layout.svelte delete mode 100644 apps/webapp/app/src.old/routes/about.svelte delete mode 100644 apps/webapp/app/src.old/routes/coverage/[...coverage].json.js delete mode 100644 apps/webapp/app/src.old/routes/coverage/[...coverage].svelte delete mode 100644 apps/webapp/app/src.old/routes/coverage/index.svelte delete mode 100644 apps/webapp/app/src.old/routes/coverage/select.svelte delete mode 100644 apps/webapp/app/src.old/routes/index.json.js delete mode 100644 apps/webapp/app/src.old/routes/index.svelte delete mode 100644 apps/webapp/app/src.old/server.js delete mode 100644 apps/webapp/app/src.old/service-worker.js delete mode 100644 apps/webapp/app/src.old/stores/coverage-over-time.js delete mode 100644 apps/webapp/app/src.old/stores/index.js delete mode 100644 apps/webapp/app/src.old/template.html 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 @@ - - - - - - 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

- -
- - - - {#each yTicks as tick} - - - {tick} {tick === 100 ? ' percent' : ''} - - {/each} - - - - {#each xTicks as tick} - - - {dayjs(tick).format('DD MMM, YY')} - - {/each} - - - - - - {#each $coverage as point} - { - prefetch(`coverage/ci-kubernetes-e2e-gci-gce/${point.job}`) - activeJob = point - }} - on:mouseleave={() => activeJob = {}} - on:click={() => goto(`coverage/${point.bucket}/${point.job}`)} - /> - { - prefetch(`coverage/ci-kubernetes-e2e-gci-gce/${point.job}`) - activeJob = point - }} - on:mouseleave={() => activeJob = {}} - on:click={() => goto(`coverage/${point.bucket}/${point.job}`)} - /> - {/each} - {#if !isEmpty(activeJob)} - - {dayjs(activeJob.date).format('DD MMM, YY')} - {activeJob.total_endpoints} stable endpoints - {activeJob.percent_tested}% tested - {activeJob.percent_conf_tested}% conformance tested - - {/if} - -
- - 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} -
- -

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 @@ - - -
- - - - {#each nodes as node} - mouseOver(node.current)} - style="cursor: pointer;" - on:click={()=> clicked(node)} /> - {/each} - - - {#each nodes as node} - - {node.children ? node.data.name : ''} - - {/each} - - - - 0 ? "translate(0, -15)" : ""} > - {$activeFilters.level} - - - {$activeFilters.category} - - - -
- - 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} -
-
    - {#each $testTagsForEndpoint as testTag} -
  • handleClick(testTag)}>{testTag}
  • - {/each} -
-
-{/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 @@ - - - - -