Заход приёмки 27.11: стыковка задач между собой [skip ci]

Двадцать задач слиты одним заходом; три правила одной задачи ломались кодом другой:

- 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 <noreply@anthropic.com>
This commit is contained in:
peppa-bot 2026-11-27 10:11:36 +05:00
parent d2124d8008
commit bc14e5824c
7 changed files with 14 additions and 10 deletions

View File

@ -1,4 +1,4 @@
import Link from "next/link"; import Link from "@/components/Link";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { ExternalLink, KeyRound } from "lucide-react"; import { ExternalLink, KeyRound } from "lucide-react";
import { accessRequestForUser, catalogService, connectionsForRequest, type AccessRequestView, type CatalogService, type ConnectionView } from "@peppa/core"; import { accessRequestForUser, catalogService, connectionsForRequest, type AccessRequestView, type CatalogService, type ConnectionView } from "@peppa/core";

View File

@ -1,4 +1,4 @@
import Link from "next/link"; import Link from "@/components/Link";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { MessageCircleQuestion } from "lucide-react"; import { MessageCircleQuestion } from "lucide-react";
import { isSuperadmin } from "@peppa/core"; import { isSuperadmin } from "@peppa/core";

View File

@ -1,4 +1,4 @@
import Link from "next/link"; import Link from "@/components/Link";
import { KeyRound } from "lucide-react"; import { KeyRound } from "lucide-react";
import type { AccessRequestView } from "@peppa/core"; import type { AccessRequestView } from "@peppa/core";
import type { Translator } from "@peppa/shared/i18n"; import type { Translator } from "@peppa/shared/i18n";

View File

@ -287,6 +287,6 @@ nonce, созданные сервером для этого потока; по
| адрес | показ | | адрес | показ |
|---|---| |---|---|
| http://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.telecom.quest/avatars/1 | https://git.telecom.quest/avatars/1 | | https://git.vibe42.kz/avatars/1 | https://git.vibe42.kz/avatars/1 |
| javascript:alert(1) | нет картинки | | javascript:alert(1) | нет картинки |

View File

@ -262,6 +262,9 @@ export function observeDb(): DatabaseSync {
} }
/** Tests: forget opened files. */ /** 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 { export function closeObserveDb(): void {
for (const db of opened.values()) db.close(); for (const db of opened.values()) db.close();
opened.clear(); opened.clear();

View File

@ -88,8 +88,8 @@ describe("PEP-272: ответы веба не раскрывают служеб
}); });
for (const [url, shown] of [ for (const [url, shown] of [
["http://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.telecom.quest/avatars/1", "https://git.telecom.quest/avatars/1"], ["https://git.vibe42.kz/avatars/1", "https://git.vibe42.kz/avatars/1"],
["javascript:alert(1)", null], ["javascript:alert(1)", null],
["", null], ["", null],
] as const) { ] as const) {
@ -99,7 +99,7 @@ describe("PEP-272: ответы веба не раскрывают служеб
} }
test("Аватар Gitea по http сохраняется как https", async () => { 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" }); 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.telecom.quest/avatars/7"); assert.equal(u.avatarUrl, "https://git.vibe42.kz/avatars/7");
}); });
}); });

View File

@ -72,7 +72,8 @@ function oldMonitor(hosts: string[]): number {
VALUES ('Интернет', 'internet', ?, 60, 5000, 3, 2, 'system', ?, ?, ?) RETURNING id`, VALUES ('Интернет', 'internet', ?, 60, 5000, 3, 2, 'system', ?, ?, ?) RETURNING id`,
) )
.get(JSON.stringify({ hosts }), iso, iso, iso) as { id: number }; .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(); raw.close();
return row.id; return row.id;
} }