fix(ci): 调度优化+auto-approve/merge SHA修复(解决PR无法自动合并的根因) #475

Closed
xiaoxia wants to merge 21 commits from ci/fix-scheduling-label-mismatch into develop
Owner

修复内容(4个bug一锅端)

1. 轻量任务调度瓶颈(ci-l1 → ci-check)

ci-l1只有4个runner,轻量任务+auto-approve+auto-merge都抢这4个,堵死了。把ci-cd.yml的3个轻量job(Check/Validate/Frontend Lint)从ci-l1改成ci-check(12个runner都有)。

2. auto-approve.yml runner标签(ci-l1 → ci-check)

auto-approve也用ci-l1,排队等不到runner,永远打不了审批。

3. auto-approve CI状态查询SHA错误(核心bug)

pull_request事件的GITHUB_SHA是merge commit的虚拟SHA,但CI实际运行的是head SHA。用merge SHA查status永远查不到,一直pending,20分钟超时后默默退出,永远打不了审批。
改用 github.event.pull_request.head.sha 查询。

4. auto-merge.yml 同样的SHA错误

auto-merge也有同样的bug,一起修了。

影响

  • 死锁解除:auto-approve/merge不再跟CI任务抢runner
  • 自动合并恢复:SHA对了才能正确检测CI全绿
  • 12个runner全可用,资源利用率从33%→接近100%
## 修复内容(4个bug一锅端) ### 1. 轻量任务调度瓶颈(ci-l1 → ci-check) ci-l1只有4个runner,轻量任务+auto-approve+auto-merge都抢这4个,堵死了。把ci-cd.yml的3个轻量job(Check/Validate/Frontend Lint)从ci-l1改成ci-check(12个runner都有)。 ### 2. auto-approve.yml runner标签(ci-l1 → ci-check) auto-approve也用ci-l1,排队等不到runner,永远打不了审批。 ### 3. auto-approve CI状态查询SHA错误(核心bug) `pull_request`事件的`GITHUB_SHA`是merge commit的虚拟SHA,但CI实际运行的是head SHA。用merge SHA查status永远查不到,一直pending,20分钟超时后默默退出,永远打不了审批。 改用 `github.event.pull_request.head.sha` 查询。 ### 4. auto-merge.yml 同样的SHA错误 auto-merge也有同样的bug,一起修了。 ## 影响 - 死锁解除:auto-approve/merge不再跟CI任务抢runner - 自动合并恢复:SHA对了才能正确检测CI全绿 - 12个runner全可用,资源利用率从33%→接近100%
xiaoxia added the ci-pipelineci-bug labels 2026-07-17 15:12:53 +08:00
xiaoxia added 17 commits 2026-07-17 15:12:53 +08:00
Merge develop into main - v0.1.121
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 52h47m33s
CI/CD Pipeline / Frontend Lint (push) Failing after 52h46m49s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 52h46m3s
CI/CD Pipeline / Deploy Production (push) Failing after 52h45m27s
CI/CD Pipeline / Deploy Staging (push) Failing after 1711h22m10s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1711h19m57s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1711h21m45s
1d59ee5336
Merge develop into main - v0.1.122
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 49h54m54s
CI/CD Pipeline / Frontend Lint (push) Failing after 49h54m54s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1708h14m26s
CI/CD Pipeline / Deploy Staging (push) Failing after 1708h14m26s
CI/CD Pipeline / Deploy Production (push) Failing after 1708h12m14s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1708h10m25s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1708h12m14s
dbd956fc6e
Merge develop into main - v0.1.122 (prettier fix)
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 49h37m40s
CI/CD Pipeline / Frontend Lint (push) Failing after 49h37m23s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 49h35m42s
CI/CD Pipeline / Deploy Production (push) Failing after 49h33m12s
CI/CD Pipeline / Production Browser E2E (push) Failing after 49h27m0s
CI/CD Pipeline / Deploy Staging (push) Failing after 1708h11m48s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1708h9m27s
2371860f82
Merge develop into main - v0.1.123
Auto Merge PRs / auto-merge (push) Failing after 3m27s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 47h9m34s
CI/CD Pipeline / Frontend Lint (push) Failing after 47h8m47s
CI/CD Pipeline / Deploy Staging (push) Failing after 47h6m52s
CI/CD Pipeline / Deploy Production (push) Failing after 1705h41m20s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1705h41m20s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1705h41m52s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1705h41m18s
d213a055a1
Merge develop into main - v0.1.124
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 45h16m36s
CI/CD Pipeline / Frontend Lint (push) Failing after 45h16m32s
CI/CD Pipeline / Deploy Staging (push) Failing after 1703h45m33s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 45h9m27s
CI/CD Pipeline / Deploy Production (push) Failing after 45h8m45s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1703h44m57s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1703h44m30s
8748b43070
Merge develop into main - v0.1.125
Auto Merge PRs / auto-merge (push) Failing after 1m29s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 40h59m5s
CI/CD Pipeline / Frontend Lint (push) Failing after 40h58m8s
CI/CD Pipeline / Deploy Staging (push) Failing after 1699h32m50s
CI/CD Pipeline / Deploy Production (push) Failing after 1699h32m48s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1699h32m50s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1699h31m20s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1699h32m48s
9b034764ad
Merge develop into main - v0.1.126
Auto Merge PRs / auto-merge (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 29h56m45s
CI/CD Pipeline / Frontend Lint (push) Failing after 29h56m45s
CI/CD Pipeline / Deploy Production (push) Failing after 1688h31m42s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 1688h31m44s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1689h3m9s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1688h31m44s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1688h31m39s
708662394f
test: trigger workflow after gitea upgrade
CI/CD Pipeline / Staging E2E Tests (push) Failing after 12h49m24s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 12h53m37s
CI/CD Pipeline / Frontend Lint (push) Failing after 12h56m8s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 12h56m8s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1671h29m39s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1671h29m43s
CI/CD Pipeline / Deploy Production (push) Failing after 1672h1m9s
0d4904433e
cleanup: remove upgrade test file
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 12h43m56s
CI/CD Pipeline / Frontend Lint (push) Failing after 12h45m50s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 12h45m50s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1671h17m1s
CI/CD Pipeline / Deploy Production (push) Failing after 1671h20m0s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1671h20m2s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1671h51m26s
ef344e9ffc
ci: remove temporary debug workflow - test-ssh-secret.yml
Fix Flake8 E741 for PR232 / fix-flake8 (push) Failing after 3h4m59s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1577h41m48s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 36s
CI/CD Pipeline / Frontend Lint (push) Failing after 0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 1577h10m16s
CI/CD Pipeline / Deploy Production (push) Failing after 1577h10m14s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1577h10m11s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1577h10m16s
0c9375ff32
fix(ci): 修复auto-merge缺少GITEA_API_TOKEN环境变量
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 7s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1470h25m27s
CI/CD Pipeline / Deploy Production (push) Failing after 1470h25m35s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1470h25m36s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Failing after 1470h57m29s
df08161630
1. 给auto-merge.yml的两个merge step添加GITEA_API_TOKEN环境变量,复用REVIEW_GITEA_TOKEN secret
2. 修复tests.yml的checkout步骤GITHUB_TOKEN和Python命令
3. 给main分支ci-cd.yml的单元测试增加Redis服务,修复Celery相关测试失败
feat(ci): main分支auto-merge从定时改为即时合并
Tests / lint (pull_request) Failing after 9s
Tests / test (pull_request) Failing after 28s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 30s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1466h49m39s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1466h49m40s
CI/CD Pipeline / Build Production Runtime Images (pull_request) Failing after 1466h49m41s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Failing after 1466h49m41s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1467h21m39s
7e5e412f7f
- 触发方式:pull_request事件(CI状态变更时)
- 合并条件:2门禁全绿 + 至少1个APPROVED + 无冲突 + 非草稿
- 安全措施:幂等保护、合并失败留评论、只合main
- 新增check_ci_status.py和check_pr_approval.py辅助脚本
chore: empty commit to re-trigger CI for auto-merge verification
Tests / lint (pull_request) Successful in 9s
Tests / test (pull_request) Failing after 21s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Successful in 20m36s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1466h21m15s
CI/CD Pipeline / Build Production Runtime Images (pull_request) Failing after 1466h21m17s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Failing after 1466h21m17s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1466h21m16s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1466h53m15s
728db0faf8
feat(ci): 添加auto-approve到main分支并适配main门禁规则
Tests / lint (pull_request) Successful in 6s
Tests / test (pull_request) Failing after 29s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 2m54s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Successful in 3m0s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1466h2m30s
CI/CD Pipeline / Build Production Runtime Images (pull_request) Failing after 1466h2m34s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Failing after 1466h2m34s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1466h2m32s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1466h34m32s
a1a272b833
Merge pull request 'feat(ci): main分支auto-merge从定时改为即时合并' (#464) from ci/main-auto-merge-instant into main
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 4s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1466h0m8s
CI/CD Pipeline / Deploy Production (push) Failing after 1466h0m12s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1466h0m13s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Failing after 1466h32m10s
b3ef7bb041
fix(ci): main??auto-merge/approve????Tests/test??
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 3s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1465h21m19s
CI/CD Pipeline / Deploy Production (push) Failing after 1465h21m22s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1465h21m23s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Failing after 1465h53m20s
dfb2feef8a
- auto-merge.yml: main????Tests/test,?3???????
- auto-approve.yml: main??????????Tests/test
- ??#464???Tests/test???????????
fix(ci): 轻量任务改用ci-check标签解决runner调度错配
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 6s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 24s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 39s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 51s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m54s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 2s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1464h16m52s
9d1d279fb9
xiaoxia added 1 commit 2026-07-17 15:18:10 +08:00
fix(ci): auto-approve改用ci-check标签避免调度死锁
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 9s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 27s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 40s
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1464h11m34s
46067ccd49
xiaoxia added 1 commit 2026-07-17 15:18:55 +08:00
fix(ci): 轻量任务改用ci-check标签,同步develop最新改动
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 9s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 29s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 41s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 53s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 1m3s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m56s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1464h10m50s
82ad237b92
xiaoxia added 1 commit 2026-07-17 15:35:42 +08:00
fix(ci): auto-approve使用PR head SHA而非merge SHA检查CI状态
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 10s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 29s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 51s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 44s
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1463h54m3s
eeabeb480a
pull_request事件中GITHUB_SHA是merge commit的虚拟SHA,CI实际运行的是head SHA。
用merge SHA查status永远查不到,导致auto-approve一直看到pending,20分钟超时后退出,
永远打不了审批。改用github.event.pull_request.head.sha查询。
xiaoxia added 1 commit 2026-07-17 15:37:01 +08:00
fix(ci): auto-merge使用PR head SHA检查CI状态
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 7s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 26s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 40s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 39s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 56s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m35s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1463h52m44s
5d7cd23880
xiaoxia changed title from fix(ci): 轻量任务改用ci-check标签解决runner调度错配问题 to fix(ci): 调度优化+auto-approve/merge SHA修复(解决PR无法自动合并的根因) 2026-07-17 15:37:15 +08:00
xiaoxia closed this pull request 2026-07-17 15:37:49 +08:00
Some checks are pending
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 7s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 26s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 40s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 39s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 56s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1m35s
Auto Merge PRs (main) / Auto Merge on CI Green + Approved (main) (pull_request) Failing after 1463h52m44s

Pull request closed

Sign in to join this conversation.