From be7d6b9706f045b289e1bee51c9317fe0b31e343 Mon Sep 17 00:00:00 2001 From: Matysh Date: Thu, 13 Aug 2026 21:05:17 +0300 Subject: [PATCH] fix: the review document is published even without a task branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issues labelled before the pipeline existed keep their spec straight in dev and have no issue/NN branch. The publish step quietly exited zero for them, so the verdict would arrive as a comment and the analysis behind it would be thrown away — the fifth instance today of a step reporting success by doing nothing. The document now goes wherever the spec itself lives: the task branch when there is one, dev otherwise. Publishing also survives dev moving on while the review ran, which takes up to forty-five minutes, by rebasing once before it gives up. Four issues are waiting on this — #12, #30, #44 and #52 — each with a spec in dev, a status label applied during the bulk pass in August and a review that never ran because nothing was there to raise the event. Issue: #114 User-Visible: no --- .github/workflows/process.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/process.yml b/.github/workflows/process.yml index 563aa9e3..b346a7c2 100644 --- a/.github/workflows/process.yml +++ b/.github/workflows/process.yml @@ -249,14 +249,21 @@ jobs: BRANCH: ${{ steps.branch.outputs.name }} NUM: ${{ github.event.issue.number }} run: | + # Ветки задачи может не быть: у задач, размеченных до появления + # конвейера, ТЗ лежит прямо в dev. Раньше шаг в этом случае молча + # выходил с нулём, и разбор ревью терялся — оставался только вердикт + # комментарием. Это тот же тихий отказ: шаг сообщал об успехе тем, что + # ничего не сделал. Документ ложится туда же, где лежит само ТЗ. + target="${BRANCH:-dev}" if [ -z "$BRANCH" ]; then - echo "ветки задачи нет — документ некуда класть"; exit 0 + echo "::warning::ветки задачи нет — документ ревью ляжет в dev" fi git checkout -- . 2>/dev/null || true git clean -fd -e docs/reviews -e node_modules >/dev/null 2>&1 || true git add docs/reviews 2>/dev/null || true if git diff --cached --quiet; then - echo "документ ревью не создан"; exit 0 + echo "::warning::документ ревью не создан" + exit 0 fi git -c user.name="claude[bot]" \ -c user.email="209825114+claude[bot]@users.noreply.github.com" \ @@ -266,9 +273,23 @@ jobs: Issue: #$NUM User-Visible: no EOF - git push -q "https://x-access-token:$TOKEN@github.com/${{ github.repository }}" \ - "HEAD:$BRANCH" - echo "документ опубликован в $BRANCH" + # Публикация в dev идёт из детачнутого состояния поверх ветки задачи + # либо dev, поэтому push нужен с явным перебазированием при гонке: + # dev мог уйти вперёд, пока шло ревью — оно длится до 45 минут. + if ! git push -q "https://x-access-token:$TOKEN@github.com/${{ github.repository }}" \ + "HEAD:$target"; then + git fetch -q origin "$target" + if ! git -c user.name="claude[bot]" \ + -c user.email="209825114+claude[bot]@users.noreply.github.com" \ + rebase "origin/$target"; then + git rebase --abort || true + echo "::error::документ ревью не удалось опубликовать в $target: конфликт" + exit 0 + fi + git push -q "https://x-access-token:$TOKEN@github.com/${{ github.repository }}" \ + "HEAD:$target" + fi + echo "документ опубликован в $target" - name: Решение по вердикту id: decide