4.1 KiB
Публикация после независимого ревью
Команды ниже предназначены для PowerShell в основном репозитории. Агент их здесь не выполнял: staging проверен только в отдельной временной Git-копии с core.autocrlf=true. PR №97 и удалённые репозитории не изменялись.
Set-Location -LiteralPath 'C:\dev\mtusi\lab2'
function Invoke-Git {
& git @args
if ($LASTEXITCODE -ne 0) { throw 'Git command failed; publication stopped.' }
}
$branch = Invoke-Git branch --show-current
if ($branch -ne 'solution/bvt2301-gamayunov') { throw 'Unexpected branch.' }
if (@(Invoke-Git diff --cached --name-only).Count -ne 0) {
throw 'Index already contains changes. Review them before selective staging.'
}
Invoke-Git status --short --branch
Invoke-Git -c core.autocrlf=true add -- .gitattributes .gitignore REPORT.md src/cache.py src/pagination.py src/store.py student-tests/grade5 evidence/grade5
Invoke-Git -c core.autocrlf=true add --chmod=+x -- scripts/init-env.sh scripts/restart.sh scripts/run-checks.sh
Invoke-Git -c 'core.whitespace=blank-at-eol,blank-at-eof,space-before-tab' diff --cached --check
$staged = @(Invoke-Git diff --cached --name-only)
$allowed = @('.gitattributes', '.gitignore', 'REPORT.md', 'src/cache.py', 'src/pagination.py', 'src/store.py', 'scripts/init-env.sh', 'scripts/restart.sh', 'scripts/run-checks.sh')
$unexpected = @($staged | Where-Object { $_ -notin $allowed -and $_ -notmatch '^(student-tests|evidence)/grade5/' })
$forbidden = @($staged | Where-Object { $_ -match '(^|/)(secrets|\.env(?:\.[^/]*)?|\.grade5-work|cache|volumes|PR_GRADE5_DRAFT\.md)(/|$)' -or ($_ -match '\.zip$' -and $_ -ne 'evidence/grade5/baseline-source.zip') })
if ($unexpected.Count -or $forbidden.Count) {
$unexpected; $forbidden
throw 'Unexpected staged files. Stop and inspect the index.'
}
$modes = @(Invoke-Git ls-files --stage -- scripts/init-env.sh scripts/restart.sh scripts/run-checks.sh)
if ($modes.Count -ne 3 -or @($modes | Where-Object { $_ -notmatch '^100755 ' }).Count) {
throw 'Expected three shell scripts with mode 100755.'
}
$staged
$modes
Invoke-Git diff --cached --stat
# Прочитать staged diff перед двумя следующими командами публикации.
Invoke-Git diff --cached -- REPORT.md src/cache.py src/pagination.py src/store.py
Invoke-Git commit -m 'ЛР 2: исследовать и ограничить cache stampede — на 5'
Invoke-Git push origin solution/bvt2301-gamayunov
Не использовать git add . или git add --renormalize .: преподавательские файлы,
старые evidence и рабочие CRLF не относятся к этому изменению. Новый текстовый
набор evidence/grade5 имеет LF и не содержит trailing spaces/пустых строк в конце.
Raw сохранены побайтно (-text, без eol-преобразования, whitespace=cr-at-eol);
baseline-source.zip остаётся бинарным. Общие whitespace checks не отключаются.
PR_GRADE5_DRAFT.md — игнорируемый локальный текст для последующей ручной замены описания существующего PR №97, а не файл коммита. REPORT.md больше не ссылается на этот локальный draft. Удалённый PR обновляется отдельно после публикации; новый PR, force, rebase и изменение origin не нужны.
Результаты завершающей проверки: publication-audit.json и publication-checks.txt. review-inventory.json/review-archive.json описывают прежний review ZIP до этой публикационной полировки; changed-files.txt/git-final-status.txt также исторические. Актуальный состав staging записан в publication-audit.json. Старые файлы не являются manifest текущего коммита.