todos: all todos needs to be resolved for merge to happen.
This will prevent the outdated todos beeing automatically marked as solved becuase of bigger diff changes. It's better to mark commits quickly as resolved instead of potentially have unresolved todos hidden because of invlidation logic.
This commit is contained in:
parent
82fd870fe4
commit
e63934c25b
1 changed files with 9 additions and 4 deletions
|
|
@ -129,15 +129,20 @@ class CommentsModel(BaseModel):
|
|||
|
||||
return comment_versions
|
||||
|
||||
def get_unresolved_todos(self, pull_request):
|
||||
def get_unresolved_todos(self, pull_request, show_outdated=True):
|
||||
|
||||
todos = Session().query(ChangesetComment) \
|
||||
.filter(ChangesetComment.pull_request == pull_request) \
|
||||
.filter(ChangesetComment.resolved_by == None) \
|
||||
.filter(ChangesetComment.comment_type
|
||||
== ChangesetComment.COMMENT_TYPE_TODO) \
|
||||
.filter(coalesce(ChangesetComment.display_state, '') !=
|
||||
ChangesetComment.COMMENT_OUTDATED).all()
|
||||
== ChangesetComment.COMMENT_TYPE_TODO)
|
||||
|
||||
if not show_outdated:
|
||||
todos = todos.filter(
|
||||
coalesce(ChangesetComment.display_state, '') !=
|
||||
ChangesetComment.COMMENT_OUTDATED)
|
||||
|
||||
todos = todos.all()
|
||||
|
||||
return todos
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue