We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Side tag updates are not automatically pushed to testing 
When I create a side tag update for a stable Fedora, it sits in pending until I manually click "push to testing". This is inconsistent with regular updates and a tad confusing.

See also https://pagure.io/fedora-infrastructure/issue/8930

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bodhi/server/consumers/signed.py`
Content:
```
1 # Copyright © 2016-2019 Red Hat, Inc.
2 #
3 # This file is part of Bodhi.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # this program; if not, write to the Free Software Foundation, Inc., 51
17 # Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 """
19 The "signed handler".
20 
21 This module is responsible for marking builds as "signed" when they get moved
22 from the pending-signing to pending-updates-testing tag by RoboSignatory.
23 """
24 
25 import logging
26 
27 import fedora_messaging
28 from sqlalchemy import func
29 
30 from bodhi.server.config import config
31 from bodhi.server.models import Build, UpdateStatus, TestGatingStatus
32 from bodhi.server.util import transactional_session_maker
33 
34 log = logging.getLogger('bodhi')
35 
36 
37 class SignedHandler(object):
38     """
39     The Bodhi Signed Handler.
40 
41     A fedora-messaging listener waiting for messages from koji about builds being tagged.
42     """
43 
44     def __init__(self):
45         """Initialize the SignedHandler."""
46         self.db_factory = transactional_session_maker()
47 
48     def __call__(self, message: fedora_messaging.api.Message):
49         """
50         Handle messages arriving with the configured topic.
51 
52         This marks a build as signed if it is assigned to the pending testing release tag.
53 
54         Example message format::
55             {
56                 'body': {
57                     'build_id': 442562,
58                     'name': 'colord',
59                     'tag_id': 214,
60                     'instance': 's390',
61                     'tag': 'f26-updates-testing-pending',
62                     'user': 'sharkcz',
63                     'version': '1.3.4',
64                     'owner': 'sharkcz',
65                     'release': '1.fc26'
66                 },
67             }
68 
69         The message can contain additional keys.
70 
71         Duplicate messages: this method is idempotent.
72 
73         Args:
74             message: The incoming message in the format described above.
75         """
76         message = message.body
77         build_nvr = '%(name)s-%(version)s-%(release)s' % message
78         tag = message['tag']
79 
80         log.info("%s tagged into %s" % (build_nvr, tag))
81 
82         with self.db_factory() as dbsession:
83             build = Build.get(build_nvr)
84             if not build:
85                 log.info("Build was not submitted, skipping")
86                 return
87 
88             if not build.release:
89                 log.info('Build is not assigned to release, skipping')
90                 return
91 
92             if build.update and build.update.from_tag:
93                 koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag)
94                 if tag != koji_testing_tag:
95                     log.info("Tag is not testing side tag, skipping")
96                     return
97             else:
98                 if build.release.pending_testing_tag != tag:
99                     log.info("Tag is not pending_testing tag, skipping")
100                     return
101 
102             if build.signed:
103                 log.info("Build was already marked as signed (maybe a duplicate message)")
104                 return
105 
106             # This build was moved into the pending_testing tag for the applicable release, which
107             # is done by RoboSignatory to indicate that the build has been correctly signed and
108             # written out. Mark it as such.
109             log.info("Build has been signed, marking")
110             build.signed = True
111             dbsession.flush()
112             log.info("Build %s has been marked as signed" % build_nvr)
113 
114             # If every build in update is signed change status to testing
115             if build.update \
116                     and not build.update.release.composed_by_bodhi \
117                     and build.update.signed:
118                 log.info("Every build in update is signed, set status to testing")
119 
120                 build.update.status = UpdateStatus.testing
121                 build.update.date_testing = func.current_timestamp()
122                 build.update.request = None
123                 build.update.pushed = True
124 
125                 if config.get("test_gating.required"):
126                     log.debug('Test gating is required, marking the update as waiting on test '
127                               'gating and updating it from Greenwave to get the real status.')
128                     build.update.test_gating_status = TestGatingStatus.waiting
129                     build.update.update_test_gating_status()
130 
131                 log.info(f"Update {build.update.display_name} status has been set to testing")
132
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bodhi/server/consumers/signed.py b/bodhi/server/consumers/signed.py
--- a/bodhi/server/consumers/signed.py
+++ b/bodhi/server/consumers/signed.py
@@ -89,7 +89,9 @@
                 log.info('Build is not assigned to release, skipping')
                 return
 
-            if build.update and build.update.from_tag:
+            if build.update \
+               and build.update.from_tag \
+               and not build.update.release.composed_by_bodhi:
                 koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag)
                 if tag != koji_testing_tag:
                     log.info("Tag is not testing side tag, skipping")

{"golden_diff": "diff --git a/bodhi/server/consumers/signed.py b/bodhi/server/consumers/signed.py\n--- a/bodhi/server/consumers/signed.py\n+++ b/bodhi/server/consumers/signed.py\n@@ -89,7 +89,9 @@\n                 log.info('Build is not assigned to release, skipping')\n                 return\n \n-            if build.update and build.update.from_tag:\n+            if build.update \\\n+               and build.update.from_tag \\\n+               and not build.update.release.composed_by_bodhi:\n                 koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag)\n                 if tag != koji_testing_tag:\n                     log.info(\"Tag is not testing side tag, skipping\")\n", "issue": "Side tag updates are not automatically pushed to testing \nWhen I create a side tag update for a stable Fedora, it sits in pending until I manually click \"push to testing\". This is inconsistent with regular updates and a tad confusing.\r\n\r\nSee also https://pagure.io/fedora-infrastructure/issue/8930\n", "before_files": [{"content": "# Copyright \u00a9 2016-2019 Red Hat, Inc.\n#\n# This file is part of Bodhi.\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License along with\n# this program; if not, write to the Free Software Foundation, Inc., 51\n# Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\"\"\"\nThe \"signed handler\".\n\nThis module is responsible for marking builds as \"signed\" when they get moved\nfrom the pending-signing to pending-updates-testing tag by RoboSignatory.\n\"\"\"\n\nimport logging\n\nimport fedora_messaging\nfrom sqlalchemy import func\n\nfrom bodhi.server.config import config\nfrom bodhi.server.models import Build, UpdateStatus, TestGatingStatus\nfrom bodhi.server.util import transactional_session_maker\n\nlog = logging.getLogger('bodhi')\n\n\nclass SignedHandler(object):\n    \"\"\"\n    The Bodhi Signed Handler.\n\n    A fedora-messaging listener waiting for messages from koji about builds being tagged.\n    \"\"\"\n\n    def __init__(self):\n        \"\"\"Initialize the SignedHandler.\"\"\"\n        self.db_factory = transactional_session_maker()\n\n    def __call__(self, message: fedora_messaging.api.Message):\n        \"\"\"\n        Handle messages arriving with the configured topic.\n\n        This marks a build as signed if it is assigned to the pending testing release tag.\n\n        Example message format::\n            {\n                'body': {\n                    'build_id': 442562,\n                    'name': 'colord',\n                    'tag_id': 214,\n                    'instance': 's390',\n                    'tag': 'f26-updates-testing-pending',\n                    'user': 'sharkcz',\n                    'version': '1.3.4',\n                    'owner': 'sharkcz',\n                    'release': '1.fc26'\n                },\n            }\n\n        The message can contain additional keys.\n\n        Duplicate messages: this method is idempotent.\n\n        Args:\n            message: The incoming message in the format described above.\n        \"\"\"\n        message = message.body\n        build_nvr = '%(name)s-%(version)s-%(release)s' % message\n        tag = message['tag']\n\n        log.info(\"%s tagged into %s\" % (build_nvr, tag))\n\n        with self.db_factory() as dbsession:\n            build = Build.get(build_nvr)\n            if not build:\n                log.info(\"Build was not submitted, skipping\")\n                return\n\n            if not build.release:\n                log.info('Build is not assigned to release, skipping')\n                return\n\n            if build.update and build.update.from_tag:\n                koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag)\n                if tag != koji_testing_tag:\n                    log.info(\"Tag is not testing side tag, skipping\")\n                    return\n            else:\n                if build.release.pending_testing_tag != tag:\n                    log.info(\"Tag is not pending_testing tag, skipping\")\n                    return\n\n            if build.signed:\n                log.info(\"Build was already marked as signed (maybe a duplicate message)\")\n                return\n\n            # This build was moved into the pending_testing tag for the applicable release, which\n            # is done by RoboSignatory to indicate that the build has been correctly signed and\n            # written out. Mark it as such.\n            log.info(\"Build has been signed, marking\")\n            build.signed = True\n            dbsession.flush()\n            log.info(\"Build %s has been marked as signed\" % build_nvr)\n\n            # If every build in update is signed change status to testing\n            if build.update \\\n                    and not build.update.release.composed_by_bodhi \\\n                    and build.update.signed:\n                log.info(\"Every build in update is signed, set status to testing\")\n\n                build.update.status = UpdateStatus.testing\n                build.update.date_testing = func.current_timestamp()\n                build.update.request = None\n                build.update.pushed = True\n\n                if config.get(\"test_gating.required\"):\n                    log.debug('Test gating is required, marking the update as waiting on test '\n                              'gating and updating it from Greenwave to get the real status.')\n                    build.update.test_gating_status = TestGatingStatus.waiting\n                    build.update.update_test_gating_status()\n\n                log.info(f\"Update {build.update.display_name} status has been set to testing\")\n", "path": "bodhi/server/consumers/signed.py"}], "after_files": [{"content": "# Copyright \u00a9 2016-2019 Red Hat, Inc.\n#\n# This file is part of Bodhi.\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License along with\n# this program; if not, write to the Free Software Foundation, Inc., 51\n# Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\"\"\"\nThe \"signed handler\".\n\nThis module is responsible for marking builds as \"signed\" when they get moved\nfrom the pending-signing to pending-updates-testing tag by RoboSignatory.\n\"\"\"\n\nimport logging\n\nimport fedora_messaging\nfrom sqlalchemy import func\n\nfrom bodhi.server.config import config\nfrom bodhi.server.models import Build, UpdateStatus, TestGatingStatus\nfrom bodhi.server.util import transactional_session_maker\n\nlog = logging.getLogger('bodhi')\n\n\nclass SignedHandler(object):\n    \"\"\"\n    The Bodhi Signed Handler.\n\n    A fedora-messaging listener waiting for messages from koji about builds being tagged.\n    \"\"\"\n\n    def __init__(self):\n        \"\"\"Initialize the SignedHandler.\"\"\"\n        self.db_factory = transactional_session_maker()\n\n    def __call__(self, message: fedora_messaging.api.Message):\n        \"\"\"\n        Handle messages arriving with the configured topic.\n\n        This marks a build as signed if it is assigned to the pending testing release tag.\n\n        Example message format::\n            {\n                'body': {\n                    'build_id': 442562,\n                    'name': 'colord',\n                    'tag_id': 214,\n                    'instance': 's390',\n                    'tag': 'f26-updates-testing-pending',\n                    'user': 'sharkcz',\n                    'version': '1.3.4',\n                    'owner': 'sharkcz',\n                    'release': '1.fc26'\n                },\n            }\n\n        The message can contain additional keys.\n\n        Duplicate messages: this method is idempotent.\n\n        Args:\n            message: The incoming message in the format described above.\n        \"\"\"\n        message = message.body\n        build_nvr = '%(name)s-%(version)s-%(release)s' % message\n        tag = message['tag']\n\n        log.info(\"%s tagged into %s\" % (build_nvr, tag))\n\n        with self.db_factory() as dbsession:\n            build = Build.get(build_nvr)\n            if not build:\n                log.info(\"Build was not submitted, skipping\")\n                return\n\n            if not build.release:\n                log.info('Build is not assigned to release, skipping')\n                return\n\n            if build.update \\\n               and build.update.from_tag \\\n               and not build.update.release.composed_by_bodhi:\n                koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag)\n                if tag != koji_testing_tag:\n                    log.info(\"Tag is not testing side tag, skipping\")\n                    return\n            else:\n                if build.release.pending_testing_tag != tag:\n                    log.info(\"Tag is not pending_testing tag, skipping\")\n                    return\n\n            if build.signed:\n                log.info(\"Build was already marked as signed (maybe a duplicate message)\")\n                return\n\n            # This build was moved into the pending_testing tag for the applicable release, which\n            # is done by RoboSignatory to indicate that the build has been correctly signed and\n            # written out. Mark it as such.\n            log.info(\"Build has been signed, marking\")\n            build.signed = True\n            dbsession.flush()\n            log.info(\"Build %s has been marked as signed\" % build_nvr)\n\n            # If every build in update is signed change status to testing\n            if build.update \\\n                    and not build.update.release.composed_by_bodhi \\\n                    and build.update.signed:\n                log.info(\"Every build in update is signed, set status to testing\")\n\n                build.update.status = UpdateStatus.testing\n                build.update.date_testing = func.current_timestamp()\n                build.update.request = None\n                build.update.pushed = True\n\n                if config.get(\"test_gating.required\"):\n                    log.debug('Test gating is required, marking the update as waiting on test '\n                              'gating and updating it from Greenwave to get the real status.')\n                    build.update.test_gating_status = TestGatingStatus.waiting\n                    build.update.update_test_gating_status()\n\n                log.info(f\"Update {build.update.display_name} status has been set to testing\")\n", "path": "bodhi/server/consumers/signed.py"}]}