Skip to content

Commit

Permalink
DEVPROD-1902 Don't fetch upstream project for inactive versions (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 authored May 8, 2024
1 parent 03f20fd commit 8d0eeac
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ interface FoldedCommitProps {
}) => void;
onClickJiraTicket?: () => void;
onClickGithash?: () => void;
onClickUpstreamProject?: () => void;
}
const FoldedCommit: React.FC<FoldedCommitProps> = ({
data,
index,
numVisibleCols,
onClickGithash,
onClickJiraTicket,
onClickUpstreamProject,
onToggleFoldedCommit = () => {},
selected,
}) => {
Expand All @@ -57,8 +55,6 @@ const FoldedCommit: React.FC<FoldedCommitProps> = ({
message={commit.message}
onClickGithash={onClickGithash}
onClickJiraTicket={onClickJiraTicket}
onClickUpstreamProject={onClickUpstreamProject}
upstreamProject={commit.upstreamProject}
versionId={commit.id}
/>
</LabelCellContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type BaseRowEventHandlers = {
onClickGithash: () => void;
onClickFoldedGithash: () => void;
onClickUpstreamProject: () => void;
onClickFoldedUpstreamProject: () => void;
onClickJiraTicket: () => void;
onClickFoldedJiraTicket: () => void;
onToggleFoldedCommit: (s: { isVisible: boolean }) => void;
Expand All @@ -36,7 +35,6 @@ const BaseRow: React.FC<RowProps> = ({
const {
onClickFoldedGithash,
onClickFoldedJiraTicket,
onClickFoldedUpstreamProject,
onClickGithash,
onClickJiraTicket,
onClickUpstreamProject,
Expand Down Expand Up @@ -91,7 +89,6 @@ const BaseRow: React.FC<RowProps> = ({
onToggleFoldedCommit({ isVisible: expanded });
toggleRowExpansion(rowIndex, expanded);
}}
onClickUpstreamProject={onClickFoldedUpstreamProject}
/>
);
default:
Expand Down
22 changes: 0 additions & 22 deletions apps/spruce/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6266,17 +6266,6 @@ export type MainlineCommitsForHistoryQuery = {
pusher: string;
tag: string;
}> | null;
upstreamProject?: {
__typename?: "UpstreamProject";
owner: string;
project: string;
repo: string;
revision: string;
triggerID: string;
triggerType: string;
task?: { __typename?: "Task"; execution: number; id: string } | null;
version?: { __typename?: "Version"; id: string } | null;
} | null;
}> | null;
version?: {
__typename?: "Version";
Expand Down Expand Up @@ -6344,17 +6333,6 @@ export type MainlineCommitsQuery = {
message: string;
order: number;
revision: string;
upstreamProject?: {
__typename?: "UpstreamProject";
owner: string;
project: string;
repo: string;
revision: string;
triggerID: string;
triggerType: string;
task?: { __typename?: "Task"; execution: number; id: string } | null;
version?: { __typename?: "Version"; id: string } | null;
} | null;
}> | null;
version?: {
__typename?: "Version";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ query MainlineCommitsForHistory(
message
order
revision
...UpstreamProject
}
version {
author
Expand Down
1 change: 0 additions & 1 deletion apps/spruce/src/gql/queries/mainline-commits.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ query MainlineCommits(
message
order
revision
...UpstreamProject
}
version {
author
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ const versions: CommitRolledUpVersions = [
author: "Mohamed Khelif",
revision: "4337c33fa4a0d5c747a1115f0853b5f70e46f112",
ignored: false,
upstreamProject: {
owner: "evergreen",
revision: "4337c33fa4a0d5c747a1115f0853b5f70e46f112",
triggerID: "123",
triggerType: "task",
repo: "evergreen-ci",
project: "spruce",
task: {
id: "123",
execution: 0,
},
},
},
{
id: "123",
Expand Down
19 changes: 1 addition & 18 deletions apps/spruce/src/pages/commits/InactiveCommits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useProjectHealthAnalytics } from "analytics/projectHealth/useProjectHea
import { DisplayModal } from "components/DisplayModal";
import Icon from "components/Icon";
import { StyledRouterLink } from "components/styles";
import { getVersionRoute, getTriggerRoute } from "constants/routes";
import { getVersionRoute } from "constants/routes";
import { size, zIndex, fontSize } from "constants/tokens";
import { useSpruceConfig, useDateFormat } from "hooks";
import { CommitRolledUpVersions } from "types/commits";
Expand Down Expand Up @@ -152,23 +152,6 @@ const CommitCopy: React.FC<CommitCopyProps> = ({ isTooltip, v }) => {
</StyledRouterLink>{" "}
{getDateCopy(v.createTime, { omitTimezone: true })}
</CommitTitleText>
{v.upstreamProject && (
<>
Triggered from:{" "}
<StyledRouterLink
to={getTriggerRoute({
upstreamOwner: v.upstreamProject.owner,
upstreamRepo: v.upstreamProject.repo,
triggerType: v.upstreamProject.triggerType,
upstreamRevision: v.upstreamProject.revision,
upstreamTask: v.upstreamProject.task,
upstreamVersion: v.upstreamProject.version,
})}
>
{v.upstreamProject.project}
</StyledRouterLink>
</>
)}
<CommitBodyText>
{v.ignored && <StyledIcon data-cy="ignored-icon" glyph="Ignored" />}
{v.author} -{" "}
Expand Down
7 changes: 0 additions & 7 deletions apps/spruce/src/pages/taskHistory/TaskHistoryRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ const TaskHistoryRow: React.FC<Props> = ({ data, index }) => {
commitType: "active",
});
},
onClickFoldedUpstreamProject: () => {
sendEvent({
name: "Click commit label",
link: "upstream project",
commitType: "inactive",
});
},
onClickJiraTicket: () => {
sendEvent({
name: "Click commit label",
Expand Down

0 comments on commit 8d0eeac

Please sign in to comment.