#409 Update ImageVerifier to match the current Lightblue code.
Merged 4 years ago by jkaluza. Opened 4 years ago by jkaluza.
jkaluza/freshmaker image-verifier-fixes  into  master

file modified
+8 -3
@@ -44,16 +44,21 @@ 

          Verifies the Lightblue ContainerRepository data.

          Raises ValueError in case of error.

          """

-         if "Generally Available" not in repo["release_categories"]:

+         categories = set(["Generally Available", "Tech Preview", "Beta"])

Can we make this come from a configuration value? This can be done a separate PR, or as a new issue.

I've created https://pagure.io/freshmaker/issue/410, I will assign it to @srieger. She does not have any Freshmaker task for this sprint.

+         if not set(repo["release_categories"]).intersection(categories):

              raise ValueError(

-                 "Only repositories with \"Generally Available\" release_categories can be "

-                 "rebuilt, but found %r." % repo["release_categories"])

+                 "Only repositories with one of %r release_categories can be "

+                 "rebuilt, but found %r." % (categories, repo["release_categories"]))

  

          if not repo["published"]:

              raise ValueError(

                  "Only published repositories can be rebuilt, but this repository is not "

                  "published.")

  

+         if "auto_rebuild_tags" not in repo:

+             raise ValueError(

+                 "The \"auto_rebuild_tags\" in COMET is not set.")

+ 

          if "auto_rebuild_tags" in repo and repo["auto_rebuild_tags"] == []:

              raise ValueError(

                  "The \"auto_rebuild_tags\" in COMET is set to an empty list, this means "

file modified
+9 -9
@@ -49,16 +49,16 @@ 

  

      def test_verify_repository_deprecated(self):

          self.lb.find_container_repositories.return_value = [{

-             "release_categories": "Deprecated",

+             "release_categories": ["Deprecated"],

              "published": True,

              "auto_rebuild_tags": "latest"}]

          six.assertRaisesRegex(

-             self, ValueError, r'.*but found \'Deprecated\'.',

+             self, ValueError, r'.*but found \[\'Deprecated\'\].',

              self.verifier.verify_repository, "foo/bar")

  

      def test_verify_repository_not_published(self):

          self.lb.find_container_repositories.return_value = [{

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": False,

              "auto_rebuild_tags": "latest"}]

          six.assertRaisesRegex(
@@ -67,7 +67,7 @@ 

  

      def test_verify_repository_no_auto_rebuild_tags(self):

          self.lb.find_container_repositories.return_value = [{

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": []}]

          six.assertRaisesRegex(
@@ -77,7 +77,7 @@ 

      def test_verify_repository_no_images(self):

          self.lb.find_container_repositories.return_value = [{

              "repository": "foo/bar",

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": ["latest"]}]

          self.lb.get_images_by_nvrs.return_value = []
@@ -88,7 +88,7 @@ 

      def test_verify_repository_no_content_sets(self):

          self.lb.find_container_repositories.return_value = [{

              "repository": "foo/bar",

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": ["latest"]}]

          self.lb.find_images_with_included_srpms.return_value = [{
@@ -101,7 +101,7 @@ 

      def test_verify_repository(self):

          self.lb.find_container_repositories.return_value = [{

              "repository": "foo/bar",

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": ["latest"]}]

          self.lb.find_images_with_included_srpms.return_value = [{
@@ -113,7 +113,7 @@ 

      def test_get_verify_image(self):

          self.lb.find_container_repositories.return_value = [{

              "repository": "foo/bar",

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": ["latest"]}]

          self.lb.get_images_by_nvrs.return_value = [{
@@ -137,7 +137,7 @@ 

      def test_verify_image_no_images(self):

          self.lb.find_container_repositories.return_value = [{

              "repository": "foo/bar",

-             "release_categories": "Generally Available",

+             "release_categories": ["Generally Available"],

              "published": True,

              "auto_rebuild_tags": ["latest"]}]

          self.lb.get_images_by_nvrs.return_value = []

Freshmaker now rebuilds also Tech Preview and Beta images.
Freshmaker also skips images without auto_rebuild_tags.

Can we make this come from a configuration value? This can be done a separate PR, or as a new issue.

I've created https://pagure.io/freshmaker/issue/410, I will assign it to @srieger. She does not have any Freshmaker task for this sprint.

Commit 90ae89e fixes this pull-request

Pull-Request has been merged by jkaluza

4 years ago

Pull-Request has been merged by jkaluza

4 years ago