Repository: fedora-infra/bodhi

Issue:
Documentation fails to build with Sphinx 4.2.0
Hey,
I'm preparing the update of Sphinx to 4.2.0 in Fedora Rawhide.
Documentation of `bodhi` v. 5.7.0 fails to build against this Sphinx' version.

The build output is:
```
+ make -j2 -C docs html
make: Entering directory '/builddir/build/BUILD/bodhi-5.7.0/docs'
Running Sphinx v4.2.0
making output directory... done
[autosummary] generating autosummary for: administration.rst, developer/index.rst, developer/models.rst, developer/releases.rst, developer/vagrant.rst, developer/vagrant_vscode.rst, developer/virtualenv.rst, generated/buildroot_override.rst, generated/compose.rst, generated/errata.rst, ..., user/man_pages/bodhi-sar.rst, user/man_pages/bodhi-shell.rst, user/man_pages/bodhi-skopeo-lite.rst, user/man_pages/bodhi-untag-branched.rst, user/man_pages/bodhi.rst, user/man_pages/index.rst, user/man_pages/initialize_bodhi_db.rst, user/release_notes.rst, user/testing.rst, user/update_states.rst
[autosummary] generating autosummary for: /builddir/build/BUILD/bodhi-5.7.0/docs/developer/docblocks/bodhi.server.models.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 47 source files that are out of date
updating environment: [new config] 48 added, 0 changed, 0 removed
reading sources... [  2%] administration
reading sources... [  4%] developer/docblocks/bodhi.server.models
/usr/lib/python3.10/site-packages/sphinx/util/inspect.py:423: SAWarning: relationship 'Compose.updates' will copy column composes.release_id to column updates.release_id, which conflicts with relationship(s): 'Update.release' (copies releases.id to updates.release_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="release"' to the 'Compose.updates' relationship.
  return getattr(obj, name, *defargs)
/usr/lib/python3.10/site-packages/sphinx/util/inspect.py:423: SAWarning: relationship 'Update.compose' will copy column composes.release_id to column updates.release_id, which conflicts with relationship(s): 'Update.release' (copies releases.id to updates.release_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="release"' to the 'Update.compose' relationship.
  return getattr(obj, name, *defargs)
reading sources... [  6%] developer/index
reading sources... [  8%] developer/models
reading sources... [ 10%] developer/releases
reading sources... [ 12%] developer/vagrant
reading sources... [ 14%] developer/vagrant_vscode
reading sources... [ 16%] developer/virtualenv
reading sources... [ 18%] generated/buildroot_override
reading sources... [ 20%] generated/compose
reading sources... [ 22%] generated/errata
reading sources... [ 25%] generated/update
reading sources... [ 27%] index
reading sources... [ 29%] python_bindings
reading sources... [ 31%] server_api/graphql/documentation
reading sources... [ 33%] server_api/index
reading sources... [ 35%] server_api/messages/base
reading sources... [ 37%] server_api/messages/buildroot_override
reading sources... [ 39%] server_api/messages/compose
reading sources... [ 41%] server_api/messages/errata
reading sources... [ 43%] server_api/messages/update
reading sources... [ 45%] server_api/rest/builds
<>:21: (WARNING/2) Definition list ends without a blank line; unexpected unindent.
<>:37: (WARNING/2) Field list ends without a blank line; unexpected unindent.
<>:42: (WARNING/2) Definition list ends without a blank line; unexpected unindent.
<>:47: (WARNING/2) Definition list ends without a blank line; unexpected unindent.
<snip - a lot of warnings as above ^>
reading sources... [100%] user/update_states
Warning, treated as error:
/builddir/build/BUILD/bodhi-5.7.0/bodhi/server/models.py:docstring of bodhi.server.models.Compose.id:1:duplicate object description of bodhi.server.models.Compose.id, other instance in developer/docblocks/bodhi.server.models, use :noindex: for one of them
make: *** [Makefile:51: html] Error 2
make: Leaving directory '/builddir/build/BUILD/bodhi-5.7.0/docs'
```



Sphinx v4 will break documentation build
FESCO is [considering](https://pagure.io/fesco/issue/2620) to upgrade Sphinx to v4 in F35, this will break documentation build (and so Koji builds), because cornice_sphinx module doesn't seem to be compatible with it.

We already have seen this lately in pip CI tests failures (see #4226 ).
It will need someone with better python skills than me to find a solution.


Discussion:

Resolving patch:
diff --git a/bodhi/server/models.py b/bodhi/server/models.py
--- a/bodhi/server/models.py
+++ b/bodhi/server/models.py
@@ -794,7 +794,6 @@ class Release(Base):
         mail_template (str): The notification mail template.
         state (:class:`ReleaseState`): The current state of the release. Defaults to
             ``ReleaseState.disabled``.
-        id (int): The primary key of this release.
         builds (sqlalchemy.orm.collections.InstrumentedList): An iterable of :class:`Builds <Build>`
             associated with this release.
         composed_by_bodhi (bool): The flag that indicates whether the release is composed by
@@ -4178,8 +4177,6 @@ class Compose(Base):
             reached.
         date_created (datetime.datetime): The time this Compose was created.
         error_message (str): An error message indicating what happened if the Compose failed.
-        id (None): We don't want the superclass's primary key since we will use a natural primary
-            key for this model.
         release_id (int): The primary key of the :class:`Release` that is being composed. Forms half
             of the primary key, with the other half being the ``request``.
         request (UpdateRequest): The request of the release that is being composed. Forms half of
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,6 @@
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = [
-    'cornice_sphinx',
     'sphinx.ext.autodoc',
     'sphinx.ext.autosummary',
     'sphinx.ext.coverage',


Test patch: