diff --git a/.github/workflows/warden.yml b/.github/workflows/warden.yml index b5c7579..4fc9904 100644 --- a/.github/workflows/warden.yml +++ b/.github/workflows/warden.yml @@ -16,4 +16,4 @@ jobs: - uses: actions/checkout@v4 - uses: getsentry/warden@v0 with: - anthropic-api-key: ${{ secrets.WARDEN_ANTHROPIC_API_KEY }} + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/warden.toml b/warden.toml index d992e84..3a5c0b3 100644 --- a/warden.toml +++ b/warden.toml @@ -1,8 +1,5 @@ version = 1 -[defaults.filters] -ignorePaths = ["docs/**", "**/*.md", "**/*.lock", "**/*.json"] - [[triggers]] name = "security-review" event = "pull_request" @@ -10,9 +7,6 @@ actions = ["opened", "synchronize", "reopened"] skill = "security-review" remote = "getsentry/skills" -[triggers.filters] -paths = ["src/**", "web/**", "mobile/**"] - [[triggers]] name = "react-best-practices" event = "pull_request" @@ -20,15 +14,9 @@ actions = ["opened", "synchronize", "reopened"] skill = "vercel-react-best-practices" remote = "vercel-labs/agent-skills" -[triggers.filters] -paths = ["**/*.tsx", "**/*.jsx"] - [[triggers]] name = "code-simplifier" event = "pull_request" actions = ["opened", "synchronize", "reopened"] skill = "code-simplifier" remote = "getsentry/skills" - -[triggers.filters] -paths = ["src/**", "web/**", "mobile/**"] diff --git a/web/src/pages/WorkspaceList.tsx b/web/src/pages/WorkspaceList.tsx index 68d74f4..d80bd04 100644 --- a/web/src/pages/WorkspaceList.tsx +++ b/web/src/pages/WorkspaceList.tsx @@ -1,5 +1,5 @@ -import { useState } from 'react' -import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' +import { useState, useEffect } from 'react' +import { useMutation, useQueryClient } from '@tanstack/react-query' import { useNavigate } from 'react-router-dom' import { Plus, RefreshCw, Boxes, ChevronRight, Sparkles, Monitor, AlertTriangle, Shield, Network } from 'lucide-react' import { api, type WorkspaceInfo, type CreateWorkspaceRequest, type HostInfo } from '@/lib/api' @@ -179,15 +179,30 @@ export function WorkspaceList() { const newNameError = trimmedNewName ? getUserWorkspaceNameError(trimmedNewName) : null const canCreate = trimmedNewName.length > 0 && !newNameError - const { data: workspaces, isLoading, error, refetch } = useQuery({ - queryKey: ['workspaces'], - queryFn: api.listWorkspaces, - }) + // BAD: useEffect + sequential awaits instead of parallel useQuery + const [workspaces, setWorkspaces] = useState(null) + const [hostInfo, setHostInfo] = useState(null) + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) - const { data: hostInfo } = useQuery({ - queryKey: ['hostInfo'], - queryFn: api.getHostInfo, - }) + useEffect(() => { + async function loadData() { + try { + // BAD: waterfall - these could run in parallel + const ws = await api.listWorkspaces() + setWorkspaces(ws) + const host = await api.getHostInfo() + setHostInfo(host) + } catch (e) { + setError(e as Error) + } finally { + setIsLoading(false) + } + } + loadData() + }, []) + + const refetch = () => window.location.reload() const createMutation = useMutation({ mutationFn: (data: CreateWorkspaceRequest) => api.createWorkspace(data), @@ -348,9 +363,9 @@ export function WorkspaceList() {
- {workspaces?.map((ws: WorkspaceInfo) => ( + {workspaces?.map((ws: WorkspaceInfo, i: number) => ( handleRowClick(ws)} />