From f4bd37b1b38d98e68a0e84038fa7dec1c729daf7 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 28 Aug 2018 12:17:55 -0500 Subject: [PATCH 1/6] Don't crash on missing fields in pull requests --- bin/github-backup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/github-backup b/bin/github-backup index 2603ad1..37efdeb 100755 --- a/bin/github-backup +++ b/bin/github-backup @@ -767,10 +767,18 @@ def backup_pulls(args, repo_cwd, repository, repos_template): for number, pull in list(pulls.items()): if args.include_pull_comments or args.include_everything: template = comments_template.format(number) - pulls[number]['comment_data'] = retrieve_data(args, template) + try: + pulls[number]['comment_data'] = retrieve_data(args, template) + except TypeError as e: + log_info("Warning: comment_data doesn't exist for this pull request: " + str(e)) + pass if args.include_pull_commits or args.include_everything: template = commits_template.format(number) - pulls[number]['commit_data'] = retrieve_data(args, template) + try: + pulls[number]['commit_data'] = retrieve_data(args, template) + except TypeError as e: + log_info("Warning: commit_data doesn't exist for this pull request: " + str(e)) + pass pull_file = '{0}/{1}.json'.format(pulls_cwd, number) with codecs.open(pull_file, 'w', encoding='utf-8') as f: From f747d2aa9d8eceece5c3e82cc1f7c606127777d8 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 28 Aug 2018 12:18:38 -0500 Subject: [PATCH 2/6] Update __init__.py --- github_backup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_backup/__init__.py b/github_backup/__init__.py index 2f15b8c..abadaef 100644 --- a/github_backup/__init__.py +++ b/github_backup/__init__.py @@ -1 +1 @@ -__version__ = '0.20.0' +__version__ = '0.20.1' From c3262aa24cb6084d3d03b5a17ab52f1d4ed23666 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 28 Aug 2018 12:19:51 -0500 Subject: [PATCH 3/6] Update CHANGES.rst --- CHANGES.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index beca679..98e6620 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ Changelog ========= +0.20.1 (2018-08-28) +------------------- + +Fix +~~~ + +- Don't crash on missing fields in pull requests. [Igor Cherkaev] + 0.20.0 (2018-03-24) ------------------- From 62ac3a8000565941af419f92579d51976091920b Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 2 Sep 2018 16:41:16 -0500 Subject: [PATCH 4/6] reverting __init__.py release related changes --- github_backup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_backup/__init__.py b/github_backup/__init__.py index abadaef..2f15b8c 100644 --- a/github_backup/__init__.py +++ b/github_backup/__init__.py @@ -1 +1 @@ -__version__ = '0.20.1' +__version__ = '0.20.0' From 1d78db1dd16ed70107ad2a251d60deb0658ddfaf Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 2 Sep 2018 16:41:52 -0500 Subject: [PATCH 5/6] reverting CHANGES.rst release related changes --- CHANGES.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 98e6620..beca679 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,14 +1,6 @@ Changelog ========= -0.20.1 (2018-08-28) -------------------- - -Fix -~~~ - -- Don't crash on missing fields in pull requests. [Igor Cherkaev] - 0.20.0 (2018-03-24) ------------------- From a09a390f0165b29f09e7679601c87b168f203bbd Mon Sep 17 00:00:00 2001 From: Igor Cherkaev Date: Tue, 4 Sep 2018 11:28:59 -0500 Subject: [PATCH 6/6] Don't crash on missing fields when backing up pull requests --- bin/github-backup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/github-backup b/bin/github-backup index 2603ad1..37efdeb 100755 --- a/bin/github-backup +++ b/bin/github-backup @@ -767,10 +767,18 @@ def backup_pulls(args, repo_cwd, repository, repos_template): for number, pull in list(pulls.items()): if args.include_pull_comments or args.include_everything: template = comments_template.format(number) - pulls[number]['comment_data'] = retrieve_data(args, template) + try: + pulls[number]['comment_data'] = retrieve_data(args, template) + except TypeError as e: + log_info("Warning: comment_data doesn't exist for this pull request: " + str(e)) + pass if args.include_pull_commits or args.include_everything: template = commits_template.format(number) - pulls[number]['commit_data'] = retrieve_data(args, template) + try: + pulls[number]['commit_data'] = retrieve_data(args, template) + except TypeError as e: + log_info("Warning: commit_data doesn't exist for this pull request: " + str(e)) + pass pull_file = '{0}/{1}.json'.format(pulls_cwd, number) with codecs.open(pull_file, 'w', encoding='utf-8') as f: