From d1be6891b255017ec7656d7e1e20edbeb2bccbb6 Mon Sep 17 00:00:00 2001 From: Matysh Date: Thu, 13 Aug 2026 16:58:18 +0300 Subject: [PATCH] fix: a review run always moves the label, conflict or not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A green code review whose merge conflicted used to leave the label where it was. That is a dead end: the author waits for the label to change, so it polled thirty times and reported the limit as exhausted — on a task the reviewer had already passed. The verdict existed and nobody could act on it. The merge step no longer fails the job. It reports whether it merged, and a green review that did not merge sends the task back to S6-in-progress, because the work did return to the author — a rebase rather than a code fix, and the comment says so and says the verdict still stands. The invariant is now stronger and worth stating plainly: after a review run the label always changes. A pipeline whose state can stall silently is worse than one that reports the wrong state loudly. Issue: #114 User-Visible: no --- .github/workflows/process.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/process.yml b/.github/workflows/process.yml index 1f197671..00525e7d 100644 --- a/.github/workflows/process.yml +++ b/.github/workflows/process.yml @@ -283,8 +283,15 @@ jobs: echo "to=$to" >> "$GITHUB_OUTPUT" # S8-merged утверждает, что код в dev. Значит слияние обязано произойти - # ДО метки, иначе она врờt в промежутке. Конфликт — метка не двигается. + # ДО метки, иначе она врёт в промежутке. + # + # При конфликте шаг НЕ падает и метку не оставляет на месте. Первая + # редакция делала именно так, и это оказалось тупиком: автор ждёт смену + # метки, метка не менялась, и он тридцать раз опрашивал впустую, чтобы + # затем отчитаться «лимит исчерпан» — при зелёном вердикте. Инвариант + # теперь жёстче: ПОСЛЕ ПРОГОНА РЕВЬЮ МЕТКА МЕНЯЕТСЯ ВСЕГДА. - name: Слить ветку в dev + id: merge if: needs.guard.outputs.stage == 'code' && steps.decide.outputs.green == 'true' env: TOKEN: ${{ secrets.HP_PROCESS_TOKEN }} @@ -293,7 +300,9 @@ jobs: NUM: ${{ github.event.issue.number }} run: | if [ -z "$BRANCH" ]; then - echo "::error::ветки задачи нет — сливать нечего"; exit 1 + echo "::error::ветки задачи нет — сливать нечего" + echo "merged=false" >> "$GITHUB_OUTPUT" + exit 0 fi git fetch -q origin dev git checkout -q -B merge-into-dev "origin/$BRANCH" @@ -301,15 +310,24 @@ jobs: -c user.email="209825114+claude[bot]@users.noreply.github.com" \ rebase origin/dev; then git rebase --abort || true + echo "merged=false" >> "$GITHUB_OUTPUT" + echo "::warning::ветка $BRANCH не сливается в dev без конфликта" cat > /tmp/conflict.md <> "$GITHUB_OUTPUT" echo "слито в dev: $(git rev-parse --short HEAD)" - name: Переставить метку @@ -318,7 +336,9 @@ jobs: GH_TOKEN: ${{ secrets.HP_PROCESS_TOKEN }} NUM: ${{ github.event.issue.number }} FROM: ${{ steps.decide.outputs.from }} - TO: ${{ steps.decide.outputs.to }} + # Зелёное код-ревью без слияния ведёт не в S8-merged, а обратно к + # автору: метка утверждала бы, что код в dev, а его там нет. + TO: ${{ (needs.guard.outputs.stage == 'code' && steps.decide.outputs.green == 'true' && steps.merge.outputs.merged != 'true') && 'S6-in-progress' || steps.decide.outputs.to }} run: | gh issue edit "$NUM" --repo "${{ github.repository }}" \ --add-label "$TO" --remove-label "$FROM"