Commit ee006bd8 authored by Dimitri Podborski's avatar Dimitri Podborski 😂
Browse files

bugfix opening duplicate issues, add force close option

parent 4fde6332
......@@ -91,7 +91,7 @@ def get_issues(project_id):
project = _get_project(project_id)
if not project:
return []
issues = project.issues.list(state='opened')
issues = project.issues.list(state='opened', all=True)
return issues
def open_issue(project_id, title, description, labels=[]):
......@@ -183,7 +183,7 @@ def open_issues(table_entries, test, gitlab_members, meeting_start):
print(' * {}: No update required for "{}"'.format(document['document'], document['title']))
print('Opened issues:', counter)
def close_issues(table_entries, test):
def close_issues(table_entries, test, force):
print('\nClose {} issues. TestMode={}'.format(len(table_entries), test))
counter = 0
for entry in table_entries:
......@@ -191,6 +191,8 @@ def close_issues(table_entries, test):
project_id = entry['project']['id']
close_flag = entry['close']
if force:
close_flag = True
if not close_flag == True:
......@@ -346,10 +348,11 @@ usage_examples= '''Examples:
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description='A tool for managing the GitLab issues for MPEG Systems Subgroups.',
parser.add_argument('-o', '--open', help='Open GitLab issues.', action='store_true')
parser.add_argument('-c', '--close', help='Close GitLab issues.', action='store_true')
parser.add_argument('-d', '--docx', help='Generate output word document.', action='store_true')
parser.add_argument('-l', '--list', help='List information about the contribution(s).', action='store_true')
parser.add_argument('-o', '--open', help='Mode: Open GitLab issues.', action='store_true')
parser.add_argument('-c', '--close', help='Mode: Close GitLab issues.', action='store_true')
parser.add_argument('-d', '--docx', help='Mode: Generate output word document.', action='store_true')
parser.add_argument('-l', '--list', help='Mode: List information about the contribution(s).', action='store_true')
parser.add_argument('-C', '--CLOSE', help='Force closing GitLab issues.', action='store_true')
parser.add_argument('-u', '--update', help='Update MDMS documents database.', action='store_true')
parser.add_argument('-U', '--UPDATE', help='Update all databases.', action='store_true')
parser.add_argument('-i', '--csv', help='Input CSV file. Header row shall include "Number" and ("Project URL" or "Sub Group" and "Project Name").')
......@@ -428,6 +431,6 @@ if
gitlab_members = None
open_issues(table_entries, args.test, gitlab_members, meeting_start)
if args.close:
close_issues(table_entries, args.test)
close_issues(table_entries, args.test, args.CLOSE)
if args.docx:
create_output_doc(table_entries, output_path, args.template)
Supports Markdown
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