Skip to content
Snippets Groups Projects
Commit 66d30e4e authored by Romain Bouvier's avatar Romain Bouvier
Browse files

Add possibility to import resolved bugs too

- By using the --resolved switch
- Importing tens of thousands bugs is really slow, I think that's why gnome and fd.o chose to not import resolved bugs.
- However on xfce, it should be doable (only ~15k bugs in total)
parent e0914f34
No related branches found
No related tags found
No related merge requests found
......@@ -311,7 +311,12 @@ def processbug(bgo, bzurl, instance, resolution, target, user_cache,
# Workaround python-gitlab bug by providing redundant state_event
# https://github.com/python-gitlab/python-gitlab/pull/389
issue.save(state_event='reopen')
if bzbug.status.startswith('RESOLVED'):
print("Closing the issue in gitlab as it is marked as resolved in bugzilla")
issue.state_event = 'close'
issue.save()
else:
issue.save(state_event='reopen')
print("New GitLab issue created from bugzilla bug "
"{}: {}".format(bzbug.id, issue.web_url))
......@@ -355,6 +360,8 @@ def options():
help="import for freedesktop.org rather than GNOME")
parser.add_argument('--xfce', action='store_true',
help="import for xfce.org rather than GNOME")
parser.add_argument('--resolved', action='store_true',
help="import resolved bugs (default: no)")
return parser.parse_args()
......@@ -436,6 +443,9 @@ def main():
print("Querying for open bugs for the '%s' product, all components" %
args.product)
query["status"] = "NEW ASSIGNED REOPENED NEEDINFO UNCONFIRMED".split()
if args.resolved:
print('We are also importing resolved issues')
query["status"] += " RESOLVED".split()
bzbugs = bgo.query(query)
print("{} bugs found".format(len(bzbugs)))
count = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment