diff --git a/create_review-comments.patch b/create_review-comments.patch new file mode 100644 index 0000000..575db93 --- /dev/null +++ b/create_review-comments.patch @@ -0,0 +1,24 @@ +From c53fe24fe8529dd2dd0a989a4a57b49ace2e1a6d Mon Sep 17 00:00:00 2001 +From: "Brian J. Murrell" +Date: Tue, 25 Sep 2018 17:31:10 -0400 +Subject: [PATCH] Line comments are not posted in create_review() + +When create_review() is called with comments in the comments argument, +they are not actually posted in the API call. +--- + github/PullRequest.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/github/PullRequest.py b/github/PullRequest.py +index c855dfb8..688e0625 100644 +--- a/github/PullRequest.py ++++ b/github/PullRequest.py +@@ -434,6 +434,8 @@ def create_review(self, commit, body, event=github.GithubObject.NotSet, comments + post_parameters['event'] = 'COMMENT' if event == github.GithubObject.NotSet else event + if comments is github.GithubObject.NotSet: + post_parameters['comments'] = [] ++ else: ++ post_parameters['comments'] = comments + headers, data = self._requester.requestJsonAndCheck( + "POST", + self.url + "/reviews", diff --git a/python-PyGithub.spec b/python-PyGithub.spec index 0d8d3a8..63aaad5 100644 --- a/python-PyGithub.spec +++ b/python-PyGithub.spec @@ -17,6 +17,8 @@ Summary: Python library to work with the Github API License: LGPLv3+ URL: https://github.com/PyGithub/PyGithub Source0: %pypi_source +# https://github.com/PyGithub/PyGithub/pull/909 +Patch0: create_review-comments.patch BuildArch: noarch %global _description \ @@ -57,7 +59,7 @@ Obsoletes: python%{python3_pkgversion}-PyGithub < 1.29-8 %endif %prep -%setup -q -n %{srcname}-%{version} +%autosetup -p 1 -n %{srcname}-%{version} rm -rf %{eggname}.egg-info # this test needs network connection => kill it for Koji builds sed -i '/from Issue142 import \*/d' github/tests/AllTests.py @@ -121,6 +123,7 @@ popd %changelog * Wed Oct 03 2018 Carl George - 1.39-4 - Require python-jwt on RHEL, python2-jwt on Fedora rhbz#1634082 +- Add patch0 to ensure comments are included in create_review method rhbz#1633197 * Fri Jul 13 2018 Fedora Release Engineering - 1.39-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild