From a14b3d02fe4eeb3ea69bf4318a62265f08e409e3 Mon Sep 17 00:00:00 2001
From: Iury Gregory Melo Ferreira <imelofer@redhat.com>
Date: Wed, 21 Sep 2022 23:59:27 -0300
Subject: [PATCH] Set stage for Zed Release with 21.1

This is a pre-release commit for the Yoga release following our docs [1]

[1] https://docs.openstack.org/ironic/latest/contributor/releasing.html

We will clean-up the releasenotes and include the prelude in other patch

Change-Id: I3b8df0dce64c4ee3b20b7a714b6647d6e1ec0330
---
 .../contributor/webapi-version-history.rst    |  4 ++--
 ironic/common/release_mappings.py             | 24 +++++++++++++++++--
 .../unit/common/test_release_mappings.py      |  2 +-
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/doc/source/contributor/webapi-version-history.rst b/doc/source/contributor/webapi-version-history.rst
index c395bdcbe1..074106bc83 100644
--- a/doc/source/contributor/webapi-version-history.rst
+++ b/doc/source/contributor/webapi-version-history.rst
@@ -2,8 +2,8 @@
 REST API Version History
 ========================
 
-1.80 (Zed)
-----------
+1.80 (Zed, 21.1)
+----------------------
 
 This verison is a signifier of additional RBAC functionality allowing
 a project scoped ``admin`` to create or delete nodes in Ironic.
diff --git a/ironic/common/release_mappings.py b/ironic/common/release_mappings.py
index 9403218702..d32027b597 100644
--- a/ironic/common/release_mappings.py
+++ b/ironic/common/release_mappings.py
@@ -490,6 +490,26 @@ RELEASE_MAPPING = {
             'VolumeTarget': ['1.0'],
         }
     },
+    '21.1': {
+        'api': '1.80',
+        'rpc': '1.55',
+        'objects': {
+            'Allocation': ['1.1'],
+            'BIOSSetting': ['1.1'],
+            'Node': ['1.36'],
+            'NodeHistory': ['1.0'],
+            'Conductor': ['1.3'],
+            'Chassis': ['1.3'],
+            'Deployment': ['1.0'],
+            'DeployTemplate': ['1.1'],
+            'Port': ['1.10'],
+            'Portgroup': ['1.4'],
+            'Trait': ['1.0'],
+            'TraitList': ['1.0'],
+            'VolumeConnector': ['1.0'],
+            'VolumeTarget': ['1.0'],
+        }
+    },
     'master': {
         'api': '1.80',
         'rpc': '1.55',
@@ -525,9 +545,9 @@ RELEASE_MAPPING = {
 #
 #            There should be at most two named mappings here.
 
-# NOTE(mgoddard): remove xena prior to the zed release.
-RELEASE_MAPPING['xena'] = RELEASE_MAPPING['18.2']
+# NOTE(mgoddard): remove yoga prior to the antelope release.
 RELEASE_MAPPING['yoga'] = RELEASE_MAPPING['20.1']
+RELEASE_MAPPING['zed'] = RELEASE_MAPPING['21.1']
 
 # List of available versions with named versions first; 'master' is excluded.
 RELEASE_VERSIONS = sorted(set(RELEASE_MAPPING) - {'master'}, reverse=True)
diff --git a/ironic/tests/unit/common/test_release_mappings.py b/ironic/tests/unit/common/test_release_mappings.py
index da1eeedd21..96dbdfa22f 100644
--- a/ironic/tests/unit/common/test_release_mappings.py
+++ b/ironic/tests/unit/common/test_release_mappings.py
@@ -44,7 +44,7 @@ NUMERIC_RELEASES = sorted(
     map(versionutils.convert_version_to_tuple,
         set(release_mappings.RELEASE_MAPPING)
         # Update the exceptions whenever needed
-        - {'master', 'yoga', 'xena'}),
+        - {'master', 'zed', 'yoga'}),
     reverse=True)