Заход приёмки 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:
parent
d2124d8008
commit
bc14e5824c
@ -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";
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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) | нет картинки |
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user