Skip to content

Commit b6db0b5

Browse files
sirozhaclaude
andcommitted
ci(webui): make all frontend CI checks blocking
Prettier / Lint / Test were `continue-on-error: true` (advisory — failures did not fail CI), the same gap that let type errors pile up. Now Prettier, Lint, Type check and Test all block the lint-and-test job (which runs on every branch push). Prerequisite: `prettier --write` on 5 pre-existing non-conformant files (pages/login.tsx, lib/report/report-pdf.tsx, 3 *.test.tsx) so the now-blocking Prettier check passes — pure formatting, no logic change. Install stays advisory (setup step); backend checks unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 52951ce commit b6db0b5

6 files changed

Lines changed: 64 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ jobs:
5959
- name: Frontend - Prettier
6060
working-directory: frontend
6161
run: pnpm run prettier
62-
continue-on-error: true
6362

6463
- name: Frontend - Lint
6564
working-directory: frontend
6665
run: pnpm run lint
67-
continue-on-error: true
6866

6967
- name: Frontend - Type check
7068
working-directory: frontend
@@ -73,7 +71,6 @@ jobs:
7371
- name: Frontend - Test
7472
working-directory: frontend
7573
run: pnpm run test
76-
continue-on-error: true
7774

7875
# Backend lint and test
7976
- name: Backend - Download dependencies

frontend/src/components/layouts/main-sidebar.test.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
44
import { describe, expect, it, vi } from 'vitest';
55

66
vi.mock('@/providers/user-provider', () => ({
7-
useUser: () => ({ authInfo: { user: { mail: 'me@example.com', name: 'Test User', type: 'local' } }, logout: vi.fn() }),
7+
useUser: () => ({
8+
authInfo: { user: { mail: 'me@example.com', name: 'Test User', type: 'local' } },
9+
logout: vi.fn(),
10+
}),
811
}));
912
vi.mock('@/hooks/use-theme', () => ({ useTheme: () => ({ setTheme: vi.fn(), theme: 'system' }) }));
1013
vi.mock('@/providers/favorites-provider', () => ({
@@ -32,9 +35,18 @@ function renderSidebar() {
3235
<MainSidebar />
3336
</SidebarProvider>
3437
<Routes>
35-
<Route element={<div>dashboard</div>} path="/dashboard" />
36-
<Route element={<FromProbe />} path="/settings" />
37-
<Route element={<FromProbe />} path="/settings/account" />
38+
<Route
39+
element={<div>dashboard</div>}
40+
path="/dashboard"
41+
/>
42+
<Route
43+
element={<FromProbe />}
44+
path="/settings"
45+
/>
46+
<Route
47+
element={<FromProbe />}
48+
path="/settings/account"
49+
/>
3850
</Routes>
3951
</MemoryRouter>,
4052
);

frontend/src/components/layouts/settings-layout.test.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ function renderAt(entry: { pathname: string; state?: unknown }) {
99
return render(
1010
<MemoryRouter initialEntries={[entry]}>
1111
<Routes>
12-
<Route element={<SettingsLayout />} path="/settings">
13-
<Route element={<div>account</div>} path="account" />
14-
<Route element={<div>providers</div>} path="providers" />
12+
<Route
13+
element={<SettingsLayout />}
14+
path="/settings"
15+
>
16+
<Route
17+
element={<div>account</div>}
18+
path="account"
19+
/>
20+
<Route
21+
element={<div>providers</div>}
22+
path="providers"
23+
/>
1524
</Route>
1625
</Routes>
1726
</MemoryRouter>,

frontend/src/components/ui/input-search.test.tsx

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,37 @@ describe('InputSearch — trailing clear button', () => {
141141
const queryClearButton = () => screen.queryByRole('button', { name: 'Clear search docs' });
142142

143143
it('does not render the clear button when the field is empty', () => {
144-
render(<SearchHost emitted={[]} initialQuery="" />, { wrapper: Wrapper });
144+
render(
145+
<SearchHost
146+
emitted={[]}
147+
initialQuery=""
148+
/>,
149+
{ wrapper: Wrapper },
150+
);
145151
expect(queryClearButton()).not.toBeInTheDocument();
146152
});
147153

148154
it('renders the clear button on mount when deep-linked with a non-empty query', () => {
149-
render(<SearchHost emitted={[]} initialQuery="jwt" />, { wrapper: Wrapper });
155+
render(
156+
<SearchHost
157+
emitted={[]}
158+
initialQuery="jwt"
159+
/>,
160+
{ wrapper: Wrapper },
161+
);
150162
expect(queryClearButton()).toBeInTheDocument();
151163
});
152164

153165
it('shows the clear button after typing, hides it once the field is empty again', async () => {
154166
const emitted: string[] = [];
155167
const user = userEvent.setup();
156-
render(<SearchHost emitted={emitted} initialQuery="" />, { wrapper: Wrapper });
168+
render(
169+
<SearchHost
170+
emitted={emitted}
171+
initialQuery=""
172+
/>,
173+
{ wrapper: Wrapper },
174+
);
157175

158176
await user.click(queryTrigger()!);
159177
expect(queryClearButton()).not.toBeInTheDocument();
@@ -168,7 +186,13 @@ describe('InputSearch — trailing clear button', () => {
168186
it('clears the value, emits "" upstream, and keeps focus on the input', async () => {
169187
const emitted: string[] = [];
170188
const user = userEvent.setup();
171-
render(<SearchHost emitted={emitted} initialQuery="jwt" />, { wrapper: Wrapper });
189+
render(
190+
<SearchHost
191+
emitted={emitted}
192+
initialQuery="jwt"
193+
/>,
194+
{ wrapper: Wrapper },
195+
);
172196

173197
const input = getInput();
174198
await user.click(queryClearButton()!);

frontend/src/lib/report/report-pdf.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { marked } from 'marked';
33

44
import { Log } from '@/lib/log';
55

6-
const CJK_RE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}\u3000-\u303f\uff00-\uffef]+/gu;
7-
const HAS_CJK_RE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}\u3000-\u303f\uff00-\uffef]/u;
6+
const CJK_RE =
7+
/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}\u3000-\u303f\uff00-\uffef]+/gu;
8+
const HAS_CJK_RE =
9+
/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}\u3000-\u303f\uff00-\uffef]/u;
810

911
let hasBaseFonts = false;
1012
let hasCJKFonts = false;

frontend/src/pages/login.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function Login() {
1313
const { authInfo, isLoading } = useUser();
1414
const authProviders = authInfo?.providers || [];
1515

16-
const returnUrl = getSafeReturnUrl((location.state?.from as string) || searchParams.get('returnUrl'), routes.newFlow);
16+
const returnUrl = getSafeReturnUrl(
17+
(location.state?.from as string) || searchParams.get('returnUrl'),
18+
routes.newFlow,
19+
);
1720

1821
return (
1922
<div className="flex h-dvh w-full items-center justify-center">

0 commit comments

Comments
 (0)