feat: 支持按 Tag 打包,分支管理可添加 Tag
- 分支管理新增「分支 / Tag」类型选择,Tag 存于 config["tags"],与分支不可重名 - 每个 Tag 与分支一样拥有同名独立版本轨道,默认上架轨 - 打包页按「分支」「Tag」分组选择;任务新增 ref_type 字段记录引用类型 - Tag 打包时 fetch --tags --force 后以游离 HEAD 检出 refs/tags/<tag> - 历史记录与下载页按类型显示「分支」或「Tag」 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,23 @@ def test_create_task_default_branch(mock_queue, client, tmp_config):
|
||||
})
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["branch"] == "main"
|
||||
assert resp.json()["ref_type"] == "branch"
|
||||
|
||||
|
||||
@patch("backend.services.build_queue.build_queue")
|
||||
def test_create_task_from_tag(mock_queue, client, tmp_config):
|
||||
"""选择已配置的 Tag 打包时,任务记录为 tag 类型"""
|
||||
mock_queue.submit = AsyncMock()
|
||||
assert client.post("/api/config/tags", json={"name": "v3.2.0"}).status_code == 200
|
||||
resp = client.post("/api/tasks", json={
|
||||
"app_id": "1",
|
||||
"build_type": "Ad_Hoc",
|
||||
"scheme_id": "1",
|
||||
"branch": "v3.2.0",
|
||||
})
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["branch"] == "v3.2.0"
|
||||
assert resp.json()["ref_type"] == "tag"
|
||||
|
||||
|
||||
@patch("backend.services.build_queue.build_queue")
|
||||
|
||||
Reference in New Issue
Block a user