#403 Fix issues with display_name in bodhi
Merged 3 years ago by onosek. Opened 3 years ago by onosek.
onosek/fedpkg bodhi_tests  into  master

file modified
+3
@@ -56,6 +56,8 @@ 

  # This is required for security updates.

  # severity=unspecified

  

+ display_name=

+ 

  %(changelog)s

  # Here is where you give an explanation of your update.

  # Content can span multiple lines, as long as they are indented deeper than
@@ -692,6 +694,7 @@ 

          bodhi_args = {

              'nvr': nvr,

              'bugs': six.u(''),

+             'display_name': six.u(''),

              'descr': six.u(

                  'Here is where you give an explanation of your update.'),

              'request': self.args.request,

file modified
+16
@@ -128,6 +128,16 @@ 

          with io.open(clog_file, 'w', encoding='utf-8') as f:

              f.write(os.linesep.join(self.fake_clog))

  

+         # Get 'bodhi_client' version. Particular versions have differences

+         # across distributions.

+         self.bodhi_version = None

+         try:

+             version_object = pkg_resources.get_distribution('bodhi_client')

+             if version_object.has_version():

+                 self.bodhi_version = int(version_object.version.split('.')[0])

+         except pkg_resources.DistributionNotFound:

+             pass

+ 

      def tearDown(self):

          if os.path.exists('bodhi.template'):

              os.unlink('bodhi.template')
@@ -179,6 +189,7 @@ 

          expected_data = {

              'autokarma': 'True',

              'bugs': '1000,2000',

+             'display_name': six.u(''),

              'builds': ' {0} '.format(self.mock_nvr.return_value),

              'close_bugs': True,

              'request': 'testing',
@@ -195,6 +206,11 @@ 

          else:

              expected_data['notes'] = self.fake_clog[0]

  

+         # there wasn't the option in older releases of bodhi, but these

+         # releases are still active (epel7, epel8)

+         if self.bodhi_version <= 4:

+             del expected_data["display_name"]

+ 

          with patch('os.unlink') as unlink:

              cli.update()

  

file modified
-4
@@ -312,10 +312,6 @@ 

          koji_session.getBuildTarget.assert_called_once_with('rawhide')

          self.assertEqual('28', result)

  

-     def test_find_from_fedora_branches(self):

-         result = self.cmd._findmasterbranch()

-         self.assertEqual(28, result)

- 

      @patch('pyrpkg.Commands.anon_kojisession', new_callable=PropertyMock)

      @patch('pyrpkg.Commands.repo', new_callable=PropertyMock)

      def test_get_from_koji_for_the_last_chance(self, repo, anon_kojisession):

Bodhi version 5 adds 'display_name' option.
This change (first commit) already works as an active (released) patch. But its use required not to apply it into branches with older bodhi - epel7. When there is a requirement to have also epel8 (it has also an older version of bodhi), a separate update of branches is more and more complicated. Branches are more easily maintained when they are same. The second commit of the change makes unification of the branches possible.
During fedpkg update "display_name" option (when filled) is not working for older versions despite user can see it in the template.
The goal is not to make conditions on bodhi versions in the product. It was acceptable in tests.

rebased onto bb234a754301404fce2aa3dbb138851742a40857

3 years ago

rebased onto 7c8c2e2

3 years ago

Pull-Request has been merged by onosek

3 years ago