chore(ci): 同步main分支CI配置与scripts/ci脚本 - 与develop对齐
Worker Base Image Build / Build Worker Base Images (worker-base-builder-cache, infra/docker/worker-base-builder.Dockerfile, worker-base-builder, builder) (push) Failing after 1m54s
Worker Base Image Build / Build Worker Base Images (worker-base-runtime-cache, infra/docker/worker-base-runtime.Dockerfile, worker-base-runtime, runtime) (push) Failing after 1m36s
CI/CD Pipeline / Validate - Code Quality (push) Failing after 1m29s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m4s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m2s
CI/CD Pipeline / Unit Tests (push) Successful in 3m38s
CI/CD Pipeline / Integration Tests (push) Successful in 2m0s
CI/CD Pipeline / Frontend Lint (push) Successful in 28s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 44s
CI/CD Pipeline / Build Staging API Image (push) Failing after 2m16s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 8m14s
CI/CD Pipeline / Build Staging Worker Image (push) Failing after 2m0s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 1300h3m30s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1300h3m32s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1300h32m43s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1300h32m45s
CI/CD Pipeline / Deploy Production (push) Failing after 1300h43m2s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1300h49m13s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1300h49m14s
CI/CD Pipeline / Build Production API Image (push) Failing after 1300h49m14s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1300h51m32s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1300h51m34s
CI/CD Pipeline / PR Build API Image (push) Failing after 1300h51m36s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1300h52m20s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1300h35m56s
Worker Base Image Build / Build Worker Base Images (worker-base-builder-cache, infra/docker/worker-base-builder.Dockerfile, worker-base-builder, builder) (push) Failing after 1m54s
Worker Base Image Build / Build Worker Base Images (worker-base-runtime-cache, infra/docker/worker-base-runtime.Dockerfile, worker-base-runtime, runtime) (push) Failing after 1m36s
CI/CD Pipeline / Validate - Code Quality (push) Failing after 1m29s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m4s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m2s
CI/CD Pipeline / Unit Tests (push) Successful in 3m38s
CI/CD Pipeline / Integration Tests (push) Successful in 2m0s
CI/CD Pipeline / Frontend Lint (push) Successful in 28s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 44s
CI/CD Pipeline / Build Staging API Image (push) Failing after 2m16s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 8m14s
CI/CD Pipeline / Build Staging Worker Image (push) Failing after 2m0s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 1300h3m30s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1300h3m32s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1300h32m43s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1300h32m45s
CI/CD Pipeline / Deploy Production (push) Failing after 1300h43m2s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1300h49m13s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1300h49m14s
CI/CD Pipeline / Build Production API Image (push) Failing after 1300h49m14s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1300h51m32s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1300h51m34s
CI/CD Pipeline / PR Build API Image (push) Failing after 1300h51m36s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1300h52m20s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1300h35m56s
同步内容: 1. CI流水线配置(ci-pipeline.yml)与develop对齐 2. PR构建脚本docker_build_only.sh增加buildx→docker build回退 3. pre-build步骤worker基础镜像构建增加buildx回退 4. 单元测试脚本全量覆盖率改为仅报告不阻塞 5. diff-cover依赖加入requirements-dev.txt 6. worker base builder/runtime Dockerfile同步 7. test_config_oss.py clear=False→clear=True修复OSS污染 8. Frontend Lint增加prettier依赖
This commit was merged in pull request #767.
This commit is contained in:
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
"""生成预览环境PR评论内容"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def generate_deploy_comment(pr_number, preview_url):
|
||||
"""生成部署成功的评论内容"""
|
||||
return f"""🚀 **预览环境已部署**
|
||||
|
||||
| 项目 | 详情 |
|
||||
|------|------|
|
||||
| PR号 | #{pr_number} |
|
||||
| 预览链接 | [{preview_url}]({preview_url}) |
|
||||
| API环境 | staging |
|
||||
|
||||
> 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。
|
||||
>
|
||||
> 🔄 每次提交新代码后预览环境会自动更新。
|
||||
>
|
||||
> 🗑️ PR 关闭或合并后,预览环境会自动清理。
|
||||
"""
|
||||
|
||||
|
||||
def generate_cleanup_comment(pr_number):
|
||||
"""生成清理完成的评论内容"""
|
||||
return f"""🗑️ **预览环境已清理**
|
||||
|
||||
PR #{pr_number} 已关闭或合并,对应的预览环境已被清理。
|
||||
|
||||
> 如有需要,可以重新打开 PR 来重新生成预览环境。
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
mode = sys.argv[1] if len(sys.argv) > 1 else "deploy"
|
||||
pr_number = os.environ.get("PR_NUMBER", "")
|
||||
preview_url = os.environ.get("PREVIEW_URL", "")
|
||||
|
||||
if mode == "deploy":
|
||||
body = generate_deploy_comment(pr_number, preview_url)
|
||||
elif mode == "cleanup":
|
||||
body = generate_cleanup_comment(pr_number)
|
||||
else:
|
||||
print(f"Unknown mode: {mode}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps({"body": body}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user