Repository navigation
fix(ci): stop status-sync from rewriting pull request heads - #427
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сломано
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.ymlpull_request_targetиpushвmainworkflow только перегенерирует canonical artifacts из trusted default branch и падает, если закоммиченные JSON расходятся с деревом PR, с точной командой починки;git commit/git push,permissionsсужены доcontents: read;::warning, а не как падение: блок информационный и выводится из версии.scripts/generate_readme.pySource 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;actionlint1.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