Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iwanghc
Copy link
Collaborator

@iwanghc iwanghc commented Oct 17, 2025

User description

关联的 issue

#3145

描述你的变更

修复工单sql重试接口路径

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

link #3148


Description

  • 修正工单重试接口路径错误

  • 更新API文档中的路径配置

  • 统一swagger接口路径与描述


Diagram Walkthrough

flowchart LR
  A["修改 controller 路径"]
  B["更新 docs.go 文档"]
  C["调整 swagger.json 配置"]
  D["修改 swagger.yaml 配置"]
  A -- "同步路径修改" --> B
  B -- "保持接口一致" --> C
  C -- "文档统一" --> D
Loading

File Walkthrough

Relevant files
Bug fix
workflow.go
更新工单重试接口路径                                                                                             

sqle/api/controller/v1/workflow.go

  • 删除错误的 exec_sqls 前缀
  • 修改 router 注解为 /re_execute
+1/-1     
Documentation
docs.go
调整API文档路径配置                                                                                           

sqle/docs/docs.go

  • 交换 re_execute 与 order_file 路径定义
  • 调整 operationId与描述信息
  • 更新请求体引用定义
+22/-22 
swagger.json
修正swagger.json接口路径                                                                             

sqle/docs/swagger.json

  • 替换错误的 exec_sqls 路径
  • 调整请求描述与返回引用
+22/-22 
swagger.yaml
统一swagger.yaml接口路径展示                                                                         

sqle/docs/swagger.yaml

  • 修改接口路径从 exec_sqls/re_execute 到 re_execute
  • 统一操作ID和请求描述
+20/-20 

@actiontech-bot actiontech-bot requested review from BugsGuru and removed request for BugsGuru October 17, 2025 03:29
@github-actions
Copy link

PR Reviewer Guide 🔍

🎫 Ticket compliance analysis 🔶

3145 - Partially compliant

Compliant requirements:

• 修正工单重试接口路径
• 更新 API 文档中的路径配置
• 统一 swagger 接口路径与描述

Non-compliant requirements:

[]

Requires further human verification:

[]

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

接口路由更新

请确认修改后的接口路由与后端逻辑保持一致,避免因路径调整导致接口调用异常,同时确保所有相关文档均已同步更新。

// @Tags workflow
// @Id reExecuteTaskOnWorkflowV1
// @Security ApiKeyAuth
// @Param project_name path string true "project name"
// @Param workflow_id path string true "workflow id"
// @Param task_id path string true "task id"
// @Param instance body v1.ReExecuteTaskOnWorkflowReq true "re-execute task on workflow request"
// @Success 200 {object} controller.BaseRes
// @router /v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute [post]
func ReExecuteTaskOnWorkflowV1(c echo.Context) error {
文档模型一致性

请检查新增接口文档中请求体引用的模型是否与实际接口处理逻辑一致,确保“re_execute”与“order_file”接口的参数和返回值模型没有混淆或错误。

                "description": "sql file",
                "schema": {
                    "type": "file"
                }
            }
        }
    }
},
"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": {
    "post": {
        "security": [
            {
                "ApiKeyAuth": []
            }
        ],
        "description": "update sql file order",
        "consumes": [
            "application/json"
        ],
        "produces": [
            "application/json"
        ],
        "tags": [
            "task"
        ],
        "summary": "修改文件上线顺序",
        "operationId": "updateSqlFileOrderV1",
        "parameters": [
            {
                "type": "string",
                "description": "project name",
                "name": "project_name",
                "in": "path",
                "required": true
            },
            {
                "type": "string",
                "description": "workflow id",
                "name": "workflow_id",
                "in": "path",
                "required": true
            },
            {
                "type": "string",
                "description": "task id",
                "name": "task_id",
                "in": "path",
                "required": true
            },
            {
                "description": "instance body v1.UpdateSqlFileOrderV1Req true",
                "name": "instance",
                "in": "body",
                "required": true,
                "schema": {
                    "$ref": "#/definitions/v1.UpdateSqlFileOrderV1Req"
                }
            }
        ],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "$ref": "#/definitions/v1.GetSqlFileOrderMethodResV1"
                }
            }
        }
    }
},
"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": {
    "post": {
        "security": [
            {
                "ApiKeyAuth": []
            }
        ],
        "description": "re-execute task on workflow",
        "tags": [
            "workflow"
        ],
        "summary": "单数据源SQL重新上线",
        "operationId": "reExecuteTaskOnWorkflowV1",
        "parameters": [
            {
                "type": "string",
                "description": "project name",
                "name": "project_name",
                "in": "path",
                "required": true
            },
            {
                "type": "string",
                "description": "workflow id",
                "name": "workflow_id",
                "in": "path",
                "required": true
            },
            {
                "type": "string",
                "description": "task id",
                "name": "task_id",
                "in": "path",
                "required": true
            },
            {
                "description": "re-execute task on workflow request",
                "name": "instance",
                "in": "body",
                "required": true,
                "schema": {
                    "$ref": "#/definitions/v1.ReExecuteTaskOnWorkflowReq"
                }
            }
        ],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "$ref": "#/definitions/controller.BaseRes"
                }
            }
        }
    }

@github-actions
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
调整文档路由路径

请检查文档中定义的接口路径是否与控制器中的路由一致,如果控制器使用的是 /re_execute,则文档中也应同步修改。避免因路径不统一导致接口调用异常。

sqle/docs/docs.go [8151]

-"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": {
+"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": {
Suggestion importance[1-10]: 7

__

Why: This suggestion addresses a potential mismatch by aligning the documented route with the controller’s use of /re_execute, which is important for API consistency even though it only alters a single endpoint string.

Medium
同步 Swagger 路由定义

确保 Swagger 文件中接口定义的路径与实际的 API 路由一致,避免接口对接时发生错误。如果控制器路由为 /re_execute,则应在 Swagger
中进行相同更改。此处还需要同步更新 consumes、produces 以及 operationId 等属性以确保整体一致性。

sqle/docs/swagger.json [8135]

-"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/order_file": {
+"/v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute": {
Suggestion importance[1-10]: 7

__

Why: The proposal ensures that the Swagger documentation’s endpoint is updated to reflect the change to /re_execute, impacting related attributes for API consumers; it is a moderate but important correction.

Medium
统一接口路径配置

请确认此处的接口路径是否与其他文档中保持一致,避免调用路由时发生不匹配问题。接口文档与控制器路由必须统一设置。

sqle/api/controller/v1/workflow.go [1364]

+// @router /v1/projects/{project_name}/workflows/{workflow_id}/tasks/{task_id}/re_execute [post]
 
-
Suggestion importance[1-10]: 5

__

Why: The suggestion merely confirms that the @router path in the controller matches documentation, with the improved code identical to the existing code; it is a useful consistency check but of moderate impact.

Low

@BugsGuru BugsGuru merged commit ecacd4e into main Oct 17, 2025
4 checks passed
@BugsGuru BugsGuru deleted the task_re-execute branch October 17, 2025 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants