#5 F29: Merge with master and apply workarounds from pull requests
Merged 3 months ago by churchyard. Opened 3 months ago by churchyard.
rpms/ churchyard/fedora-easy-karma hotfixes  into  f29

file modified
+1

@@ -4,3 +4,4 @@ 

  /fedora-easy-karma-0https0c81432c.tar.bz2

  /fedora-easy-karma-0httpsbc16e916.tar.bz2

  /fedora-easy-karma-0httpsa8fe9cbc.tar.bz2

+ /fedora-easy-karma-b6d97e0.tar.gz

file added
+74

@@ -0,0 +1,74 @@ 

+ From 984a7f68c9172f3429f80cb057fa4a602efd09a5 Mon Sep 17 00:00:00 2001

+ From: Kamil Páral <kparal@redhat.com>

+ Date: Jul 01 2019 14:31:18 +0000

+ Subject: ask user to open URL manually because of Bodhi bug

+ 

+ 

+ Because of [1] we can't add a comment from f-e-k. Until it is resolved,

+ ask the user to open the URL manually. This is very suboptimal, but it's

+ still better than be completely broken - at least the user is able to

+ figure out *which* updates he/she can comment on.

+ 

+ [1] https://github.com/fedora-infra/bodhi/issues/3298

+ 

+ ---

+ 

+ diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py

+ index 2dd7739..ae0e649 100755

+ --- a/fedora-easy-karma.py

+ +++ b/fedora-easy-karma.py

+ @@ -698,24 +698,35 @@ class FedoraEasyKarma(object):

+                                                self.options.fas_username):

+                          print("!!! already commented by you !!!")

+                      try:

+ -                        karma = self.raw_input(

+ -                            PROMPT, default=self.options.default_karma,

+ -                            add_to_history=False)

+ -                        if karma in ["-1", "0", "1"]:

+ -                            comment = self.raw_input(

+ -                                "Comment> ",

+ -                                default=self.options.default_comment)

+ -                            if comment or not self.options.skip_empty_comment:

+ -                                result = self.send_comment(bc, update, comment,

+ -                                                           karma)

+ -                                if not result[0]:

+ -                                    self.warning("Comment not submitted: %s" %

+ -                                                 result[1])

+ -                            else:

+ -                                print("skipped because of empty comment")

+ -                        elif karma == "i":

+ -                            ignored_updates.append(update.title)

+ -                            print("ignored as requested")

+ +                        while True:

+ +                            karma = self.raw_input(

+ +                                PROMPT, default=self.options.default_karma,

+ +                                add_to_history=False)

+ +                            if karma in ["-1", "0", "1"]:

+ +                                # Disable this temporarily

+ +                                # See: https://pagure.io/fedora-easy-karma/issue/6

+ +                                # See: https://github.com/fedora-infra/bodhi/issues/3298

+ +                                print("Posting karma to Bodhi unfortunatelly doesn't "

+ +                                    "work at the moment due to a Bodhi bug. Until it "

+ +                                    "is resolved, please open the URL shown above "

+ +                                    "manually and add a comment through the website, "

+ +                                    "thank you.")

+ +                                continue

+ +                                comment = self.raw_input(

+ +                                    "Comment> ",

+ +                                    default=self.options.default_comment)

+ +                                if comment or not self.options.skip_empty_comment:

+ +                                    result = self.send_comment(bc, update, comment,

+ +                                                               karma)

+ +                                    if not result[0]:

+ +                                        self.warning("Comment not submitted: %s" %

+ +                                                     result[1])

+ +                                else:

+ +                                    print("skipped because of empty comment")

+ +                            elif karma == "i":

+ +                                ignored_updates.append(update.title)

+ +                                print("ignored as requested")

+ +                            break

+  

+                      except EOFError:

+                          ignored_updates.extend(previously_ignored_updates)

+ 

file added
+50

@@ -0,0 +1,50 @@ 

+ From e039292195d491ccef283dcb96e911bb72fb9378 Mon Sep 17 00:00:00 2001

+ From: Miro Hrončok <miro@hroncok.cz>

+ Date: Jul 02 2019 21:21:26 +0000

+ Subject: Hotpatch for Bodhi 4

+ 

+ 

+ See https://bugzilla.redhat.com/show_bug.cgi?id=1714925

+ 

+ ---

+ 

+ diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py

+ index c1dfb61..b602905 100755

+ --- a/fedora-easy-karma.py

+ +++ b/fedora-easy-karma.py

+ @@ -190,8 +190,6 @@ class FEK_helper(object):

+  

+                  # the format of the user has changed, add a data member

+                  comment["username"] = comment["user"]["name"]

+ -                if comment["anonymous"]:

+ -                    comment["username"] += " (unauthenticated)"

+  

+                  comments.append(

+                      "%(indent)s%(username)s - %(timestamp)s "

+ @@ -222,6 +220,7 @@ class FEK_helper(object):

+              values["karma_status"] = "%d/%s" % (values["karma"],

+                                                  values["stable_karma"])

+  

+ +        values["submitter"] = values["user"]["name"]

+          return format_string % values

+  

+      @staticmethod

+ @@ -653,7 +652,7 @@ class FedoraEasyKarma(object):

+  

+              # Ignore own updates

+              if self.options.ignore_own and \

+ -                    update["submitter"] == self.options.fas_username:

+ +                    update["user"]["name"] == self.options.fas_username:

+                  continue

+  

+              if update not in processed_updates and \

+ @@ -773,7 +772,7 @@ class FedoraEasyKarma(object):

+  

+      def already_commented(self, update, user):

+          for comment in update["comments"]:

+ -            if not comment["anonymous"] and comment["user"]["name"] == user:

+ +            if comment["user"]["name"] == user:

+                  return True

+          return False

+  

+ 

file modified
+28 -35

@@ -1,43 +1,29 @@ 

  Name:           fedora-easy-karma

  Version:        0

- Release:        0.38.20171129gita8fe9cbc%{?dist}

+ Release:        0.41.20181206gitb6d97e0%{?dist}

  Summary:        Fedora update feedback made easy

- 

- Group:          Development/Tools

  License:        GPLv2+

  URL:            https://fedoraproject.org/wiki/Fedora_Easy_Karma

  

- #VCS: git:https://pagure.io/fedora-easy-karma.git

- ## current tarball

- # Updated using:

- # https://fedorapeople.org/cgit/walters/public_git/fedpkg-make-pull.git/

- # Commandline: fedpkg-vcs -f pull-retarget

- Source0:        fedora-easy-karma-0httpsa8fe9cbc.tar.bz2

- BuildArch:      noarch

+ # git clone https://pagure.io/fedora-easy-karma.git

+ # cd fedora-easy-karma

+ # git checkout b6d97e0

+ # git archive --format=tar.gz --prefix=fedora-easy-karma-b6d97e0/ HEAD > \

+ #     ../fedora-easy-karma-b6d97e0.tar.gz

+ Source0:        fedora-easy-karma-b6d97e0.tar.gz

  

- Requires:       python2-fedora

- # contains fedora_cert python module

- Requires:       fedora-cert

+ # ask user to open URL manually because of Bodhi bug

+ Patch7:         https://pagure.io/fedora-easy-karma/pull-request/7.patch

  

- # Use new bodhi client bindings if available

- %if 0%{?fedora} || 0%{?rhel}

- %if 0%{?fedora} < 29 || 0%{?rhel} >= 7

- Requires:       bodhi-client

- %endif

- %endif

+ # Hotpatch for Bodhi 4

+ Patch8:         https://pagure.io/fedora-easy-karma/pull-request/8.patch

  

- # With Fedora 29, the bodhi-client refers to the python3 client, therefore

- # require the python2 client explicitly

- %if 0%{?fedora} >= 29

- Requires:       python2-bodhi-client

- %endif

+ BuildArch:      noarch

+ BuildRequires:  python3-devel

  

- %if 0%{?fedora} >= 25

- # For Fedora 23 and newer, dnf is python3, then python2-dnf needs to required

- Requires:       python2-dnf

- %else

- Requires:       yum

- %endif

+ Requires:       python3-bodhi-client

+ Requires:       python3-dnf

+ Requires:       python3-fedora

  

  

  %description

@@ -46,11 +32,8 @@ 

  

  

  %prep

- %setup -q -n fedora-easy-karma-0httpsa8fe9cbc

- 

- 

- %build

- # Set useragent

+ %autosetup -p1 -n fedora-easy-karma-b6d97e0

+ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" fedora-easy-karma.py

  sed -i 's,useragent="Fedora Easy Karma/GIT",useragent="Fedora Easy Karma/%{version}-%{release}",' fedora-easy-karma.py

  

  

@@ -60,10 +43,20 @@ 

  

  %files

  %license gpl-2.0.txt gpl-3.0.txt

+ %doc README

  %{_bindir}/fedora-easy-karma

  

  

  %changelog

+ * Wed Jul 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0-0.41.20181206gitb6d97e0

+ - Apply workarounds from pull requests

+ 

+ * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.40.20181206gitb6d97e0

+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

+ 

+ * Wed Jan 09 2019 Miro Hrončok <mhroncok@redhat.com> - 0-0.39.20181206gitb6d97e0

+ - Switch to Python 3 (#1650648)

+ 

  * Thu Aug 09 2018 Till Maas <opensource@till.name> - 0-0.38.20171129gita8fe9cbc

  - Update Bodhi dependency for Fedora 29 and newer

  

file modified
+1 -1

@@ -1,1 +1,1 @@ 

- SHA512 (fedora-easy-karma-0httpsa8fe9cbc.tar.bz2) = 272e57eee5e1af5102edfd03786eb09e905f41863e50dc32f0a1d8095aa3dec69c25f4514d45129cecb7a5c5012dfae8284a4cf173361ea020ce8f768c8fb350

+ SHA512 (fedora-easy-karma-b6d97e0.tar.gz) = 6b9ed2e935fd4063155f7e750b6a3ac188fc82980a6c6a355789a17469dd31e7e657c61fc8b4662c170c991950d19257be96ca881506350902004fa9bbb10bdd