Skip to content

fix(ci): stop status-sync from rewriting pull request heads - #427

Merged
Alexkkkkk merged 1 commit into
mainfrom
feat/issue-390-ci-benchmark-matrix
Nov 8, 2026
Merged

Alexkkkkk merged 1 commit into
mainfrom
feat/issue-390-ci-benchmark-matrix

Conversation

@Alexkkkkk

Copy link
Copy Markdown
Owner

Что сломано

status-sync.yml коммитил сгенерированные данные прямо в head каждого внутреннего PR с трейлером [skip ci]. Такой коммит не создаёт ни одного check run, поэтому обязательные проверки (quality-gate, dependency-review) на новой голове никогда не появляются, и PR становится невозможно смержить — при каждом push цикл повторяется.

Дополнительно generated-блок README содержал имя ветки (Source revision: \`), из-за чего данные были уникальны для каждой ветки: write-back гарантированно происходил на каждом ране, а после любого мержа в mainPR получали конфликт README. Сейчасmainссылается на уже удалённую веткуfeat/issue-390-ci-benchmark-matrix`, а #424 стоит именно на этом конфликте.

Изменения

.github/workflows/status-sync.yml

  • на pull_request_target и push в main workflow только перегенерирует canonical artifacts из trusted default branch и падает, если закоммиченные JSON расходятся с деревом PR, с точной командой починки;
  • никаких git commit / git push, permissions сужены до contents: read;
  • security-свойство сохранено: PR tree передаётся генераторам только как данные, Python-код из PR не исполняется;
  • расхождение generated README репортится как ::warning, а не как падение: блок информационный и выводится из версии.

scripts/generate_readme.py

  • из блока убран Source revision: \`и флаг--revision`: блок одинаков на всех ветках и не может конфликтовать.

docs/AUTOMATION.md — описан новый режим проверки и причина отказа от write-back.

Тесты — регрессия требует отсутствия git commit / git push / [skip ci] в workflow; отдельный тест фиксирует, что блок README не зависит от имени ветки.

Проверки

  • pytest -q tests: 2308 passed, 98 skipped (локально, Python 3.12);
  • ruff check . --select E9,F63,F7,F82 и --select B006,E722,S110,S112,F841: passed;
  • black --check . (24.4.2), isort --check-only . (5.13.2): passed;
  • actionlint 1.7.12 по всем workflow: без замечаний.

Что это разблокирует

После мержа head PR больше не переписывается, чеки доходят до головы, и #426 (его CI-Gate уже зелёный) проходит по требованиям ruleset. #425 остаётся красным по своей причине — там падает tests/test_sync_repository_status.py::test_sync_writes_all_canonical_status_artifacts (assert 'blocked' == 'pass'), это отдельный фикс.

Refs #390

status-sync committed generated data straight into the head of every
same-repository pull request with a skip-CI trailer. That commit never
produced a check run, so the required status checks (quality-gate,
dependency-review) were never reported on the new head and the pull
request could not be merged. Every push restarted the cycle.

The generated README block also embedded the source branch name, which
made the data different on every branch. That guaranteed the write-back
on each run and produced README conflicts between pull requests once
main moved.

- status-sync now regenerates the canonical artifacts from the trusted
  default branch and fails with the exact repair command when the
  committed files are stale; nothing is committed or pushed
- generated README block no longer contains a branch name, so it is
  identical on every branch and cannot conflict
- README staleness is reported as a warning instead of failing, because
  the block is informational and version-derived
- regression tests assert the workflow has no commit/push path

Co-authored-by: Manus <dev-agent@manus.ai>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Continuous integration tests labels Nov 8, 2026
@Alexkkkkk
Alexkkkkk merged commit 5d0d90b into main Nov 8, 2026
33 checks passed
@Alexkkkkk
Alexkkkkk deleted the feat/issue-390-ci-benchmark-matrix branch November 8, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant