feat(workflow):增加SQL上线工单的批量操作(如批量提交、审核、执行、终止) - #3204
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3204 +/- ##
==========================================
+ Coverage 87.82% 88.07% +0.24%
==========================================
Files 157 157
Lines 28486 28930 +444
==========================================
+ Hits 25018 25480 +462
+ Misses 3468 3450 -18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5b7ff7121
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb4e59d8ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ee7d32da4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
LeoQuote
left a comment
There was a problem hiding this comment.
这个实现方式上, 是否考虑利用现有接口, 通过前端的更改来进行实现? 前端可以逐个发送请求, 在异常时直接中止, 这样来实现可能会更加简单方便.
当前的实现方式我的修改意见如下
纯前端的实现在性能上可能有问题吧, 批量提交的场景,我认为是在多实例或者多库的分库分表场景下,一般20-30个不算多吧,前端一下子这么多请求,有点怪。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f68ef8cdb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
8f68ef8 to
a41a09d
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
f054451 to
87eb9d7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87eb9d71f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
87eb9d7 to
d826d30
Compare
【批量操作】:在SQL上线模块,增加批量操作功能。
在提交SQL的页面(/submitsql/)更改内容:
1、多实例单库的场景:将当前的【请选择实例:】由单选改为多选,对应后端也改,最终可以生成多实例单库的多个工单。SQL检测,只检测第一个实例的SQL,其他实例不重复检测。
2、单实例多库的场景:将当前的【请选择数据库:】由单选改为多选,对应后端也改,最终可以生成单实例多库的多个工单。SQL检测,只检测第一个库的SQL,其他库不重复检测。
3、多实例多库的场景:生成的工单数就变成M*N了。SQL检测,只检测第一个实例,第一个库的SQL,不重复检测。
在工单流的查看页面(/sqlworkflow/)更改内容:
1、在每个工单名称前增加一列,勾选框,可多选多个工单。
2、在现有的【提交SQL】按钮右侧,增加选择操作,采用dropdown的形式折叠起来:批量审核SQL、批量执行SQL、批量终止工单。
批量功能,按照工单的提交顺序,先提交的先操作,后提交的后操作。注:这个批量顺序,只是触发顺序,最终的结束时间顺序是按照实例本身的执行情况,有可能后操作的,反而先执行成功。
要求:批量勾选的所有工单处于同一个状态,验证每个工单当前用户都有可操作权限(审核、执行、终止)。
和这个discussions#1578不同的地方是:
1、没有【提交批量SQL】按钮,而是通过多选实例和库的方式实现。
2、没有【提交批量回滚工单】按钮,回滚逻辑本来就有点复杂,而且当前也只支持mysql库的回滚。
相关回滚可以自行通过单个工单的回滚SQL提交,然后多选实例和库来批量提交。