chore!: remove JFrog integration (#17353)

- Removes displaying XRay scan results in the dashboard. I'm not sure
  anyone was even using this integration so it's just debt for us to
  maintain. We can open up a separate issue to get rid of the db tables
  once we know for sure that we haven't broken anyone.
This commit is contained in:
Jon Ayers
2025-04-11 14:45:21 -04:00
committed by GitHub
parent 15584e69ef
commit c06ef7c1eb
23 changed files with 2 additions and 1102 deletions
@@ -299,27 +299,6 @@ export const Deprecated: Story = {
},
};
export const WithXRayScan: Story = {
parameters: {
queries: [
{
key: [
"xray",
{ agentId: M.MockWorkspaceAgent.id, workspaceId: M.MockWorkspace.id },
],
data: {
workspace_id: M.MockWorkspace.id,
agent_id: M.MockWorkspaceAgent.id,
critical: 10,
high: 3,
medium: 5,
results_url: "http://localhost:8080",
},
},
],
},
};
export const HideApp: Story = {
args: {
agent: {
-9
View File
@@ -4,7 +4,6 @@ import Collapse from "@mui/material/Collapse";
import Divider from "@mui/material/Divider";
import Skeleton from "@mui/material/Skeleton";
import { API } from "api/api";
import { xrayScan } from "api/queries/integrations";
import type {
Template,
Workspace,
@@ -41,7 +40,6 @@ import { PortForwardButton } from "./PortForwardButton";
import { AgentSSHButton } from "./SSHButton/SSHButton";
import { TerminalLink } from "./TerminalLink/TerminalLink";
import { VSCodeDesktopButton } from "./VSCodeDesktopButton/VSCodeDesktopButton";
import { XRayScanAlert } from "./XRayScanAlert";
export interface AgentRowProps {
agent: WorkspaceAgent;
@@ -72,11 +70,6 @@ export const AgentRow: FC<AgentRowProps> = ({
storybookAgentMetadata,
sshPrefix,
}) => {
// XRay integration
const xrayScanQuery = useQuery(
xrayScan({ workspaceId: workspace.id, agentId: agent.id }),
);
// Apps visibility
const visibleApps = agent.apps.filter((app) => !app.hidden);
const hasAppsToDisplay = !hideVSCodeDesktopButton || visibleApps.length > 0;
@@ -227,8 +220,6 @@ export const AgentRow: FC<AgentRowProps> = ({
)}
</header>
{xrayScanQuery.data && <XRayScanAlert scan={xrayScanQuery.data} />}
<div css={styles.content}>
{agent.status === "connected" && (
<section css={styles.apps}>
@@ -1,108 +0,0 @@
import type { Interpolation, Theme } from "@emotion/react";
import type { JFrogXrayScan } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
import type { FC } from "react";
interface XRayScanAlertProps {
scan: JFrogXrayScan;
}
export const XRayScanAlert: FC<XRayScanAlertProps> = ({ scan }) => {
const display = scan.critical > 0 || scan.high > 0 || scan.medium > 0;
return display ? (
<div role="alert" css={styles.root}>
<ExternalImage
alt="JFrog logo"
src="/icon/jfrog.svg"
css={{ width: 40, height: 40 }}
/>
<div>
<span css={styles.title}>
JFrog Xray detected new vulnerabilities for this agent
</span>
<ul css={styles.issues}>
{scan.critical > 0 && (
<li css={[styles.critical, styles.issueItem]}>
{scan.critical} critical
</li>
)}
{scan.high > 0 && (
<li css={[styles.high, styles.issueItem]}>{scan.high} high</li>
)}
{scan.medium > 0 && (
<li css={[styles.medium, styles.issueItem]}>
{scan.medium} medium
</li>
)}
</ul>
</div>
<div css={styles.link}>
<Button size="sm" variant="subtle" asChild>
<a href={scan.results_url} target="_blank" rel="noreferrer">
Review results
</a>
</Button>
</div>
</div>
) : (
<></>
);
};
const styles = {
root: (theme) => ({
backgroundColor: theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
borderLeft: 0,
borderRight: 0,
fontSize: 14,
padding: "24px 16px 24px 32px",
lineHeight: "1.5",
display: "flex",
alignItems: "center",
gap: 24,
}),
title: {
display: "block",
fontWeight: 500,
},
issues: {
listStyle: "none",
margin: 0,
padding: 0,
fontSize: 13,
display: "flex",
alignItems: "center",
gap: 16,
marginTop: 4,
},
issueItem: {
display: "flex",
alignItems: "center",
gap: 8,
"&:before": {
content: '""',
display: "block",
width: 6,
height: 6,
borderRadius: "50%",
backgroundColor: "currentColor",
},
},
critical: (theme) => ({
color: theme.roles.error.fill.solid,
}),
high: (theme) => ({
color: theme.roles.warning.fill.solid,
}),
medium: (theme) => ({
color: theme.roles.notice.fill.solid,
}),
link: {
marginLeft: "auto",
alignSelf: "flex-start",
},
} satisfies Record<string, Interpolation<Theme>>;