Skip to content
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

Merged
merged 2 commits into from
Jun 16, 2019

Conversation

yzypals
Copy link
Collaborator

@yzypals yzypals commented Jun 10, 2019

增加sql上线可执行时间选择,且审核人可修改这个时间
修复了几个 空时间错误的问题

Copy link
Owner

@hhyo hhyo left a 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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果没有更好的名字就直接用这两个吧,但是还是按照规范使用start_time、end_time

@@ -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']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数名 同上要求

@@ -91,6 +91,19 @@
{% endfor %}
</select>
</div>
<!--可执行时间-->
<div class="form-group">
Copy link
Owner

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 '

@stale stale bot added the wontfix This will not be worked on label Jun 13, 2019
@hhyo hhyo added the enhancement New feature or request label Jun 14, 2019
@stale stale bot removed the wontfix This will not be worked on label Jun 14, 2019
Repository owner deleted a comment from stale bot Jun 14, 2019
@codecov
Copy link

codecov bot commented Jun 15, 2019

Codecov Report

Merging #260 into master will increase coverage by 0.52%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
sql/urls.py 100% <ø> (ø) ⬆️
sql/utils/sql_review.py 97.18% <100%> (+0.46%) ⬆️
sql/models.py 94.91% <100%> (+0.01%) ⬆️
sql/utils/tests.py 98.88% <100%> (+0.04%) ⬆️
sql/tests.py 95.48% <100%> (+0.36%) ⬆️
sql/sql_workflow.py 73.26% <66.66%> (+8.62%) ⬆️
sql/engines/models.py 95.34% <0%> (+4.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a96d3b...0c51bf7. Read the comment docs.

@hhyo hhyo requested a review from LeoQuote June 15, 2019 06:39
@hhyo
Copy link
Owner

hhyo commented Jun 15, 2019

@yzypals 做了一部分调整,看下是否合适,确认后就可以合并

@yzypals
Copy link
Collaborator Author

yzypals commented Jun 16, 2019

可以的 规范了很多

定时执行也判断是否在执行时间范围内
修改部分变量定义,补充数据库变更脚本
补充测试用例
@hhyo hhyo merged commit afee887 into hhyo:master Jun 16, 2019
@yzypals yzypals deleted the etime branch June 19, 2019 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants