From bc14e5824c9c2712bf7f7a6a16181889e29c5c4b Mon Sep 17 00:00:00 2001 From: peppa-bot Date: Fri, 27 Nov 2026 10:11:36 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D1=85=D0=BE=D0=B4=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D1=91=D0=BC=D0=BA=D0=B8=2027.11:=20=D1=81=D1=82=D1=8B?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=20=D0=BC=D0=B5=D0=B6=D0=B4=D1=83=20=D1=81=D0=BE=D0=B1=D0=BE?= =?UTF-8?q?=D0=B9=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Двадцать задач слиты одним заходом; три правила одной задачи ломались кодом другой: - PEP-273 × PEP-250, PEP-279: три новых файла веба брали `next/link` напрямую — переведены на `@/components/Link` (сторож no-prefetch.test.ts). - PEP-281 × PEP-272: адрес аватара в health-anon.test.ts и спеке web-auth — на git.vibe42.kz (сторож old-git-cleanup.test.ts не пускает старый адрес в репозиторий). - PEP-217 × PEP-281: в observe.db миграции стали подряд (web_vitals — версия 4, монитор «Интернет» — версия 5); тест PEP-281 возвращал файл «к версии 3» и повторял чужую миграцию. Версия берётся по самой миграции (`observeMigrationIndex`). Стыки, решённые при слиянии: страница /gitea и мок `/repos/search` (PEP-273 × PEP-280; после «Сделать закрытым» страница берёт свежий список мимо кэша), импорты (PEP-250 × PEP-302, PEP-279 × PEP-291, PEP-273 × PEP-304), память — файл на задачу по раскладке PEP-306. Co-Authored-By: Claude Fable 5.2 --- apps/web/app/(app)/connections/requests/[id]/page.tsx | 2 +- apps/web/app/(app)/dashboard/questions/page.tsx | 2 +- apps/web/components/AccessRequests.tsx | 2 +- openspec/specs/web-auth/spec.md | 4 ++-- packages/core/src/observe.ts | 3 +++ packages/testkit/test/health-anon.test.ts | 8 ++++---- packages/testkit/test/old-git-cleanup.test.ts | 3 ++- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/web/app/(app)/connections/requests/[id]/page.tsx b/apps/web/app/(app)/connections/requests/[id]/page.tsx index 508b5b1a..b32dfd22 100644 --- a/apps/web/app/(app)/connections/requests/[id]/page.tsx +++ b/apps/web/app/(app)/connections/requests/[id]/page.tsx @@ -1,4 +1,4 @@ -import Link from "next/link"; +import Link from "@/components/Link"; import { notFound } from "next/navigation"; import { ExternalLink, KeyRound } from "lucide-react"; import { accessRequestForUser, catalogService, connectionsForRequest, type AccessRequestView, type CatalogService, type ConnectionView } from "@peppa/core"; diff --git a/apps/web/app/(app)/dashboard/questions/page.tsx b/apps/web/app/(app)/dashboard/questions/page.tsx index 6bf0f155..12723d9b 100644 --- a/apps/web/app/(app)/dashboard/questions/page.tsx +++ b/apps/web/app/(app)/dashboard/questions/page.tsx @@ -1,4 +1,4 @@ -import Link from "next/link"; +import Link from "@/components/Link"; import { notFound } from "next/navigation"; import { MessageCircleQuestion } from "lucide-react"; import { isSuperadmin } from "@peppa/core"; diff --git a/apps/web/components/AccessRequests.tsx b/apps/web/components/AccessRequests.tsx index 42a4b817..5f81261a 100644 --- a/apps/web/components/AccessRequests.tsx +++ b/apps/web/components/AccessRequests.tsx @@ -1,4 +1,4 @@ -import Link from "next/link"; +import Link from "@/components/Link"; import { KeyRound } from "lucide-react"; import type { AccessRequestView } from "@peppa/core"; import type { Translator } from "@peppa/shared/i18n"; diff --git a/openspec/specs/web-auth/spec.md b/openspec/specs/web-auth/spec.md index e1741127..79d7c7ca 100644 --- a/openspec/specs/web-auth/spec.md +++ b/openspec/specs/web-auth/spec.md @@ -287,6 +287,6 @@ nonce, созданные сервером для этого потока; по | адрес | показ | |---|---| -| http://git.telecom.quest/avatars/1 | https://git.telecom.quest/avatars/1 | -| https://git.telecom.quest/avatars/1 | https://git.telecom.quest/avatars/1 | +| http://git.vibe42.kz/avatars/1 | https://git.vibe42.kz/avatars/1 | +| https://git.vibe42.kz/avatars/1 | https://git.vibe42.kz/avatars/1 | | javascript:alert(1) | нет картинки | diff --git a/packages/core/src/observe.ts b/packages/core/src/observe.ts index b80d2ac5..773cf6ed 100644 --- a/packages/core/src/observe.ts +++ b/packages/core/src/observe.ts @@ -262,6 +262,9 @@ export function observeDb(): DatabaseSync { } /** Tests: forget opened files. */ +/** Index of the migration whose SQL mentions `needle` (the `user_version` right before it); -1 — none. For tests that put a file back before one migration. */ +export const observeMigrationIndex = (needle: string): number => MIGRATIONS.findIndex((m) => m.some((sql) => sql.includes(needle))); + export function closeObserveDb(): void { for (const db of opened.values()) db.close(); opened.clear(); diff --git a/packages/testkit/test/health-anon.test.ts b/packages/testkit/test/health-anon.test.ts index 03694a0c..05d74a68 100644 --- a/packages/testkit/test/health-anon.test.ts +++ b/packages/testkit/test/health-anon.test.ts @@ -88,8 +88,8 @@ describe("PEP-272: ответы веба не раскрывают служеб }); for (const [url, shown] of [ - ["http://git.telecom.quest/avatars/1", "https://git.telecom.quest/avatars/1"], - ["https://git.telecom.quest/avatars/1", "https://git.telecom.quest/avatars/1"], + ["http://git.vibe42.kz/avatars/1", "https://git.vibe42.kz/avatars/1"], + ["https://git.vibe42.kz/avatars/1", "https://git.vibe42.kz/avatars/1"], ["javascript:alert(1)", null], ["", null], ] as const) { @@ -99,7 +99,7 @@ describe("PEP-272: ответы веба не раскрывают служеб } test("Аватар Gitea по http сохраняется как https", async () => { - const u = await core.upsertUserFromGitea(db, { id: 72001, login: "mock-avatar", avatar_url: "http://git.telecom.quest/avatars/7" }, { access_token: "x" }); - assert.equal(u.avatarUrl, "https://git.telecom.quest/avatars/7"); + const u = await core.upsertUserFromGitea(db, { id: 72001, login: "mock-avatar", avatar_url: "http://git.vibe42.kz/avatars/7" }, { access_token: "x" }); + assert.equal(u.avatarUrl, "https://git.vibe42.kz/avatars/7"); }); }); diff --git a/packages/testkit/test/old-git-cleanup.test.ts b/packages/testkit/test/old-git-cleanup.test.ts index 70899e5a..1dedf161 100644 --- a/packages/testkit/test/old-git-cleanup.test.ts +++ b/packages/testkit/test/old-git-cleanup.test.ts @@ -72,7 +72,8 @@ function oldMonitor(hosts: string[]): number { VALUES ('Интернет', 'internet', ?, 60, 5000, 3, 2, 'system', ?, ?, ?) RETURNING id`, ) .get(JSON.stringify({ hosts }), iso, iso, iso) as { id: number }; - raw.exec("PRAGMA user_version = 3"); + // The version right before the PEP-281 migration — other migrations (PEP-217: web_vitals) stay applied. + raw.exec(`PRAGMA user_version = ${core.observeMigrationIndex(OLD_HOST)}`); raw.close(); return row.id; }