From 78418f542e85ed8c0be9db8062430b6470116165 Mon Sep 17 00:00:00 2001 From: Zackary Santana <64446617+ZackarySantana@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:43:43 -0500 Subject: [PATCH 1/2] feat: add stepback sidebar information --- src/analytics/task/useTaskAnalytics.ts | 4 ++ src/gql/generated/types.ts | 16 +++++++ src/gql/queries/task.graphql | 6 +++ src/pages/task/metadata/index.tsx | 65 ++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) diff --git a/src/analytics/task/useTaskAnalytics.ts b/src/analytics/task/useTaskAnalytics.ts index dbb7057dd2..1d78d77f9b 100644 --- a/src/analytics/task/useTaskAnalytics.ts +++ b/src/analytics/task/useTaskAnalytics.ts @@ -70,6 +70,10 @@ type Action = } | { name: "Click Trace Link" } | { name: "Click Trace Metrics Link" } + | { name: "Click Last Passing Stepback Task Link" } + | { name: "Click Last Failing Stepback Task Link" } + | { name: "Click Previous Stepback Task Link" } + | { name: "Click Next Stepback Task Link" } | { name: "Submit Previous Commit Selector"; type: CommitType }; export const useTaskAnalytics = () => { diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 3af7bd17b3..ae8b0f91b9 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -2418,6 +2418,14 @@ export type StatusCount = { status: Scalars["String"]["output"]; }; +export type StepbackInfo = { + __typename?: "StepbackInfo"; + lastFailingStepbackTaskId?: Maybe; + lastPassingStepbackTaskId?: Maybe; + nextStepbackTaskId?: Maybe; + previousStepbackTaskId?: Maybe; +}; + export type Subscriber = { __typename?: "Subscriber"; emailSubscriber?: Maybe; @@ -2526,6 +2534,7 @@ export type Task = { spawnHostLink?: Maybe; startTime?: Maybe; status: Scalars["String"]["output"]; + stepbackInfo?: Maybe; /** @deprecated Use files instead */ taskFiles: TaskFiles; taskGroup?: Maybe; @@ -8562,6 +8571,13 @@ export type TaskQuery = { }; pod?: { __typename?: "Pod"; id: string } | null; project?: { __typename?: "Project"; id: string; identifier: string } | null; + stepbackInfo?: { + __typename?: "StepbackInfo"; + lastFailingStepbackTaskId?: string | null; + lastPassingStepbackTaskId?: string | null; + nextStepbackTaskId?: string | null; + previousStepbackTaskId?: string | null; + } | null; versionMetadata: { __typename?: "Version"; author: string; diff --git a/src/gql/queries/task.graphql b/src/gql/queries/task.graphql index 742884fa45..b2338dc62d 100644 --- a/src/gql/queries/task.graphql +++ b/src/gql/queries/task.graphql @@ -107,6 +107,12 @@ query Task($taskId: String!, $execution: Int) { resetWhenFinished spawnHostLink startTime + stepbackInfo { + lastFailingStepbackTaskId + lastPassingStepbackTaskId + nextStepbackTaskId + previousStepbackTaskId + } timeTaken totalTestCount versionMetadata { diff --git a/src/pages/task/metadata/index.tsx b/src/pages/task/metadata/index.tsx index 0843f9dcb0..f318da3162 100644 --- a/src/pages/task/metadata/index.tsx +++ b/src/pages/task/metadata/index.tsx @@ -79,6 +79,7 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { spawnHostLink, startTime, status, + stepbackInfo, timeTaken, versionMetadata, } = task || {}; @@ -403,6 +404,70 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { )} + {stepbackInfo?.lastPassingStepbackTaskId && ( + <> + + Last Passing Stepback Task:{" "} + + taskAnalytics.sendEvent({ + name: "Click Last Passing Stepback Task Link", + }) + } + > + {stepbackInfo.lastPassingStepbackTaskId} + + + + Last Failing Stepback Task:{" "} + + taskAnalytics.sendEvent({ + name: "Click Last Failing Stepback Task Link", + }) + } + > + {stepbackInfo.lastFailingStepbackTaskId} + + + + )} + {stepbackInfo?.previousStepbackTaskId && ( + + Previous Stepback Task:{" "} + + taskAnalytics.sendEvent({ + name: "Click Previous Stepback Task Link", + }) + } + > + {stepbackInfo.previousStepbackTaskId} + + + )} + {stepbackInfo?.nextStepbackTaskId && ( + + Next Stepback Task:{" "} + + taskAnalytics.sendEvent({ + name: "Click Next Stepback Task Link", + }) + } + > + {stepbackInfo.nextStepbackTaskId} + + + )} ); }; From cbbb343d2ce2892c56950bc29048929b54dbcfb8 Mon Sep 17 00:00:00 2001 From: Zackary Santana <64446617+ZackarySantana@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:35:10 -0500 Subject: [PATCH 2/2] fix: remove unused cypress tags --- src/pages/task/metadata/index.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pages/task/metadata/index.tsx b/src/pages/task/metadata/index.tsx index f318da3162..11e151533a 100644 --- a/src/pages/task/metadata/index.tsx +++ b/src/pages/task/metadata/index.tsx @@ -409,7 +409,6 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { Last Passing Stepback Task:{" "} taskAnalytics.sendEvent({ @@ -423,7 +422,6 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { Last Failing Stepback Task:{" "} taskAnalytics.sendEvent({ @@ -440,7 +438,6 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { Previous Stepback Task:{" "} taskAnalytics.sendEvent({ @@ -456,7 +453,6 @@ export const Metadata: React.FC = ({ error, loading, task, taskId }) => { Next Stepback Task:{" "} taskAnalytics.sendEvent({