Commit 8bdc1b8a authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

my_activity: add --completed-issues option.

--completed-issues lists only monorail issues which are owned by the
user and have status Fixed|Verified.

R=sergiyb@chromium.org

Change-Id: I42737bb6ef81ffa463eedee209a2993f68b57d3a
Reviewed-on: https://chromium-review.googlesource.com/1227445
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
parent baf09271
......@@ -527,6 +527,7 @@ class MyActivity(object):
def monorail_issue_search(self, project):
epoch = datetime.utcfromtimestamp(0)
# TODO(tandrii): support non-chromium email, too.
user_str = '%s@chromium.org' % self.user
issues = self.monorail_query_issues(project, {
......@@ -536,6 +537,13 @@ class MyActivity(object):
'updatedMin': '%d' % (self.modified_after - epoch).total_seconds(),
})
if self.options.completed_issues:
return [
issue for issue in issues
if (self.match(issue['owner']) and
issue['status'].lower() in ('verified', 'fixed'))
]
return [
issue for issue in issues
if issue['author'] == user_str or issue['owner'] == user_str]
......@@ -969,6 +977,13 @@ def main():
dest='merged_only',
default=False,
help='Shows only changes that have been merged.')
parser.add_option(
'-C', '--completed-issues',
action='store_true',
dest='completed_issues',
default=False,
help='Shows only monorail issues that have completed (Fixed|Verified) '
'by the user.')
parser.add_option(
'-o', '--output', metavar='<file>',
help='Where to output the results. By default prints to stdout.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment