From 1704f164ab7817d790acb2b1ec6abbf59de86a3b Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 19 Oct 2023 13:39:17 -0400 Subject: [PATCH 01/13] EVG-20808 Add analytics events for task file link clicks. (#2110) --- src/analytics/task/useTaskAnalytics.ts | 15 ++++++------- .../FileTable/GroupedFileTable/index.tsx | 21 ++++++++++++++++--- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/analytics/task/useTaskAnalytics.ts b/src/analytics/task/useTaskAnalytics.ts index 0fd4867cdb..81c5e80ae8 100644 --- a/src/analytics/task/useTaskAnalytics.ts +++ b/src/analytics/task/useTaskAnalytics.ts @@ -1,5 +1,5 @@ import { useQuery } from "@apollo/client"; -import { useParams, useLocation } from "react-router-dom"; +import { useParams } from "react-router-dom"; import { useAnalyticsRoot } from "analytics/useAnalyticsRoot"; import { SaveSubscriptionForUserMutationVariables, @@ -9,11 +9,9 @@ import { TestSortCategory, } from "gql/generated/types"; import { TASK } from "gql/queries"; +import { useQueryParam } from "hooks/useQueryParam"; import { CommitType } from "pages/task/actionButtons/previousCommits/types"; import { RequiredQueryParams, LogTypes } from "types/task"; -import { queryString } from "utils"; - -const { parseQueryString } = queryString; type LogViewer = "raw" | "html" | "parsley" | "lobster"; type Action = @@ -61,16 +59,19 @@ type Action = | { name: "Click Display Task Link" } | { name: "Click Project Link" } | { name: "Click See History Button" } + | { + name: "Click Task File Link"; + parsleyAvailable: boolean; + fileName: string; + } | { name: "Click Trace Link" } | { name: "Click Trace Metrics Link" } | { name: "Submit Previous Commit Selector"; type: CommitType }; export const useTaskAnalytics = () => { const { id } = useParams<{ id: string }>(); - const location = useLocation(); - const parsed = parseQueryString(location.search); - const execution = Number(parsed[RequiredQueryParams.Execution]); + const [execution] = useQueryParam(RequiredQueryParams.Execution, 0); const { data: eventData } = useQuery(TASK, { variables: { taskId: id, execution }, fetchPolicy: "cache-first", diff --git a/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx b/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx index f747a33e92..cc14e980d0 100644 --- a/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx +++ b/src/pages/task/taskTabs/FileTable/GroupedFileTable/index.tsx @@ -1,7 +1,8 @@ -import { useRef } from "react"; +import { useMemo, useRef } from "react"; import styled from "@emotion/styled"; import { useLeafyGreenTable, LGColumnDef } from "@leafygreen-ui/table/new"; import { Subtitle } from "@leafygreen-ui/typography"; +import { useTaskAnalytics } from "analytics"; import { StyledLink } from "components/styles"; import { BaseTable } from "components/Table/BaseTable"; import { size } from "constants/tokens"; @@ -10,7 +11,9 @@ import { GroupedFiles } from "../types"; type GroupedFilesFile = Unpacked; -const columns: LGColumnDef[] = [ +const columns = ( + taskAnalytics: ReturnType +): LGColumnDef[] => [ { accessorKey: "name", header: "Name", @@ -21,6 +24,13 @@ const columns: LGColumnDef[] = [ href={value.row.original.link} data-cy="file-link" target="_blank" + onClick={() => { + taskAnalytics.sendEvent({ + name: "Click Task File Link", + parsleyAvailable: false, + fileName: value.getValue() as GroupedFilesFile["name"], + }); + }} > {value.getValue()} @@ -37,11 +47,16 @@ const GroupedFileTable: React.FC = ({ taskName, }) => { const tableContainerRef = useRef(null); + const taskAnalytics = useTaskAnalytics(); + const memoizedColumns = useMemo( + () => columns(taskAnalytics), + [taskAnalytics] + ); const table = useLeafyGreenTable({ containerRef: tableContainerRef, data: files, - columns, + columns: memoizedColumns, }); return ( From 798f49bff59b56c19b73ccfa9bf4ad6007b44bc9 Mon Sep 17 00:00:00 2001 From: bynn Date: Thu, 19 Oct 2023 14:22:49 -0400 Subject: [PATCH 02/13] v3.0.159 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a147f07ff5..16cee4698b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spruce", - "version": "3.0.158", + "version": "3.0.159", "private": true, "scripts": { "bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", From 26d091e7b93222990407d9c6c14a91d888c8bd7c Mon Sep 17 00:00:00 2001 From: Bynn Lee Date: Thu, 19 Oct 2023 16:10:33 -0400 Subject: [PATCH 03/13] EVG-21038 Update webhook disabled message to mention the GitHub app (#2112) --- .../tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx b/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx index 95880f41ee..696715a3ff 100644 --- a/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx +++ b/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx @@ -87,8 +87,9 @@ export const GithubCommitQueueTab: React.FC = ({ <> {!githubWebhooksEnabled && ( - GitHub features are disabled because webhooks are not enabled. - Webhooks are enabled after saving with a valid owner and repository. + GitHub features are disabled because the Evergreen GitHub App is not + installed on the saved owner/repo. Contact IT to install the App and + enable GitHub features. )} Date: Thu, 19 Oct 2023 17:31:06 -0400 Subject: [PATCH 04/13] EVG-21011: Remove BugSnag (#2107) --- .evergreen.yml | 2 - index.html | 3 +- package.json | 6 +- scripts/deploy/app-version.sh | 18 -- scripts/deploy/deploy.sh | 6 - scripts/deploy/upload-bugsnag-sourcemaps.js | 9 - scripts/setup-credentials.js | 1 - src/components/ErrorHandling/Bugsnag.tsx | 65 ------ .../ErrorHandling/ErrorBoundary.test.tsx | 6 +- .../ErrorHandling/ErrorBoundary.tsx | 20 +- .../ErrorHandling/initialize.test.ts | 39 ---- src/components/ErrorHandling/initialize.ts | 6 - src/components/HistoryTable/HistoryTable.tsx | 6 +- src/context/auth.tsx | 6 +- src/gql/GQLWrapper.tsx | 14 +- src/pages/taskHistory/index.tsx | 6 +- src/pages/variantHistory/index.tsx | 6 +- src/utils/environmentVariables.ts | 7 - src/utils/errorReporting.test.ts | 41 +--- src/utils/errorReporting.ts | 113 +++------- vite.config.ts | 1 + yarn.lock | 194 +----------------- 22 files changed, 71 insertions(+), 504 deletions(-) delete mode 100755 scripts/deploy/app-version.sh delete mode 100644 scripts/deploy/upload-bugsnag-sourcemaps.js delete mode 100644 src/components/ErrorHandling/Bugsnag.tsx diff --git a/.evergreen.yml b/.evergreen.yml index 020c49467f..15cd9c6e4f 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -391,7 +391,6 @@ functions: working_dir: spruce script: | echo "Generating .env-cmdrc.json" - REACT_APP_BUGSNAG_API_KEY=${REACT_APP_BUGSNAG_API_KEY} \ REACT_APP_SENTRY_AUTH_TOKEN=${REACT_APP_SENTRY_AUTH_TOKEN} \ REACT_APP_SENTRY_DSN=${REACT_APP_SENTRY_DSN} \ REACT_APP_NEW_RELIC_ACCOUNT_ID=${REACT_APP_NEW_RELIC_ACCOUNT_ID} \ @@ -420,7 +419,6 @@ functions: shell: bash script: | ${PREPARE_SHELL} - REACT_APP_BUGSNAG_API_KEY=${REACT_APP_BUGSNAG_API_KEY} \ BUCKET=${bucket} \ AWS_ACCESS_KEY_ID=${aws_key} \ AWS_SECRET_ACCESS_KEY=${aws_secret} \ diff --git a/index.html b/index.html index 3f1acf0f6b..fa387137ec 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,8 @@ - + +