Repository: incubator-distributedlog Updated Branches: refs/heads/master 5e71d7379 -> b23291a2a
Handle correctly merge commits. In the case of pull request #3, there was a merge commit in the pull request (https://api.github.com/repos/apache/incubator-distributedlog/commits/2197d49261785a370f22c026cc9fe02f55b7e77c) which has no login key for the actor, and the script was unable to handle this situation. Now we check for the presence of the key. Author: Franck Cuny <[email protected]> Reviewers: Sijie Guo <[email protected]> Closes #11 from franckcuny/fcuny/fix-dl-merge-script Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/b23291a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/b23291a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/b23291a2 Branch: refs/heads/master Commit: b23291a2a282c2091a3c45e22cf84c32eb4a05b1 Parents: 5e71d73 Author: Franck Cuny <[email protected]> Authored: Mon Aug 22 18:02:02 2016 -0700 Committer: Sijie Guo <[email protected]> Committed: Mon Aug 22 18:02:02 2016 -0700 ---------------------------------------------------------------------- scripts/dev/dl-merge-pr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/b23291a2/scripts/dev/dl-merge-pr.py ---------------------------------------------------------------------- diff --git a/scripts/dev/dl-merge-pr.py b/scripts/dev/dl-merge-pr.py index 7367140..14e4833 100755 --- a/scripts/dev/dl-merge-pr.py +++ b/scripts/dev/dl-merge-pr.py @@ -511,9 +511,11 @@ def main(): # Merged pull requests don't appear as merged in the GitHub API; # Instead, they're closed by asfgit. - merge_commits = [ - e for e in pr_events if e['actor']['login'] == 'asfgit' and e['event'] == 'closed' - ] + merge_commits = [] + for e in pr_events: + if e['event'] == 'closed': + if e['actor'] is not None and e['actor']['login'] == 'asfgit': + merge_commits.append(e) if merge_commits: merge_hash = merge_commits[0]['commit_id']
