From c0c47ebb9d8695fc8ef11024e3f7c28c67102861 Mon Sep 17 00:00:00 2001
From: Jan Kaluza <jkaluza@redhat.com>
Date: May 30 2019 12:56:48 +0000
Subject: Disable TP or Beta images rebuild until we fix it.


---

diff --git a/freshmaker/handlers/koji/rebuild_images_on_rpm_advisory_change.py b/freshmaker/handlers/koji/rebuild_images_on_rpm_advisory_change.py
index 7328ac7..6939b27 100644
--- a/freshmaker/handlers/koji/rebuild_images_on_rpm_advisory_change.py
+++ b/freshmaker/handlers/koji/rebuild_images_on_rpm_advisory_change.py
@@ -384,7 +384,7 @@ class RebuildImagesOnRPMAdvisoryChange(ContainerBuildHandler):
         # published and release_categories if so.
         if self.event.is_allowed(self, published=True):
             published = True
-            release_categories = ("Generally Available", "Tech Preview", "Beta",)
+            release_categories = ("Generally Available", )
         else:
             published = None
             release_categories = None
diff --git a/freshmaker/lightblue.py b/freshmaker/lightblue.py
index 0f2b8f3..94a3480 100644
--- a/freshmaker/lightblue.py
+++ b/freshmaker/lightblue.py
@@ -676,7 +676,7 @@ class LightBlue(object):
 
     def _set_container_repository_filters(
             self, request, published=True,
-            release_categories=("Generally Available", "Tech Preview", "Beta",)):
+            release_categories=("Generally Available", )):
         """
         Sets the additional filters to containerRepository request
         based on the self.published, self.release_categories attributes.
@@ -705,7 +705,7 @@ class LightBlue(object):
 
     def find_all_container_repositories(
             self, published=True,
-            release_categories=("Generally Available", "Tech Preview", "Beta",)):
+            release_categories=("Generally Available", )):
         """
         Returns dict with repository name as key and ContainerRepository as
         value.
@@ -1206,7 +1206,7 @@ class LightBlue(object):
 
     def find_images_with_packages_from_content_set(
             self, srpm_nvrs, content_sets, filter_fnc=None, published=True,
-            release_categories=("Generally Available", "Tech Preview", "Beta",),
+            release_categories=("Generally Available", ),
             leaf_container_images=None):
         """Query lightblue and find containers which contain given
         package from one of content sets
@@ -1495,7 +1495,7 @@ class LightBlue(object):
 
     def find_images_to_rebuild(
             self, srpm_nvrs, content_sets, published=True,
-            release_categories=("Generally Available", "Tech Preview", "Beta",),
+            release_categories=("Generally Available", ),
             filter_fnc=None, leaf_container_images=None):
         """
         Find images to rebuild through image build layers
diff --git a/tests/handlers/koji/test_rebuild_images_on_rpm_advisory_change.py b/tests/handlers/koji/test_rebuild_images_on_rpm_advisory_change.py
index 6efefa2..0ac5497 100644
--- a/tests/handlers/koji/test_rebuild_images_on_rpm_advisory_change.py
+++ b/tests/handlers/koji/test_rebuild_images_on_rpm_advisory_change.py
@@ -439,7 +439,7 @@ class TestFindImagesToRebuild(helpers.FreshmakerTestCase):
         self.find_images_to_rebuild.assert_called_once_with(
             set(['httpd-2.4-11.el7']), ['content-set-1'],
             filter_fnc=self.handler._filter_out_not_allowed_builds,
-            published=True, release_categories=('Generally Available', 'Tech Preview', 'Beta'),
+            published=True, release_categories=('Generally Available', ),
             leaf_container_images=None)
 
     @patch.object(freshmaker.conf, 'handler_build_whitelist', new={
@@ -456,7 +456,7 @@ class TestFindImagesToRebuild(helpers.FreshmakerTestCase):
         self.find_images_to_rebuild.assert_called_once_with(
             set(['httpd-2.4-11.el7', 'httpd-2.2-11.el6']), ['content-set-1'],
             filter_fnc=self.handler._filter_out_not_allowed_builds,
-            published=True, release_categories=('Generally Available', 'Tech Preview', 'Beta'),
+            published=True, release_categories=('Generally Available', ),
             leaf_container_images=None)
 
     @patch.object(freshmaker.conf, 'handler_build_whitelist', new={
@@ -492,7 +492,7 @@ class TestFindImagesToRebuild(helpers.FreshmakerTestCase):
         self.find_images_to_rebuild.assert_called_once_with(
             set(['httpd-2.4-11.el7']), ['content-set-1'],
             filter_fnc=self.handler._filter_out_not_allowed_builds,
-            published=True, release_categories=('Generally Available', 'Tech Preview', 'Beta'),
+            published=True, release_categories=('Generally Available', ),
             leaf_container_images=None)
 
     @patch.object(freshmaker.conf, 'handler_build_whitelist', new={
@@ -510,5 +510,5 @@ class TestFindImagesToRebuild(helpers.FreshmakerTestCase):
         self.find_images_to_rebuild.assert_called_once_with(
             set(['httpd-2.4-11.el7']), ['content-set-1'],
             filter_fnc=self.handler._filter_out_not_allowed_builds,
-            published=True, release_categories=('Generally Available', 'Tech Preview', 'Beta'),
+            published=True, release_categories=('Generally Available', ),
             leaf_container_images=["foo", "bar"])
diff --git a/tests/test_lightblue.py b/tests/test_lightblue.py
index d47f34a..8fe2873 100644
--- a/tests/test_lightblue.py
+++ b/tests/test_lightblue.py
@@ -924,9 +924,7 @@ class TestQueryEntityFromLightBlue(helpers.FreshmakerTestCase):
                     },
                     {
                         "$or": [
-                            {"field": "release_categories.*", "rvalue": "Generally Available", "op": "="},
-                            {"field": "release_categories.*", "rvalue": "Tech Preview", "op": "="},
-                            {"field": "release_categories.*", "rvalue": "Beta", "op": "="}]
+                            {"field": "release_categories.*", "rvalue": "Generally Available", "op": "="}]
                     },
                 ]
             },

