-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
增加sql上线可执行时间选择,且审核人可修改这个时间 #260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢提交,请不要反复开关PR,现在PR列表已经有点混乱,直接在原分支提交修改PR会自动更新
- 补充一下单元测试,或者你调整完后我来补充
- 在SQL上线的配置组中增加一个配置项用来开启该功能,当配置项关闭时,SQL提交和详情页面的信息都隐藏,配置项说明可以叫 【是否开启SQL执行时间限制】,使用switch
sql/models.py
Outdated
@@ -193,6 +193,8 @@ class SqlWorkflow(models.Model): | |||
engineer_display = models.CharField('发起人中文名', max_length=50, default='') | |||
status = models.CharField(max_length=50, choices=SQL_WORKFLOW_CHOICES) | |||
audit_auth_groups = models.CharField('审批权限组列表', max_length=255) | |||
starttime = models.DateTimeField('可执行起始时间', null=True, blank=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果没有更好的名字就直接用这两个吧,但是还是按照规范使用start_time、end_time
sql/sql_workflow.py
Outdated
@@ -126,6 +126,8 @@ def submit(request): | |||
is_backup = True if request.POST.get('is_backup') == 'True' else False | |||
notify_users = request.POST.getlist('notify_users') | |||
list_cc_addr = [email['email'] for email in Users.objects.filter(username__in=notify_users).values('email')] | |||
starttime = request.POST['run_date_start'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参数名 同上要求
sql/templates/sqlsubmit.html
Outdated
@@ -91,6 +91,19 @@ | |||
{% endfor %} | |||
</select> | |||
</div> | |||
<!--可执行时间--> | |||
<div class="form-group"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除这个div,在下面的div的class中加入form-group属性,类似<div class='form-group input-group date '
Codecov Report
@@ Coverage Diff @@
## master #260 +/- ##
==========================================
+ Coverage 83.2% 83.72% +0.52%
==========================================
Files 65 65
Lines 8252 8393 +141
==========================================
+ Hits 6866 7027 +161
+ Misses 1386 1366 -20
Continue to review full report at Codecov.
|
@yzypals 做了一部分调整,看下是否合适,确认后就可以合并 |
可以的 规范了很多 |
定时执行也判断是否在执行时间范围内 修改部分变量定义,补充数据库变更脚本 补充测试用例
增加sql上线可执行时间选择,且审核人可修改这个时间
修复了几个 空时间错误的问题