Commit bf11b4a2 authored by Romain Bouvier's avatar Romain Bouvier
Browse files

Merge branch 'transition_log' into 'master'

Write a correspondence table (csv logfile)

See merge request skunnyk/bztogl!1
parents 35a4f4ed cb36ad47
......@@ -27,7 +27,7 @@ import gitlab
from . import common, milestones, template, users
def processbug(bgo, bzurl, instance, resolution, target, user_cache,
milestone_cache, bzbug, migrate_components):
milestone_cache, bzbug, migrate_components, glurl, logfile):
print("Processing bug #%d: %s" % (bzbug.id, bzbug.summary))
# bzbug.cc
# bzbug.id
......@@ -259,6 +259,9 @@ def processbug(bgo, bzurl, instance, resolution, target, user_cache,
print("New GitLab issue created from bugzilla bug "
"{}: {}".format(bzbug.id, issue.web_url))
logstring = "{};{}\n".format(bzbug.id, issue.web_url.replace(glurl,""))
logfile.write(logstring)
if bzbug.bugzilla.logged_in:
bz = bzbug.bugzilla
print("Adding a comment in bugzilla and closing the bug there")
......@@ -329,6 +332,7 @@ def main():
giturl = "https://git.xfce.org/"
instance = "xfce.org"
bzresolution = 'MOVED'
logfilename = 'bztogl.csv'
target = common.GitLab(glurl, giturl, args.token, args.product,
args.target_project, args.automate)
......@@ -375,6 +379,7 @@ def main():
if len(bzbugs) != 0:
milestone_cache = milestones.MilestoneCache(target)
user_cache = users.UserCache(target, bgo, args.product)
logfile = open(logfilename, "w")
# TODO: Check if there were bugs from this module already filed (i.e.
# use a tag to mark these)
......@@ -385,12 +390,16 @@ def main():
#sys.stdout.write(' SKIPPED!')
#continue
processbug(bgo, bzurl, instance, bzresolution, target, user_cache,
milestone_cache, bzbug, migrate_components)
milestone_cache, bzbug, migrate_components, glurl, logfile)
logfile.close ()
if os.path.exists('users_cache'):
print('IMPORTANT: Remove the file \'users_cache\' after use, it \
contains sensitive data')
if os.path.exists(logfilename):
print("Logfile written to '%s'." % logfilename)
if __name__ == '__main__':
main()
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