Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
DEVPROD-2234: Use correct project for querying task history (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Nov 7, 2023
1 parent 6cb8930 commit 0a6ac96
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5304,6 +5304,7 @@ export type BaseVersionAndTaskQuery = {
displayName: string;
execution: number;
id: string;
projectIdentifier?: string | null;
baseTask?: {
__typename?: "Task";
execution: number;
Expand All @@ -5318,7 +5319,6 @@ export type BaseVersionAndTaskQuery = {
__typename?: "Version";
id: string;
order: number;
projectIdentifier: string;
} | null;
};
} | null;
Expand Down
2 changes: 1 addition & 1 deletion src/gql/queries/base-version-and-task.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ query BaseVersionAndTask($taskId: String!) {
displayName
execution
id
projectIdentifier
versionMetadata {
baseVersion {
id
order
projectIdentifier
}
id
isPatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ const getPatchTaskWithSuccessfulBaseTask: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: {
id: "baseVersion",
order: 3676,
projectIdentifier: "evergreen",
__typename: "Version",
},
isPatch: true,
Expand Down Expand Up @@ -245,11 +245,11 @@ const getPatchTaskWithRunningBaseTask: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: {
id: "baseVersion",
order: 3676,
projectIdentifier: "evergreen",
__typename: "Version",
},
isPatch: true,
Expand Down Expand Up @@ -285,11 +285,11 @@ const getPatchTaskWithFailingBaseTask: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: {
id: "baseVersion",
order: 3676,
projectIdentifier: "evergreen",
__typename: "Version",
},
isPatch: true,
Expand Down Expand Up @@ -325,6 +325,7 @@ const getPatchTaskWithNoBaseVersion: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: null,
id: "versionMetadataId",
Expand Down Expand Up @@ -460,11 +461,11 @@ const getPatchTaskWithNoBaseTask: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: {
id: "baseVersion",
order: 3676,
projectIdentifier: "evergreen",
__typename: "Version",
},
isPatch: true,
Expand Down Expand Up @@ -496,11 +497,11 @@ const getMainlineTaskWithBaseVersion: ApolloMock<
execution: 0,
displayName: "lint-agent",
buildVariant: "lint",
projectIdentifier: "evergreen",
versionMetadata: {
baseVersion: {
id: "baseVersion",
order: 3676,
projectIdentifier: "evergreen",
__typename: "Version",
},
isPatch: false,
Expand Down
13 changes: 9 additions & 4 deletions src/pages/task/actionButtons/previousCommits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ export const PreviousCommits: React.FC<PreviousCommitsProps> = ({ taskId }) => {
variables: { taskId },
});

const { baseTask, buildVariant, displayName, versionMetadata } =
taskData?.task ?? {};
const { order: skipOrderNumber, projectIdentifier } =
versionMetadata?.baseVersion ?? {};
const {
baseTask,
buildVariant,
displayName,
projectIdentifier,
versionMetadata,
} = taskData?.task ?? {};
const { order: skipOrderNumber } = versionMetadata?.baseVersion ?? {};

const bvOptionsBase = {
tasks: [applyStrictRegex(displayName)],
variants: [applyStrictRegex(buildVariant)],
Expand Down

0 comments on commit 0a6ac96

Please sign in to comment.