Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit a560d52

Browse files
authored
Merge branch 'main' into fix/remove-auto-append-functionality
2 parents 983aef1 + d8fc212 commit a560d52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1964
-1113
lines changed

.github/workflows/prettier.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Prettier Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
prettier-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "22"
21+
cache: "npm"
22+
23+
- name: Install Prettier
24+
run: npm install -g prettier
25+
26+
- name: Check Prettier formatting
27+
run: npm run format:check

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
python-version: "3.10"
2626

2727
- name: Create virtualenv
28-
run: uv venv --python 3.10 --seed
28+
run: uv venv --python 3.10 --seed --clear
2929

3030
- name: Install dependencies
3131
run: uv pip install -e .[dev]

frontend/package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@xterm/xterm": "^5.5.0",
2121
"axios": "^1.10.0",
2222
"lucide-react": "^0.525.0",
23+
"prettier": "^3.6.2",
2324
"react": "^19.1.0",
2425
"react-dom": "^19.1.0",
2526
"react-router-dom": "^7.7.0",
@@ -33,7 +34,9 @@
3334
"start": "vite",
3435
"dev": "vite",
3536
"build": "vite build",
36-
"preview": "vite preview"
37+
"preview": "vite preview",
38+
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
39+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
3740
},
3841
"proxy": "http://localhost:8000",
3942
"eslintConfig": {

frontend/src/App.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import App from './App';
1+
import React from "react";
2+
import { render, screen } from "@testing-library/react";
3+
import App from "./App";
44

5-
test('renders learn react link', () => {
5+
test("renders learn react link", () => {
66
render(<App />);
77
const linkElement = screen.getByText(/learn react/i);
88
expect(linkElement).toBeInTheDocument();

frontend/src/components/CLIAuthorizePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ const CLIAuthorizePage: React.FC = () => {
3737
buildApiUrl(`auth/cli/session/${sessionId}`),
3838
{
3939
credentials: "include",
40-
}
40+
},
4141
);
4242
console.log(`Response status: ${response.status}`);
4343

4444
if (!response.ok) {
4545
const errorText = await response.text();
4646
console.error(`Error response: ${errorText}`);
4747
throw new Error(
48-
`Session not found or expired: ${response.status} - ${errorText}`
48+
`Session not found or expired: ${response.status} - ${errorText}`,
4949
);
5050
}
5151

frontend/src/components/ClusterCard.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
8585
clusterType === "cloud" ? buildApiUrl("instances/status") : null,
8686
(url: string) =>
8787
apiFetch(url, { credentials: "include" }).then((res) => res.json()),
88-
{ refreshInterval: 2000 }
88+
{ refreshInterval: 2000 },
8989
);
9090

9191
// Process nodes based on cluster type
9292
let processedNodes = cluster.nodes;
9393
let activeCount = cluster.nodes.filter((n) => n.status === "active").length;
9494
let assignedToYouCount = cluster.nodes.filter(
95-
(n) => n.user === currentUser
95+
(n) => n.user === currentUser,
9696
).length;
9797

9898
if (clusterType === "cloud") {
@@ -104,7 +104,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
104104
ac.status === "ClusterStatus.UP" ||
105105
ac.status === "ClusterStatus.INIT" ||
106106
ac.status === "UP" ||
107-
ac.status === "INIT"
107+
ac.status === "INIT",
108108
) || false;
109109

110110
// Update the node status based on active clusters
@@ -116,7 +116,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
116116
ac.status === "ClusterStatus.UP" ||
117117
ac.status === "ClusterStatus.INIT" ||
118118
ac.status === "UP" ||
119-
ac.status === "INIT"
119+
ac.status === "INIT",
120120
);
121121

122122
return {
@@ -144,7 +144,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
144144
// For other cloud providers (RunPod, Azure), use the old SkyPilot status matching
145145
const skyPilotClusters = skyPilotStatus?.clusters || [];
146146
const skyPilotCluster = skyPilotClusters.find(
147-
(c: any) => c.cluster_name === displayName
147+
(c: any) => c.cluster_name === displayName,
148148
);
149149
const isActiveCluster =
150150
skyPilotCluster?.status === "ClusterStatus.UP" ||
@@ -168,7 +168,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
168168
}));
169169

170170
activeCount = processedNodes.filter(
171-
(n: Node) => n.status === "active"
171+
(n: Node) => n.status === "active",
172172
).length;
173173
assignedToYouCount = 0; // All nodes are available, none assigned
174174
}
@@ -177,7 +177,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
177177
const sortedNodes = [...processedNodes].sort(
178178
(a, b) =>
179179
getStatusOrder(a.status, a.type, a.user, currentUser) -
180-
getStatusOrder(b.status, b.type, b.user, currentUser)
180+
getStatusOrder(b.status, b.type, b.user, currentUser),
181181
);
182182

183183
const handleReserveNode = () => {
@@ -284,7 +284,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
284284

285285
// Helper to parse strings like "1 of 2 free"
286286
const parseUtilization = (
287-
s?: string
287+
s?: string,
288288
): { free?: number; total?: number } => {
289289
if (!s) return {};
290290
const m = s.match(/(\d+)\s*of\s*(\d+)/i);
@@ -302,18 +302,18 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
302302
const util = parseUtilization(e.utilization);
303303
const totalParsed = Number.parseInt(
304304
e.total ?? "",
305-
10
305+
10,
306306
);
307307
const freeParsed = Number.parseInt(
308308
e.free ?? "",
309-
10
309+
10,
310310
);
311311
const total = Number.isFinite(totalParsed)
312312
? totalParsed
313-
: util.total ?? 0;
313+
: (util.total ?? 0);
314314
const free = Number.isFinite(freeParsed)
315315
? freeParsed
316-
: util.free ?? 0;
316+
: (util.free ?? 0);
317317

318318
totalGpus += total;
319319
usedGpus += Math.max(0, total - free);
@@ -326,7 +326,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
326326
} else {
327327
// Fall back to capacity calculation for non-SSH clusters
328328
return Math.round(
329-
(activeCount / processedNodes.length) * 100
329+
(activeCount / processedNodes.length) * 100,
330330
);
331331
}
332332
})()}
@@ -389,7 +389,7 @@ const ClusterCard: React.FC<ClusterCardProps> = ({
389389
// For cloud and regular clusters, show in two columns
390390
["dedicated", "on-demand"].map((nodeType) => {
391391
const nodesOfType = nodesToShow.filter(
392-
(node) => node.type === nodeType
392+
(node) => node.type === nodeType,
393393
);
394394
if (nodesOfType.length === 0) return null;
395395

frontend/src/components/ClusterManagement.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const ClusterManagement: React.FC<ClusterManagementProps> = ({
4848
buildApiUrl("node-pools/ssh-node-pools"),
4949
{
5050
credentials: "include",
51-
}
51+
},
5252
);
5353
if (response.ok) {
5454
const data = await response.json();
@@ -70,7 +70,7 @@ const ClusterManagement: React.FC<ClusterManagementProps> = ({
7070
buildApiUrl(`node-pools/ssh-node-pools/${clusterName}`),
7171
{
7272
credentials: "include",
73-
}
73+
},
7474
);
7575
if (response.ok) {
7676
const data = await response.json();

frontend/src/components/NotificationSystem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({
4545

4646
const removeNotification = useCallback((id: string) => {
4747
setNotifications((prev) =>
48-
prev.filter((notification) => notification.id !== id)
48+
prev.filter((notification) => notification.id !== id),
4949
);
5050
}, []);
5151

@@ -67,7 +67,7 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({
6767
}, newNotification.duration);
6868
}
6969
},
70-
[removeNotification]
70+
[removeNotification],
7171
);
7272

7373
const getIcon = (type: Notification["type"]) => {
@@ -85,7 +85,7 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({
8585

8686
const contextValue = useMemo(
8787
() => ({ addNotification, removeNotification }),
88-
[addNotification, removeNotification]
88+
[addNotification, removeNotification],
8989
);
9090

9191
return (

frontend/src/components/SkyPilotClusterStatus.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const SkyPilotClusterStatus: React.FC = () => {
8585
const { data, isLoading, mutate } = useSWR(
8686
buildApiUrl("instances/status"),
8787
fetcher,
88-
{ refreshInterval: 2000 }
88+
{ refreshInterval: 2000 },
8989
);
9090

9191
const clusters = data?.clusters || [];
@@ -94,7 +94,7 @@ const SkyPilotClusterStatus: React.FC = () => {
9494
const { data: jobsData, mutate: mutateJobs } = useSWR(
9595
expandedCluster ? buildApiUrl(`jobs/${expandedCluster}`) : null,
9696
fetcher,
97-
{ refreshInterval: 5000 }
97+
{ refreshInterval: 5000 },
9898
);
9999

100100
// Fetch cluster type info for each cluster
@@ -109,7 +109,7 @@ const SkyPilotClusterStatus: React.FC = () => {
109109
try {
110110
const typeResponse = await apiFetch(
111111
buildApiUrl(`instances/cluster-type/${cluster.cluster_name}`),
112-
{ credentials: "include" }
112+
{ credentials: "include" },
113113
);
114114
if (typeResponse.ok) {
115115
const typeData: ClusterTypeInfo = await typeResponse.json();
@@ -118,7 +118,7 @@ const SkyPilotClusterStatus: React.FC = () => {
118118
} catch (err) {
119119
console.error(
120120
`Failed to fetch cluster type for ${cluster.cluster_name}:`,
121-
err
121+
err,
122122
);
123123
}
124124
return null;
@@ -169,7 +169,7 @@ const SkyPilotClusterStatus: React.FC = () => {
169169
try {
170170
const response = await apiFetch(
171171
buildApiUrl(`jobs/${clusterName}/${jobId}/logs?tail_lines=100`),
172-
{ credentials: "include" }
172+
{ credentials: "include" },
173173
);
174174
if (!response.ok) {
175175
throw new Error(`Failed to fetch logs: ${response.statusText}`);
@@ -178,7 +178,7 @@ const SkyPilotClusterStatus: React.FC = () => {
178178
setSelectedJobLogs(data.logs || "No logs available");
179179
} catch (err) {
180180
setSelectedJobLogs(
181-
err instanceof Error ? err.message : "Failed to fetch logs"
181+
err instanceof Error ? err.message : "Failed to fetch logs",
182182
);
183183
} finally {
184184
setLogsLoading(false);
@@ -195,7 +195,7 @@ const SkyPilotClusterStatus: React.FC = () => {
195195
{
196196
method: "POST",
197197
credentials: "include",
198-
}
198+
},
199199
);
200200
if (!response.ok) {
201201
throw new Error(`Failed to cancel job: ${response.statusText}`);
@@ -640,7 +640,7 @@ const SkyPilotClusterStatus: React.FC = () => {
640640
<Chip
641641
size="sm"
642642
color={getJobStatusColor(
643-
job.status
643+
job.status,
644644
)}
645645
variant="soft"
646646
>
@@ -713,7 +713,7 @@ const SkyPilotClusterStatus: React.FC = () => {
713713
onClick={() =>
714714
fetchJobLogs(
715715
cluster.cluster_name,
716-
job.job_id
716+
job.job_id,
717717
)
718718
}
719719
>
@@ -734,7 +734,7 @@ const SkyPilotClusterStatus: React.FC = () => {
734734
onClick={() =>
735735
cancelJob(
736736
cluster.cluster_name,
737-
job.job_id
737+
job.job_id,
738738
)
739739
}
740740
loading={
@@ -786,7 +786,7 @@ const SkyPilotClusterStatus: React.FC = () => {
786786
</Box>
787787
</ListItem>
788788
</React.Fragment>
789-
)
789+
),
790790
)
791791
)}
792792
</List>
@@ -818,7 +818,7 @@ const SkyPilotClusterStatus: React.FC = () => {
818818
isSshCluster={!!clusterTypes[jobModalCluster]?.is_ssh}
819819
availableResources={
820820
clusters.find(
821-
(c: ClusterStatus) => c.cluster_name === jobModalCluster
821+
(c: ClusterStatus) => c.cluster_name === jobModalCluster,
822822
)?.resources_str || ""
823823
}
824824
/>

0 commit comments

Comments
 (0)