Files
Claude 7195ad1914 infra: heavy CI gates on the beta candidate, bundle rebase script, gate:small
Validate ran three smoke shards, golden and performance_smoke on every push,
check-docs went red on any src/** change until screenshots were re-captured,
and a parallel bundle build made every second task branch fail to rebase.
None of these gates ever failed at review time; they fail before betas.

- `heavy` output in job `changes` (scripts/classify-changes.mjs): smoke,
  smoke_done, golden, performance_smoke run only for a head commit with a
  `Release:` trailer, `workflow_dispatch full=true` and pull requests.
- nightly.yml dispatches Validate on dev with full=true every night.
- check-docs `--screenshots=warn|strict`: freshness of the screenshot index
  warns on a plain push, errors on the candidate; everything else still errors.
- publish-prerelease.yml and release.yml refuse a candidate without the
  `Release:` trailer and (prerelease) require fresh screenshots — a green
  Validate without the heavy jobs cannot pass for a release.
- scripts/rebase-on-dev.mjs: rebase on origin/dev taking dev's copy of the
  committed bundle, rebuild with bundle:sync, amend; any other conflict aborts.
- npm run gate:small: mandatory PROCESS §8 part in one parallel run.

Issue: #479
User-Visible: no
2026-09-06 15:39:34 +03:00

29 lines
1.7 KiB
JavaScript

// Режим проверки свежести скриншотов документации (#479).
//
// Отпечаток скриншотов считается по всему `src/**`, поэтому любая правка
// фронтенда делает его устаревшим, а содержательно кадры меняются раз в
// несколько бет. Две проверки свежести — отпечаток и capture-скрипт — в режиме
// `warn` предупреждают, не роняя код выхода; всё остальное у `check-docs`
// (гайды, ссылки, хеши картинок, полнота набора сцен) красит в обоих режимах.
// Умолчание — `strict`: старый вызов без флага не ослабевает молча. `warn`
// включают preflight на обычном пуше; кандидат беты и релизный гейт — `strict`.
export const SCREENSHOT_MODES = ['warn', 'strict'];
export function screenshotsMode(argv) {
const flag = (argv || []).find((arg) => arg.startsWith('--screenshots='));
if (!flag) return 'strict';
const mode = flag.slice('--screenshots='.length);
if (!SCREENSHOT_MODES.includes(mode)) {
throw new Error(`--screenshots expects ${SCREENSHOT_MODES.join('|')}, got "${mode}"`);
}
return mode;
}
/** Куда класть находку свежести: в предупреждения (`warn`) или в ошибки. */
export function freshnessSink(mode, { errors, warnings }) {
if (mode === 'warn') return warnings;
if (mode === 'strict') return errors;
throw new Error(`unknown screenshots mode "${mode}"`);
}