From 7137f9c46e740d4fdc83539239f1548261abdae7 Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Tue, 1 Sep 2026 03:26:00 +0200 Subject: [PATCH] CI-02 probe D1: concurrency group kept, cancel-in-progress false, hold the slot --- .gitea/workflows/checks.yml | 82 +++++++++++-------------------------- 1 file changed, 24 insertions(+), 58 deletions(-) diff --git a/.gitea/workflows/checks.yml b/.gitea/workflows/checks.yml index ba9748e..d0f9284 100644 --- a/.gitea/workflows/checks.yml +++ b/.gitea/workflows/checks.yml @@ -1,15 +1,9 @@ -# CI-02 PROBE WORKFLOW - THROWAWAY. This branch is deleted after the run. -# -# It replaces the real gate with a set of one-bit steps, because this Gitea -# 404s its Actions log endpoints and the ONLY machine-readable channel out of a -# job is /api/v1/repos/.../actions/runs//jobs, which carries a per-STEP -# conclusion. So each question this ticket has to answer is asked as its own -# step, and the answer is read as that step's success or failure. -# -# There is deliberately NO `concurrency:` block: the point of pushes B and C is -# to find out whether a still-WAITING run is cancelled by the next push even -# when the workflow asks for no concurrency at all. If it is, the cancellation -# is the server's and no edit to this file can prevent it. +# CI-02 PROBE - THROWAWAY. Trial 2: CI-01's per-PR concurrency group kept, but +# cancel-in-progress FLIPPED TO false. Trial 1 (no block at all) left a queued +# run alive across two further pushes. This trial asks the narrower question the +# fix actually turns on: does the group ALONE kill a queued run, the way GitHub +# documents ("any previously pending job in the group will be cancelled"), or +# was cancel-in-progress: true the whole cause? name: checks on: @@ -17,6 +11,10 @@ on: branches: [release/1.0, master] workflow_dispatch: +concurrency: + group: addon-checks-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: false + jobs: unit: runs-on: [self-hosted, goodwe-rig] @@ -24,62 +22,36 @@ jobs: env: WS: /home/homelab/ci/ci02probe-${{ github.run_number }} PRNUM: ${{ github.event.pull_request.number }} - PRHEAD: ${{ github.event.pull_request.head.sha }} BASEREF: ${{ github.base_ref }} TOKEN: ${{ secrets.GITHUB_TOKEN }} URL: ${{ github.server_url }}/${{ github.repository }}.git steps: - - name: P00 an empty clone to ask the server questions from + - name: Q00 an empty clone run: | set -eu rm -rf "$WS" && mkdir -p "$WS" && cd "$WS" git init -q . git remote add origin "$(echo "$URL" | sed "s#://#://x-access-token:${TOKEN}@#")" - echo "GITHUB_REF=$GITHUB_REF" - echo "GITHUB_SHA=$GITHUB_SHA" - echo "PRNUM=$PRNUM PRHEAD=$PRHEAD BASEREF=$BASEREF" + echo "BASEREF=[$BASEREF] PRNUM=[$PRNUM]" - - name: P01 GITHUB_REF is refs-pull-N-head (the bare head) - if: always() - run: | - set -eu - test "$GITHUB_REF" = "refs/pull/$PRNUM/head" - - - name: P02 GITHUB_REF is refs-pull-N-merge (merged content) - if: always() - run: | - set -eu - test "$GITHUB_REF" = "refs/pull/$PRNUM/merge" - - - name: P03 GITHUB_SHA equals the PR head sha - if: always() - run: | - set -eu - test "$GITHUB_SHA" = "$PRHEAD" - - - name: P04 the first half of the shipped fallback fetches at all + - name: Q01 github.base_ref is populated and its branch fetches ALONE if: always() run: | set -eu cd "$WS" - git fetch -q --depth 1 origin "$GITHUB_REF" + test -n "$BASEREF" + git fetch -q origin "+refs/heads/$BASEREF:refs/remotes/origin/base" + git rev-parse refs/remotes/origin/base - - name: P05 ...and what it lands on IS the bare PR head + - name: Q02 the pull request head fetches ALONE if: always() run: | set -eu cd "$WS" - git fetch -q --depth 1 origin "$GITHUB_REF" - test "$(git rev-parse FETCH_HEAD)" = "$PRHEAD" + git fetch -q origin "+refs/pull/$PRNUM/head:refs/remotes/origin/pr" + git rev-parse refs/remotes/origin/pr - - name: P06 refs-pull-N-merge exists on the server for an OPEN pr - if: always() - run: | - set -eu - cd "$WS" - git fetch -q --depth 1 origin "refs/pull/$PRNUM/merge" - - - name: P07 a real merge of this head into the base tip applies cleanly + - name: Q03 and only THEN does the merge itself refuse if: always() run: | set -eu @@ -87,18 +59,12 @@ jobs: git fetch -q origin "+refs/heads/$BASEREF:refs/remotes/origin/base" git fetch -q origin "+refs/pull/$PRNUM/head:refs/remotes/origin/pr" git checkout -qf refs/remotes/origin/base - git -c user.email=ci@local -c user.name=ci merge --no-edit --no-ff refs/remotes/origin/pr + git -c user.email=ci@local -c user.name=ci merge --no-edit refs/remotes/origin/pr - - name: P08 the base tip is already an ancestor of the head + - name: Q09 hold the single runner slot if: always() - run: | - set -eu - cd "$WS" - git fetch -q origin "+refs/heads/$BASEREF:refs/remotes/origin/base" - git fetch -q origin "+refs/pull/$PRNUM/head:refs/remotes/origin/pr" - git merge-base --is-ancestor refs/remotes/origin/base refs/remotes/origin/pr + run: sleep 200 - - name: P99 clean up + - name: Q99 clean up if: always() run: rm -rf "$WS" || true -# probe C3 - a third push, to see whether the QUEUED run 561 survives it