Skip to content

Commit

Permalink
DEVPROD-4095: Remove links to legacy job logs page (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Jun 28, 2024
1 parent 6ef9294 commit 92881df
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 68 deletions.
10 changes: 0 additions & 10 deletions apps/parsley/cypress/integration/external_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ describe("External Links", () => {
);
});

it("should render a link to the legacy logkeeper log viewer in the secondary menu", () => {
cy.dataCy("legacy-job-logs-button").should("not.exist");
cy.dataCy("secondary-links-button").click();
cy.dataCy("legacy-job-logs-button").should("be.visible");
cy.dataCy("legacy-job-logs-button").should(
"have.attr",
"href",
"http://localhost:8080/build/7e208050e166b1a9025c817b67eee48d",
);
});
it("should render links to the log files", () => {
cy.dataCy("raw-log-button").should("be.visible");
cy.dataCy("raw-log-button").should("not.be.disabled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { FilterLogic, WordWrapFormat } from "constants/enums";
type Action =
| { name: "Opened Task Link" }
| { name: "Opened Job Logs" }
| { name: "Opened Legacy Job Logs" }
| { name: "Opened Raw Logs" }
| { name: "Opened HTML Logs" }
| { name: "Clicked Copy To Jira" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState } from "react";
import Button from "@leafygreen-ui/button";
import { Menu, MenuItem } from "@leafygreen-ui/menu";
import Tooltip from "@leafygreen-ui/tooltip";
import { usePreferencesAnalytics } from "analytics";
import Icon from "components/Icon";
Expand All @@ -18,8 +17,7 @@ const ButtonRow: React.FC = () => {
const [hasCopied, setHasCopied] = useState(false);
const [bookmarks] = useQueryParam<number[]>(QueryParams.Bookmarks, []);

const { htmlLogURL, jobLogsURL, legacyJobLogsURL, rawLogURL } =
logMetadata || {};
const { htmlLogURL, jobLogsURL, rawLogURL } = logMetadata || {};
const tooltipText = bookmarks.length
? "Copy bookmarked lines in JIRA format"
: "No bookmarks to copy.";
Expand Down Expand Up @@ -106,28 +104,6 @@ const ButtonRow: React.FC = () => {
>
Open log in standard HTML format in a new tab
</Tooltip>
{legacyJobLogsURL && (
<Menu
trigger={
<Button
data-cy="secondary-links-button"
leftGlyph={<Icon glyph="Ellipsis" />}
/>
}
>
<MenuItem
as="a"
data-cy="legacy-job-logs-button"
disabled={!legacyJobLogsURL}
glyph={<Icon glyph="Export" />}
href={legacyJobLogsURL}
onClick={() => sendEvent({ name: "Opened Legacy Job Logs" })}
target="_blank"
>
Legacy job logs
</MenuItem>
</Menu>
)}
</DetailRow>
);
};
Expand Down
16 changes: 2 additions & 14 deletions apps/parsley/src/constants/externalURLTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
evergreenURL,
logkeeperURL,
spruceURL,
} from "utils/environmentVariables";
import { evergreenURL, spruceURL } from "utils/environmentVariables";
import { stringifyQuery } from "utils/query-string";

const getEvergreenTaskURL = (taskID: string, execution: string | number) => {
Expand All @@ -23,12 +19,4 @@ const getEvergreenJobLogsURL = (
groupID: string,
) => `${spruceURL}/job-logs/${taskID}/${execution}/${groupID}`;

const getLegacyJobLogsURL = (buildID: string) =>
`${logkeeperURL}/build/${buildID}`;

export {
getEvergreenTaskURL,
getLogkeeperJobLogsURL,
getLegacyJobLogsURL,
getEvergreenJobLogsURL,
};
export { getEvergreenTaskURL, getLogkeeperJobLogsURL, getEvergreenJobLogsURL };
1 change: 0 additions & 1 deletion apps/parsley/src/context/LogContext/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ interface LogMetadata {
groupID?: string;
htmlLogURL?: string;
jobLogsURL?: string;
legacyJobLogsURL?: string;
logType?: LogTypes;
origin?: string;
rawLogURL?: string;
Expand Down
3 changes: 0 additions & 3 deletions apps/parsley/src/pages/LogView/LoadingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const LoadingPage: React.FC<LoadingPageProps> = ({ logType }) => {
failingCommand,
htmlLogURL,
jobLogsURL,
legacyJobLogsURL,
loading: isLoadingEvergreen,
rawLogURL,
renderingType,
Expand Down Expand Up @@ -81,7 +80,6 @@ const LoadingPage: React.FC<LoadingPageProps> = ({ logType }) => {
groupID,
htmlLogURL,
jobLogsURL,
legacyJobLogsURL,
logType,
origin,
rawLogURL,
Expand All @@ -106,7 +104,6 @@ const LoadingPage: React.FC<LoadingPageProps> = ({ logType }) => {
ingestLines,
isLoadingLogkeeperMetadata,
jobLogsURL,
legacyJobLogsURL,
logkeeperMetadata?.execution,
logkeeperMetadata?.task_id,
logType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ describe("useResolveLogURLAndRenderingType", () => {
downloadURL: "",
htmlLogURL: "",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: true,
rawLogURL: "",
});
Expand All @@ -228,7 +227,6 @@ describe("useResolveLogURLAndRenderingType", () => {
downloadURL: "rawURL",
htmlLogURL: "htmlURL",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: false,
rawLogURL: "rawURL",
});
Expand Down Expand Up @@ -265,7 +263,6 @@ describe("useResolveLogURLAndRenderingType", () => {
downloadURL: "",
htmlLogURL: "",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: true,
rawLogURL: "",
});
Expand All @@ -274,7 +271,6 @@ describe("useResolveLogURLAndRenderingType", () => {
downloadURL: "agent-link.com?priority=true&text=true&type=E",
htmlLogURL: "agent-link.com?text=false&type=E",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: false,
rawLogURL: "agent-link.com?text=true&type=E",
});
Expand Down Expand Up @@ -310,7 +306,6 @@ describe("useResolveLogURLAndRenderingType", () => {
htmlLogURL:
"http://test-evergreen.com/test_log/a-task-id/0?test_name=a-test-name-that-doesnt-exist&text=false",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: false,
rawLogURL:
"http://test-evergreen.com/test_log/a-task-id/0?test_name=a-test-name-that-doesnt-exist&text=true",
Expand Down Expand Up @@ -346,7 +341,6 @@ describe("useResolveLogURLAndRenderingType", () => {
"http://test-evergreen.com/task_file_raw/a-task-id/0/a-file-name",
htmlLogURL: "",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: false,
rawLogURL: "a-file-url",
});
Expand Down Expand Up @@ -381,7 +375,6 @@ describe("useResolveLogURLAndRenderingType", () => {
"http://test-evergreen.com/task_file_raw/a-task-id/0/a%20file%20name.some%2Fcrazy%2Fpath",
htmlLogURL: "",
jobLogsURL: "",
legacyJobLogsURL: "",
loading: false,
rawLogURL: "a-file-url-with-crazy-path",
});
Expand Down Expand Up @@ -413,7 +406,6 @@ describe("useResolveLogURLAndRenderingType", () => {
"http://test-evergreen.com/rest/v2/tasks/a-task-id/build/TestLogs/job0?execution=0",
htmlLogURL: "",
jobLogsURL: "http://test-spruce.com/job-logs/a-task-id/0/job0",
legacyJobLogsURL: "",
loading: false,
rawLogURL:
"http://test-evergreen.com/rest/v2/tasks/a-task-id/build/TestLogs/job0?execution=0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useQuery } from "@apollo/client";
import { LogRenderingTypes, LogTypes } from "constants/enums";
import {
getEvergreenJobLogsURL,
getLegacyJobLogsURL,
getLogkeeperJobLogsURL,
} from "constants/externalURLTemplates";
import {
Expand Down Expand Up @@ -42,8 +41,6 @@ type HookResult = {
htmlLogURL: string;
/** The URL of the RESMOKE logs job logs page in Spruce */
jobLogsURL: string;
/** The URL of the RESMOKE logs job logs page in logkeeper */
legacyJobLogsURL: string;
/** The URL of the log file without any processing */
rawLogURL: string;
/** Whether the hook is actively making an network request or not */
Expand Down Expand Up @@ -117,7 +114,6 @@ export const useResolveLogURLAndRenderingType = ({
let rawLogURL = "";
let htmlLogURL = "";
let jobLogsURL = "";
let legacyJobLogsURL = "";
let renderingType: LogRenderingTypes = LogRenderingTypes.Default;
let failingCommand = "";
switch (logType) {
Expand All @@ -131,7 +127,6 @@ export const useResolveLogURLAndRenderingType = ({
}
if (buildID) {
jobLogsURL = getLogkeeperJobLogsURL(buildID);
legacyJobLogsURL = getLegacyJobLogsURL(buildID);
}
downloadURL = rawLogURL;
renderingType = LogRenderingTypes.Resmoke;
Expand Down Expand Up @@ -253,7 +248,6 @@ export const useResolveLogURLAndRenderingType = ({
failingCommand,
htmlLogURL,
jobLogsURL,
legacyJobLogsURL,
loading: isLoadingTest || isLoadingTask || isLoadingTaskFileData,
rawLogURL,
renderingType,
Expand Down

0 comments on commit 92881df

Please sign in to comment.