From bc7bc41c0587aff7a4cb877a9f659c0200ce5cfc Mon Sep 17 00:00:00 2001
From: Mattia Verga <mattia.verga@tiscali.it>
Date: Sun, 5 Dec 2021 14:47:13 +0100
Subject: [PATCH] Fix docbuild with Sphinx 4
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
---
.gitignore | 1 +
bodhi/server/models.py | 3 -
devel/ansible/roles/bodhi/tasks/main.yml | 1 -
devel/ci/Dockerfile-f34 | 2 +-
devel/ci/Dockerfile-f35 | 2 +-
devel/ci/Dockerfile-pip | 3 +-
devel/ci/Dockerfile-rawhide | 2 +-
docs/conf.py | 1 -
docs/server_api/graphql/documentation.rst | 185 ----------------------
docs/server_api/index.rst | 37 +----
docs/server_api/rest/builds.rst | 6 -
docs/server_api/rest/comments.rst | 6 -
docs/server_api/rest/composes.rst | 10 --
docs/server_api/rest/csrf.rst | 6 -
docs/server_api/rest/markdown.rst | 6 -
docs/server_api/rest/overrides.rst | 7 -
docs/server_api/rest/packages.rst | 6 -
docs/server_api/rest/releases.rst | 6 -
docs/server_api/rest/schemas.rst | 10 --
docs/server_api/rest/updates.rst | 6 -
docs/server_api/rest/users.rst | 6 -
docs/user/3.x_release_notes.rst | 2 +-
22 files changed, 7 insertions(+), 307 deletions(-)
delete mode 100644 docs/server_api/graphql/documentation.rst
delete mode 100644 docs/server_api/rest/builds.rst
delete mode 100644 docs/server_api/rest/comments.rst
delete mode 100644 docs/server_api/rest/composes.rst
delete mode 100644 docs/server_api/rest/csrf.rst
delete mode 100644 docs/server_api/rest/markdown.rst
delete mode 100644 docs/server_api/rest/overrides.rst
delete mode 100644 docs/server_api/rest/packages.rst
delete mode 100644 docs/server_api/rest/releases.rst
delete mode 100644 docs/server_api/rest/schemas.rst
delete mode 100644 docs/server_api/rest/updates.rst
delete mode 100644 docs/server_api/rest/users.rst
diff --git a/.gitignore b/.gitignore
index a23e344e..e162d74d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
# Files to be ignored by all git checkouts
+*.directory
*.egg*
*.pyc
*.pyo
diff --git a/bodhi/server/models.py b/bodhi/server/models.py
index 7f669904..a2a64f18 100644
--- 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/devel/ansible/roles/bodhi/tasks/main.yml b/devel/ansible/roles/bodhi/tasks/main.yml
index a66df842..75c40e21 100644
--- a/devel/ansible/roles/bodhi/tasks/main.yml
+++ b/devel/ansible/roles/bodhi/tasks/main.yml
@@ -32,7 +32,6 @@
- python3-colander
- python3-conu
- python3-cornice
- - python3-cornice-sphinx
- python3-createrepo_c
- python3-diff-cover
- python3-dogpile-cache
diff --git a/devel/ci/Dockerfile-f34 b/devel/ci/Dockerfile-f34
index 2eb7def9..6ef12a0a 100644
--- a/devel/ci/Dockerfile-f34
+++ b/devel/ci/Dockerfile-f34
@@ -17,7 +17,6 @@ RUN dnf install -y \
python3-click \
python3-colander \
python3-cornice \
- python3-cornice-sphinx \
python3-createrepo_c \
python3-diff-cover \
python3-dnf \
@@ -42,6 +41,7 @@ RUN dnf install -y \
python3-pytest-cov \
python3-responses \
python3-simplemediawiki \
+ python3-sphinx \
python3-sqlalchemy \
python3-sqlalchemy_schemadisplay \
python3-waitress \
diff --git a/devel/ci/Dockerfile-f35 b/devel/ci/Dockerfile-f35
index eb1d0e70..b6bfd735 100644
--- a/devel/ci/Dockerfile-f35
+++ b/devel/ci/Dockerfile-f35
@@ -20,7 +20,6 @@ RUN dnf install -y \
python3-click \
python3-colander \
python3-cornice \
- python3-cornice-sphinx \
python3-createrepo_c \
python3-diff-cover \
python3-dnf \
@@ -45,6 +44,7 @@ RUN dnf install -y \
python3-pytest-cov \
python3-responses \
python3-simplemediawiki \
+ python3-sphinx \
python3-sqlalchemy \
python3-sqlalchemy_schemadisplay \
python3-waitress \
diff --git a/devel/ci/Dockerfile-pip b/devel/ci/Dockerfile-pip
index 05cbae57..bfa1568c 100644
--- a/devel/ci/Dockerfile-pip
+++ b/devel/ci/Dockerfile-pip
@@ -29,7 +29,6 @@ COPY requirements.txt /bodhi/requirements.txt
RUN pip-3 install -r /bodhi/requirements.txt
RUN pip-3 install \
alembic \
- cornice_sphinx \
diff-cover \
docutils \
flake8 \
@@ -38,7 +37,7 @@ RUN pip-3 install \
pydocstyle \
pytest \
pytest-cov \
- 'sphinx<4.0' \
+ sphinx \
sqlalchemy_schemadisplay \
urllib3 \
webtest
diff --git a/devel/ci/Dockerfile-rawhide b/devel/ci/Dockerfile-rawhide
index 0f4c9bb4..dc2a6f39 100644
--- a/devel/ci/Dockerfile-rawhide
+++ b/devel/ci/Dockerfile-rawhide
@@ -20,7 +20,6 @@ RUN dnf install -y \
python3-click \
python3-colander \
python3-cornice \
- python3-cornice-sphinx \
python3-createrepo_c \
python3-diff-cover \
python3-dnf \
@@ -45,6 +44,7 @@ RUN dnf install -y \
python3-pytest-cov \
python3-responses \
python3-simplemediawiki \
+ python3-sphinx \
python3-sqlalchemy \
python3-sqlalchemy_schemadisplay \
python3-waitress \
diff --git a/docs/conf.py b/docs/conf.py
index 9b3ee7c1..56836d27 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,6 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'
# 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',
diff --git a/docs/server_api/graphql/documentation.rst b/docs/server_api/graphql/documentation.rst
deleted file mode 100644
index ba068e3f..00000000
--- a/docs/server_api/graphql/documentation.rst
+++ /dev/null
@@ -1,185 +0,0 @@
-=====================
-Using the GraphQL API
-=====================
-
-This provides the documentation on how to use the GraphiQL client to query Bodhi's resources.
-
-The Basics
-==========
-
-The GraphQL API assists in getting data in and out of* Bodhi. It's an HTTP-based API that can be
-used to query & post data. It's composed of:
-
-- **Node** : An individual object. (Eg: Release, Update, etc.)
-- **Edge** : A connection between a collection of objects and a single object. (Eg: Releases in an Update)
-- **Field** : Data/attributes of an object. (Eg: id_prefix of a Release)
-
-You can implement GraphQL queries by either sending POST requests using CURL to the /graphql
-endpoint, or using the GraphiQL client.
-
-
-Using the GraphiQL Client
--------------------------
-
-GraphiQL is a GUI for editing and testing GraphQL queries and mutations cleanly.
-
-On the left side of the interface, you can enter traditional GraphQL queries. On the right
-tab, you will see the consequent data rendered.
-
-
-GraphQL Query/Response Structure
---------------------------------
-
-A typical GraphQL query looks like this
-
-::
-
- { nameOfQuery(optionalArgument: argumentValue){
- fieldDesired
- }
- }
-
-
-A typical GraphQL data response looks like this
-
-::
-
- { "data":{
- "nameOfQuery": [
- {
- "fieldDesired": value
- }
- ]
- }
- }
-
-
-Available Queries
-=================
-
-``nameOfQuery`` can be replaced with ``allReleases``, ``getRelease``, and ``getUpdate``.
-
-allReleases
------------
-.. list-table::
- :widths: 28 72
- :header-rows: 0
-
- * - **Description**
- - Query all releases in Bodhi.
- * - **Object**
- - bodhi.server.models.release
- * - **Fields Available**
- - name, longName, version, id_prefix, branch, distTag, stableTag, testingTag, candidateTag,
- pendingSigningTag, pendingTestingTag, PendingStableTag, OverrideTag, mailTemplate, state, id,
- composedByBodhi, createAutomaticUpdates, packageManager, testingRepository
- * - **Curl Request**
- - ``curl -H 'Content-Type: application/json' -X POST -d '{"query": "query {allReleases {name state}}"}' https://bodhi.fedoraproject.org/graphql``
- * - **GraphiQL Client Query**
- - ::
-
- { allReleases {
- name
- state
- }
- }
- * - **Output**
- - ::
-
- {
- "data": {
- "allReleases": [
- {
- "name": "F32C",
- "state": "current"
- },
- {
- "name": "F33",
- "state": "pending"
- },
- ..
- ..
- }
- }
-
-
-getRelease
-----------
-.. list-table::
- :widths: 28 72
- :header-rows: 0
-
- * - **Description**
- - Query specific releases in Bodhi using arguments as a filter.
- * - **Object**
- - bodhi.server.models.release
- * - **Valid Arguments**
- - idPrefix, name, composedByBodhi, state
- * - **Fields Available**
- - name, longName, version, id_prefix, branch, distTag, stableTag, testingTag, candidateTag,
- pendingSigningTag, pendingTestingTag, PendingStableTag, OverrideTag, mailTemplate, state, id,
- composedByBodhi, createAutomaticUpdates, packageManager, testingRepository
- * - **Curl Request**
- - ``curl -H 'Content-Type: application/json' -X POST -d '{"query": "query{getRelease(composedByBodhi: true, name: "F22"){name state}}"}' https://bodhi.fedoraproject.org/graphql``
- * - **GraphiQL Client Query**
- - ::
-
- { getReleases(composedByBodhi: true, name: "F22"){
- name
- state
- }
- }
- * - **Output**
- - ::
-
- {
- "data": {
- "getReleases": [
- {
- "name": "F22",
- "state": "archived"
- }
- ]
- }
- }
-
-
-getUpdate
----------
-.. list-table::
- :widths: 28 72
- :header-rows: 0
-
- * - **Description**
- - Query specific updates in Bodhi using arguments as a filter.
- * - **Object**
- - bodhi.server.models.update
- * - **Valid Arguments**
- - stableKarma, unstableKarma, stableDays, updateType, status, request, severity, pushed,
- critpath, dateApproved, alias, releaseId, userId, testGatingStatus, FromTag
- * - **Fields Available**
- - autoKarma, autotime, stableKarma, unstableKarma, stableDays, requirements, requireBugs,
- requireTestCases, displayName, notes, updateType, status, request, severity, locked, pushed,
- critpath, closeBugs, dateSubmitted, dateModified, dateApproved, datePushed, dateTesting,
- dateStable, alias, releaseId, userId, testGatingStatus, FromTag
- * - **Curl Request**
- - ``curl -H 'Content-Type: application/json' -X POST -d '{"query": "query{getUpdate(userId: 5136){critpath}}"}' https://bodhi.fedoraproject.org/graphql``
- * - **GraphiQL Client Query**
- - ::
-
- { getUpdate(userId: 5136){
- critpath
- }
- }
- * - **Output**
- - ::
-
- {
- "data": {
- "getUpdates": [
- {
- "critpath": false
- }
- ]
- }
- }
diff --git a/docs/server_api/index.rst b/docs/server_api/index.rst
index 06c7991e..eabbe8f2 100644
--- a/docs/server_api/index.rst
+++ b/docs/server_api/index.rst
@@ -26,39 +26,4 @@ schemas via `JSON Schema`_.
messages/update
-REST API
-========
-
-This section of the documentation describes Bodhi's REST API. You can read about the various
-sections of the API by following the links below:
-
-
-.. toctree::
- :maxdepth: 2
-
- rest/builds
- rest/comments
- rest/composes
- rest/csrf
- rest/markdown
- rest/overrides
- rest/packages
- rest/releases
- rest/schemas
- rest/updates
- rest/users
-
-
-.. _JSON Schema: https://json-schema.org/
-
-GRAPHQL API
-===========
-
-This section of the documentation describes Bodhi's GraphQL API. You can read about the various
-sections of the API by following the links below:
-
-
-.. toctree::
- :maxdepth: 2
-
- graphql/documentation
\ No newline at end of file
+.. _JSON Schema: https://json-schema.org/
\ No newline at end of file
diff --git a/docs/server_api/rest/builds.rst b/docs/server_api/rest/builds.rst
deleted file mode 100644
index f70aa573..00000000
--- a/docs/server_api/rest/builds.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Builds
-======
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.builds
- :services: build, builds
diff --git a/docs/server_api/rest/comments.rst b/docs/server_api/rest/comments.rst
deleted file mode 100644
index b70afcb3..00000000
--- a/docs/server_api/rest/comments.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Comments
-========
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.comments
- :services: comment, comments, comments_rss
diff --git a/docs/server_api/rest/composes.rst b/docs/server_api/rest/composes.rst
deleted file mode 100644
index b6c4b82c..00000000
--- a/docs/server_api/rest/composes.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Composes
-========
-
-``cornice_sphinx`` does `not <https://github.com/Cornices/cornice.ext.sphinx/issues/15>`_ yet have
-the ability to render documentation for the ``/composes/`` API, so we will include docblock
-documentation for that service here instead.
-
-
-.. autoclass:: bodhi.server.services.composes.Composes
- :members:
diff --git a/docs/server_api/rest/csrf.rst b/docs/server_api/rest/csrf.rst
deleted file mode 100644
index d8488178..00000000
--- a/docs/server_api/rest/csrf.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-CSRF
-====
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.csrf
- :services: csrf
diff --git a/docs/server_api/rest/markdown.rst b/docs/server_api/rest/markdown.rst
deleted file mode 100644
index d89b52ce..00000000
--- a/docs/server_api/rest/markdown.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Markdown
-========
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.markdown
- :services: markdowner
diff --git a/docs/server_api/rest/overrides.rst b/docs/server_api/rest/overrides.rst
deleted file mode 100644
index 159019a8..00000000
--- a/docs/server_api/rest/overrides.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-Overrides
-=========
-
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.overrides
- :services: override, overrides, overrides_rss
diff --git a/docs/server_api/rest/packages.rst b/docs/server_api/rest/packages.rst
deleted file mode 100644
index 6d279ba5..00000000
--- a/docs/server_api/rest/packages.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Packages
-========
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.packages
- :services: packages
diff --git a/docs/server_api/rest/releases.rst b/docs/server_api/rest/releases.rst
deleted file mode 100644
index 8fa1ae0e..00000000
--- a/docs/server_api/rest/releases.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Releases
-========
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.releases
- :services: release, releases
diff --git a/docs/server_api/rest/schemas.rst b/docs/server_api/rest/schemas.rst
deleted file mode 100644
index 37456066..00000000
--- a/docs/server_api/rest/schemas.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Message schemas
-===============
-
-``cornice_sphinx`` does `not <https://github.com/Cornices/cornice.ext.sphinx/issues/15>`_ yet have
-the ability to render documentation for the ``/message-schemas/`` API, so we will include docblock
-documentation for that service here instead.
-
-
-.. autoclass:: bodhi.server.services.schemas.MessageSchemasV1
- :members:
diff --git a/docs/server_api/rest/updates.rst b/docs/server_api/rest/updates.rst
deleted file mode 100644
index bfed55b3..00000000
--- a/docs/server_api/rest/updates.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Updates
-=======
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.updates
- :services: update, update_edit, update_get_test_results, update_request, update_waive_test_results, updates, updates_rss
diff --git a/docs/server_api/rest/users.rst b/docs/server_api/rest/users.rst
deleted file mode 100644
index 29a57ee7..00000000
--- a/docs/server_api/rest/users.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Users
-=====
-
-.. cornice-autodoc::
- :modules: bodhi.server.services.user
- :services: user, users, users_rss
diff --git a/docs/user/3.x_release_notes.rst b/docs/user/3.x_release_notes.rst
index e56e3ef8..6509f7ef 100644
--- a/docs/user/3.x_release_notes.rst
+++ b/docs/user/3.x_release_notes.rst
@@ -576,7 +576,7 @@ Features
* Comments have a mouse hoverover for timestamps (:commit:`60e2cddb`).
* The compose is now skipped if the repo is already staged (:commit:`9d94edb4`).
* Update statuses have a descriptive tooltip in the web UI (:commit:`40d04226`).
-* A new ``/updates/{id}/get-test-results`` :doc:`../server_api/rest/updates` API endpoint was added
+* A new ``/updates/{id}/get-test-results`` API endpoint was added
that can retrieve the test results for an update from Greenwave (:commit:`9631a9b6`).
* API users can specify which results they'd like to waive in the waiver API (:commit:`7d51ee54`).
* Update CI status is now displayed in the CLI (:commit:`4ab03afe`).
--
2.35.1