mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (isometric) (push) Failing after 2m0s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (large-house) (push) Failing after 1m47s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (overlay) (push) Failing after 1m52s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (plan-snap) (push) Failing after 1m45s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (space-default) (push) Failing after 1m47s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (space-glow) (push) Failing after 1m49s
Проверка (CI) / Классификация изменённых файлов (push) Successful in 21s
Проверка (CI) / HACS: валидация репозитория (push) Skipped
Проверка (CI) / Hassfest: манифест интеграции (push) Skipped
Проверка (CI) / Фронтенд: типы, юниты, мутанты, синхрон бандла (push) Skipped
Проверка (CI) / Переиспользование: это дерево уже проверено (push) Successful in 36s
Проверка (CI) / Смоки в браузере (шард 1 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 2 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 3 из 3) (push) Skipped
Проверка (CI) / Смоки: все шарды зелёные (push) Skipped
Проверка (CI) / Golden-кадры против принятых эталонов (push) Skipped
Проверка (CI) / Перф-смок: бюджет времени кадра (push) Skipped
Проверка (CI) / Бэкенд: pytest в Home Assistant (push) Skipped
Проверка (CI) / Предполётные проверки: документация, провенанс, процесс (push) Successful in 4m56s
Полные бенчмарки производительности / Бенчмарки рендера и геометрии (blend) (push) Failing after 21m0s
The immutable beta.2 candidate changed one version-bearing golden frame without the two baseline trailers. Its complete Linux Validate successor proved the exact baseline tree; record that one SHA as the only historical exception while preserving every other provenance check. Issue: #426 Release: v1.71.0 Baseline-Reviewed: https://github.com/Matysh/houseplan-card/actions/runs/33760450815 User-Visible: no
90 lines
3.9 KiB
JavaScript
90 lines
3.9 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
assertHookMode,
|
|
cleanedCommitMessage,
|
|
resolveValidationRange,
|
|
terminalTrailers,
|
|
validateHistoricalCommit,
|
|
validateCommitMessage,
|
|
} from '../scripts/validate-commit-provenance.mjs';
|
|
|
|
test('provenance accepts positive issues and one visibility trailer at the end', () => {
|
|
const message = `Fix relay\n\nIssue: #94\nIssue: #98\nUser-Visible: yes\n`;
|
|
assert.deepEqual(validateCommitMessage(message, [
|
|
'docs/CHANGELOG.md', 'docs/CHANGELOG.ru.md',
|
|
]), []);
|
|
assert.deepEqual(terminalTrailers(message).get('Issue'), ['#94', '#98']);
|
|
});
|
|
|
|
test('editor comments and scissors suffix do not hide terminal trailers', () => {
|
|
const message = `Fix relay\n\nIssue: #94\nUser-Visible: no\n# Please enter the commit message\n# On branch dev\n`;
|
|
assert.deepEqual(validateCommitMessage(message), []);
|
|
assert.equal(cleanedCommitMessage(`${message}# ------------------------ >8 ------------------------\nignored`)
|
|
.includes('ignored'), false);
|
|
});
|
|
|
|
test('user-visible provenance requires both localized changelogs', () => {
|
|
const message = 'Fix UI\n\nIssue: #94\nUser-Visible: yes';
|
|
assert.match(validateCommitMessage(message, [])[0], /CHANGELOG\.md/);
|
|
assert.deepEqual(validateCommitMessage(message, [
|
|
'docs/CHANGELOG.md', 'docs/CHANGELOG.ru.md',
|
|
]), []);
|
|
});
|
|
|
|
test('hook mode requires the executable index bit', () => {
|
|
assert.doesNotThrow(() => assertHookMode('100755 deadbeef 0\t.githooks/commit-msg'));
|
|
assert.throws(
|
|
() => assertHookMode('100644 deadbeef 0\t.githooks/commit-msg'),
|
|
/must be tracked as executable/,
|
|
);
|
|
});
|
|
|
|
test('validation range uses PR ancestry, push before and dev for a new issue branch', () => {
|
|
const calls = [];
|
|
const runner = (args) => {
|
|
calls.push(args);
|
|
return args[0] === 'merge-base' ? 'common-base' : 'exists';
|
|
};
|
|
assert.equal(resolveValidationRange({
|
|
eventName: 'pull_request', baseSha: 'base', headSha: 'head',
|
|
}, runner), 'common-base..head');
|
|
assert.deepEqual(calls.at(-1), ['merge-base', 'base', 'head']);
|
|
assert.equal(resolveValidationRange({
|
|
// GitHub's default branch is main, but House Plan issue branches start at
|
|
// dev. The all-zero first-push SHA must therefore compare with origin/dev.
|
|
eventName: 'push', beforeSha: '000000', headSha: 'head',
|
|
}, runner), 'common-base..head');
|
|
assert.deepEqual(calls.at(-1), ['merge-base', 'refs/remotes/origin/dev', 'head']);
|
|
assert.equal(resolveValidationRange({
|
|
eventName: 'push', beforeSha: 'before', headSha: 'head', developmentBranch: 'dev',
|
|
}, runner), 'common-base..head');
|
|
assert.deepEqual(calls.at(-1), ['merge-base', 'before', 'head']);
|
|
});
|
|
|
|
test('provenance ignores trailer-like prose and rejects zero or duplicate visibility', () => {
|
|
assert.notDeepEqual(validateCommitMessage('Issue: #12\n\nExplanation after it'), []);
|
|
assert.notDeepEqual(validateCommitMessage('Fix\n\nIssue: #0\nUser-Visible: no'), []);
|
|
assert.notDeepEqual(validateCommitMessage(
|
|
'Fix\n\nIssue: #12\nUser-Visible: no\nUser-Visible: yes',
|
|
), []);
|
|
});
|
|
|
|
test('golden files require exact release-review provenance', () => {
|
|
const changed = ['demo/golden/baselines/example.png'];
|
|
const base = 'Update baseline\n\nIssue: #75\nUser-Visible: no';
|
|
assert.equal(validateCommitMessage(base, changed).length, 2);
|
|
assert.deepEqual(validateCommitMessage(
|
|
`${base}\nRelease: v1.2.3-beta.1\nBaseline-Reviewed: https://example.test/run`, changed,
|
|
), []);
|
|
});
|
|
|
|
test('the audited beta.2 baseline exception is exact and golden-only', () => {
|
|
const changed = ['demo/golden/baselines/example.png'];
|
|
const message = 'Update baseline\n\nIssue: #426\nUser-Visible: no';
|
|
const audited = 'd4dd027b0a27c3c290195cb0e504b1a44c4c2611';
|
|
assert.deepEqual(validateHistoricalCommit(audited, message, changed), []);
|
|
assert.equal(validateHistoricalCommit(`${audited.slice(0, -1)}2`, message, changed).length, 2);
|
|
assert.match(validateHistoricalCommit(audited, 'Update baseline', changed)[0], /Issue/);
|
|
});
|