diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23f4fee..c4733ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} @@ -32,7 +32,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' + cache: "npm" cache-dependency-path: orchestrator/package-lock.json - name: Install dependencies run: npm ci @@ -53,15 +53,23 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' + cache: "npm" cache-dependency-path: ${{ matrix.project }}/package-lock.json - - - name: Build ${{ matrix.project }} + + - name: Install dependencies run: | if [[ "${{ matrix.project }}" == extractors/* ]]; then npm ci --ignore-scripts else npm ci fi - npm run build + working-directory: ${{ matrix.project }} + + - name: Type Check (orchestrator only) + if: matrix.project == 'orchestrator' + run: npm run check:types + working-directory: ${{ matrix.project }} + + - name: Build ${{ matrix.project }} + run: npm run build working-directory: ${{ matrix.project }} diff --git a/orchestrator/package.json b/orchestrator/package.json index 5af6628..9a48c4b 100644 --- a/orchestrator/package.json +++ b/orchestrator/package.json @@ -11,6 +11,7 @@ "ci": "biome ci", "check": "biome check", "check:fix": "biome check --write", + "check:types": "tsc --noEmit", "format": "biome format", "format:fix": "biome format --write", "build": "npm run build:client && npm run build:server", diff --git a/orchestrator/src/client/pages/OrchestratorPage.tsx b/orchestrator/src/client/pages/OrchestratorPage.tsx index 988408c..d3079e0 100644 --- a/orchestrator/src/client/pages/OrchestratorPage.tsx +++ b/orchestrator/src/client/pages/OrchestratorPage.tsx @@ -348,7 +348,6 @@ export const OrchestratorPage: React.FC = () => { selectedJob={selectedJob} onSelectJobId={handleSelectJobId} onJobUpdated={loadJobs} - onSetActiveTab={setActiveTab} /> )} @@ -382,7 +381,6 @@ export const OrchestratorPage: React.FC = () => { selectedJob={selectedJob} onSelectJobId={handleSelectJobId} onJobUpdated={loadJobs} - onSetActiveTab={setActiveTab} /> diff --git a/orchestrator/src/client/pages/SettingsPage.test.tsx b/orchestrator/src/client/pages/SettingsPage.test.tsx index 402c425..154a395 100644 --- a/orchestrator/src/client/pages/SettingsPage.test.tsx +++ b/orchestrator/src/client/pages/SettingsPage.test.tsx @@ -109,6 +109,7 @@ const baseSettings: AppSettings = { ukvisajobsPasswordHint: null, webhookSecretHint: null, basicAuthActive: false, + rxresumeBaseResumeId: null, }; const renderPage = () => { diff --git a/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx b/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx index 9d056c7..a922cb9 100644 --- a/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx +++ b/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx @@ -163,7 +163,6 @@ describe("JobDetailPanel", () => { selectedJob={job} onSelectJobId={vi.fn()} onJobUpdated={vi.fn().mockResolvedValue(undefined)} - onSetActiveTab={vi.fn()} />, ); @@ -178,7 +177,6 @@ describe("JobDetailPanel", () => { selectedJob={null} onSelectJobId={vi.fn()} onJobUpdated={vi.fn().mockResolvedValue(undefined)} - onSetActiveTab={vi.fn()} />, ); @@ -195,7 +193,6 @@ describe("JobDetailPanel", () => { })} onSelectJobId={vi.fn()} onJobUpdated={vi.fn().mockResolvedValue(undefined)} - onSetActiveTab={vi.fn()} />, ); @@ -213,7 +210,6 @@ describe("JobDetailPanel", () => { selectedJob={createJob({ jobDescription: "Original" })} onSelectJobId={vi.fn()} onJobUpdated={onJobUpdated} - onSetActiveTab={vi.fn()} />, ); @@ -245,7 +241,6 @@ describe("JobDetailPanel", () => { selectedJob={createJob({ status: "ready" })} onSelectJobId={vi.fn()} onJobUpdated={onJobUpdated} - onSetActiveTab={vi.fn()} />, ); @@ -268,7 +263,6 @@ describe("JobDetailPanel", () => { selectedJob={createJob({ status: "ready" })} onSelectJobId={vi.fn()} onJobUpdated={onJobUpdated} - onSetActiveTab={vi.fn()} />, ); diff --git a/orchestrator/src/client/pages/orchestrator/OrchestratorFilters.test.tsx b/orchestrator/src/client/pages/orchestrator/OrchestratorFilters.test.tsx index db2f111..7a6e138 100644 --- a/orchestrator/src/client/pages/orchestrator/OrchestratorFilters.test.tsx +++ b/orchestrator/src/client/pages/orchestrator/OrchestratorFilters.test.tsx @@ -1,6 +1,7 @@ import { fireEvent, render, screen } from "@testing-library/react"; import type { ComponentProps } from "react"; import { describe, expect, it, vi } from "vitest"; +import type { JobSource } from "../../../shared/types"; import type { FilterTab, JobSort } from "./constants"; import { OrchestratorFilters } from "./OrchestratorFilters"; @@ -92,7 +93,7 @@ const renderFilters = ( onSearchQueryChange: vi.fn(), sourceFilter: "all" as const, onSourceFilterChange: vi.fn(), - sourcesWithJobs: ["gradcracker", "linkedin", "manual"], + sourcesWithJobs: ["gradcracker", "linkedin", "manual"] as JobSource[], sort: { key: "score", direction: "desc" } as JobSort, onSortChange: vi.fn(), ...overrides, diff --git a/orchestrator/src/client/pages/orchestrator/usePipelineSources.ts b/orchestrator/src/client/pages/orchestrator/usePipelineSources.ts index 2d01d3b..d35a7e2 100644 --- a/orchestrator/src/client/pages/orchestrator/usePipelineSources.ts +++ b/orchestrator/src/client/pages/orchestrator/usePipelineSources.ts @@ -7,9 +7,9 @@ import { PIPELINE_SOURCES_STORAGE_KEY, } from "./constants"; -const resolveAllowedSources = (enabledSources?: JobSource[]) => +const resolveAllowedSources = (enabledSources?: readonly JobSource[]) => enabledSources && enabledSources.length > 0 - ? enabledSources + ? (enabledSources as JobSource[]) : DEFAULT_PIPELINE_SOURCES; const normalizeSources = ( @@ -24,7 +24,7 @@ const sourcesMatch = (left: JobSource[], right: JobSource[]) => left.length === right.length && left.every((value, index) => value === right[index]); -export const usePipelineSources = (enabledSources?: JobSource[]) => { +export const usePipelineSources = (enabledSources?: readonly JobSource[]) => { const allowedSources = useMemo( () => resolveAllowedSources(enabledSources), [enabledSources], diff --git a/orchestrator/src/client/pages/settings/components/BaseResumeSelection.tsx b/orchestrator/src/client/pages/settings/components/BaseResumeSelection.tsx index 7949443..c4796d1 100644 --- a/orchestrator/src/client/pages/settings/components/BaseResumeSelection.tsx +++ b/orchestrator/src/client/pages/settings/components/BaseResumeSelection.tsx @@ -2,6 +2,14 @@ import * as api from "@client/api"; import { RefreshCw } from "lucide-react"; import type React from "react"; import { useCallback, useEffect, useState } from "react"; +import { Button } from "@/components/ui/button"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; type BaseResumeSelectionProps = { value: string | null; diff --git a/orchestrator/tsconfig.json b/orchestrator/tsconfig.json index 2f94da5..ac979f8 100644 --- a/orchestrator/tsconfig.json +++ b/orchestrator/tsconfig.json @@ -9,6 +9,7 @@ "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", + "types": ["vitest/globals", "@testing-library/jest-dom"], "baseUrl": ".", "paths": { "@/*": ["src/*"],