#3 Add patch fixing problem with configuration for flatpak builds
Closed 5 years ago by cverna. Opened 6 years ago by otaylor.
rpms/ otaylor/osbs-client flatpak-build-config-f27  into  f27

@@ -0,0 +1,54 @@ 

+ From 59794aaa1d3c1f36bd150da79ce6773f6ba82f32 Mon Sep 17 00:00:00 2001

+ From: "Owen W. Taylor" <otaylor@fishsoup.net>

+ Date: Thu, 15 Feb 2018 15:24:22 -0500

+ Subject: [PATCH] render_import_image: fix logic for checking

+  imagestream_name/url

+ 

+ The code was checking for spec.imagestream_name is None not

+ spec.imagestream_name.value is None - this was never noticed because

+ spec.imagestream_name is now always set except for Flatpak builds and

+ previously, a different check was removing the plugin first.

+ 

+ Check in tests that the plugin is properly removed for Flatpak builds.

+ ---

+  osbs/build/build_request.py        | 2 +-

+  tests/build_/test_build_request.py | 3 +++

+  2 files changed, 4 insertions(+), 1 deletion(-)

+ 

+ diff --git a/osbs/build/build_request.py b/osbs/build/build_request.py

+ index 66be128..5c77e7d 100644

+ --- a/osbs/build/build_request.py

+ +++ b/osbs/build/build_request.py

+ @@ -1300,7 +1300,7 @@ class BuildRequest(object):

+          """

+          phase = 'postbuild_plugins'

+          plugin = 'import_image'

+ -        if self.spec.imagestream_name is None or self.spec.imagestream_url is None:

+ +        if self.spec.imagestream_name.value is None or self.spec.imagestream_url.value is None:

+              logger.info("removing %s from request, "

+                          "registry or repo url is not defined", plugin)

+              self.dj.remove_plugin(phase, plugin)

+ diff --git a/tests/build_/test_build_request.py b/tests/build_/test_build_request.py

+ index 9fdfccc..a624468 100644

+ --- a/tests/build_/test_build_request.py

+ +++ b/tests/build_/test_build_request.py

+ @@ -1245,6 +1245,8 @@ class TestBuildRequest(object):

+          assert get_plugin(plugins, "prepublish_plugins", "flatpak_create_oci")

+          with pytest.raises(NoSuchPluginException):

+              assert get_plugin(plugins, "prepublish_plugins", "squash")

+ +        with pytest.raises(NoSuchPluginException):

+ +            assert get_plugin(plugins, "postbuild_plugins", "import_image")

+  

+      def test_render_prod_not_flatpak(self):

+          build_request = BuildRequest(INPUTS_PATH)

+ @@ -1283,6 +1285,7 @@ class TestBuildRequest(object):

+          with pytest.raises(NoSuchPluginException):

+              get_plugin(plugins, "prepublish_plugins", "flatpak_create_oci")

+          assert get_plugin(plugins, "prepublish_plugins", "squash")

+ +        assert get_plugin(plugins, "postbuild_plugins", "import_image")

+  

+      @pytest.mark.parametrize(('hub', 'disabled', 'release'), (

+          ('http://hub/', False, None),

+ -- 

+ 2.14.3

+ 

file modified
+9 -1
@@ -26,7 +26,7 @@ 

  %global shortcommit %(c=%{commit}; echo ${c:0:7})

  # set to 0 to create a normal release

  %global postrelease 0

- %global release 1

+ %global release 2

  

  %global osbs_obsolete_vr 0.14-2

  
@@ -44,6 +44,9 @@ 

  URL:            https://github.com/projectatomic/osbs-client

  Source0:        https://github.com/projectatomic/osbs-client/archive/%{commit}/osbs-client-%{commit}.tar.gz

  

+ # https://github.com/projectatomic/osbs-client/pull/730

+ Patch0:         flatpak-no-import-image.patch

+ 

  BuildArch:      noarch

  

  %if 0%{?with_python3}
@@ -159,6 +162,8 @@ 

  %prep

  %setup -qn %{name}-%{commit}

  

+ %patch0 -p1 -b .flatpak-no-import-image

+ 

  # Remove this test, it tries to hit httpbin.org which fails the build in koji

  rm -f tests/test_http.py

  
@@ -221,6 +226,9 @@ 

  %endif # with_python3

  

  %changelog

+ * Fri Feb 16 2018 Owen Taylor <otaylor@redhat.com> - 0.45-2

+ - Add patch fixing problem with configuration for flatpak builds

+ 

  * Thu Jan 18 2018 Clement Verna <cverna@fedoraproject.org> - 0.45-1

  - Update to latest upstream

  

let's close this since we now have version 0.47 available in rawhide and f28

Pull-Request has been closed by cverna

5 years ago