From 3e06a8097d2fbb044d9ffa067f59987225ff2e1e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 11:44:05 +0900 Subject: [PATCH] =?UTF-8?q?ci(main):=20=EA=B0=99=EC=9D=80=20=ED=8A=B8?= =?UTF-8?q?=EB=A6=AC=EA=B1=B0=C2=B7=EB=B8=8C=EB=9E=9C=EC=B9=98=EC=9D=98=20?= =?UTF-8?q?=EC=83=88=20run=EC=9D=B4=20=EC=9D=B4=EC=A0=84=20run=EC=9D=84=20?= =?UTF-8?q?=EC=B7=A8=EC=86=8C=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: runner 한 대를 모든 repo가 같이 쓴다. main.yml은 cancel-in-progress가 false라서, 새 push가 와도 이전 push run이 끝까지 돌아 runner를 잡는다. 고른 방법: group을 트리거와 ref로 나누고(main--) cancel-in-progress를 켠다. push는 같은 브랜치의 이전 push run을, nightly는 이전 nightly를, 수동 실행은 같은 브랜치의 이전 수동 실행을 대기 중이든 실행 중이든 취소한다. 새 run이 이전 run이 볼 것을 다 본다. Gitea 1.27의 규칙(release/v1.27 models/actions/run.go CancelPreviousJobsByRunConcurrency): 새 run이 생기면 같은 group의 대기·Blocked job은 언제나 취소하고, cancel-in-progress가 true일 때만 실행 중인 job도 취소한다. 이 저장소 기록이 그대로다. run 79와 93의 Blocked performance job은 다음 run이 생긴 그 초에 취소됐고, PR run 97의 실행 중 job은 새 head가 들어오고 11초 뒤 runner 로그에 "Job cancelled"를 남기고 멈췄다. pr.yml은 이미 PR마다 group 하나다(pull_request run의 ref가 refs/pull/<번호>/head). 그 사실을 주석으로만 남긴다. 버린 대안: group을 브랜치 하나로 두기(main-). push가 돌고 있는 nightly를 취소한다. nightly에는 push run에 없는 job이 있다. pr.yml group 문자열을 github.event.pull_request.number로 바꾸기: 지금 대기 중인 run(124, PR 12·14의 107·115)이 다른 group에 남아 다음 push에 취소되지 않는다. 위험·한계: main에 연달아 병합하면 앞 병합만의 main 단계 결과는 남지 않는다. 뒤 run이 둘을 함께 본다. release.yml은 그대로 취소하지 않는다. 검증: 세 workflow를 YAML로 읽어 concurrency 값을 확인했다. 실제 취소 증거는 이 PR 본문에 run 번호로 적는다. --- .gitea/workflows/main.yml | 9 +++++++-- .gitea/workflows/pr.yml | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 4c48b774..5311e09a 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -29,9 +29,14 @@ on: permissions: contents: read +# One group per trigger and branch. A newer push cancels the older push run on the same branch, and a +# newer nightly the older nightly, queued or running: the newer run tests everything the older one +# would have, and the runner is shared. A push leaves a nightly alone (the nightly has jobs a push +# does not), and a manual run cancels only an older manual run on the same branch. Gitea cancels the +# queued and blocked runs of a group even without cancel-in-progress; with it, the running ones too. concurrency: - group: main-${{ github.ref }} - cancel-in-progress: false + group: main-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true env: # Reuse would hand one lane a container another lane had already faulted. diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 32d8ae8a..fa082b97 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -14,6 +14,9 @@ on: permissions: contents: read +# One group per pull request: the ref of a pull_request run is refs/pull//head. A push to the +# pull request cancels the run of the head it replaces, queued or running, so the one runner spends +# its slot on the head that can merge. concurrency: group: pr-${{ github.ref }} cancel-in-progress: true