From 8c2b6b0b3cce3a0d23a33bcb45195b65f717af26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20Inderm=C3=BChle?= <laurent.indermuehle@epfl.ch>
Date: Fri, 29 Sep 2023 09:29:43 +0200
Subject: [PATCH] Add ansible-core stable-2.15 and stable-2.16 to tests matrix
 now that "devel" links to 2.17 (#574)

* Add stable-2.15 and 2.16 now that devel link to 2.17

* document which ansible-core version we support

* add sanity ignore for ansible-core 2.17

* cut sanity ignore for 2.12 and 2.13

* Cut ansible-core 2.12 and 2.13 from GHA test matrix
---
 .github/workflows/ansible-test-plugins.yml    | 44 +++++++++++--------
 .github/workflows/ansible-test-roles.yml      | 19 +-------
 README.md                                     |  8 ++--
 TESTING.md                                    |  2 +
 .../drop_ansible_core_2_12_and_2_13.yml       | 11 +++++
 tests/sanity/ignore-2.13.txt                  |  8 ----
 .../{ignore-2.12.txt => ignore-2.17.txt}      |  2 +
 7 files changed, 47 insertions(+), 47 deletions(-)
 create mode 100644 changelogs/fragments/drop_ansible_core_2_12_and_2_13.yml
 delete mode 100644 tests/sanity/ignore-2.13.txt
 rename tests/sanity/{ignore-2.12.txt => ignore-2.17.txt} (84%)

diff --git a/.github/workflows/ansible-test-plugins.yml b/.github/workflows/ansible-test-plugins.yml
index 6533f94..78644bb 100644
--- a/.github/workflows/ansible-test-plugins.yml
+++ b/.github/workflows/ansible-test-plugins.yml
@@ -22,9 +22,9 @@ jobs:
     strategy:
       matrix:
         ansible:
-          - stable-2.12
-          - stable-2.13
           - stable-2.14
+          - stable-2.15
+          - stable-2.16
           - devel
     steps:
       - name: Perform sanity testing
@@ -41,9 +41,9 @@ jobs:
       fail-fast: false
       matrix:
         ansible:
-          - stable-2.12
-          - stable-2.13
           - stable-2.14
+          - stable-2.15
+          - stable-2.16
           - devel
         db_engine_name:
           - mysql
@@ -112,10 +112,13 @@ jobs:
             python: '3.10'
 
           - db_engine_version: 5.7.40
-            ansible: stable-2.13
+            ansible: stable-2.14
 
           - db_engine_version: 5.7.40
-            ansible: stable-2.14
+            ansible: stable-2.15
+
+          - db_engine_version: 5.7.40
+            ansible: stable-2.16
 
           - db_engine_version: 5.7.40
             ansible: devel
@@ -171,24 +174,27 @@ jobs:
           - python: '3.10'
             connector_version: 2.0.3
 
-          - python: '3.8'
-            ansible: stable-2.13
-
           - python: '3.8'
             ansible: stable-2.14
 
+          - python: '3.8'
+            ansible: stable-2.15
+
+          - python: '3.8'
+            ansible: stable-2.16
+
           - python: '3.8'
             ansible: devel
 
           - python: '3.9'
-            ansible: stable-2.12
+            ansible: stable-2.15
+
+          - python: '3.9'
+            ansible: stable-2.16
 
           - python: '3.9'
             ansible: devel
 
-          - python: '3.10'
-            ansible: stable-2.12
-
     services:
       db_primary:
         image: docker.io/library/${{ matrix.db_engine_name }}:${{ matrix.db_engine_version }}
@@ -334,22 +340,22 @@ jobs:
       fail-fast: true
       matrix:
         ansible:
-          - stable-2.12
-          - stable-2.13
           - stable-2.14
+          - stable-2.15
+          - stable-2.16
           - devel
         python:
           - 3.8
           - 3.9
         exclude:
-          - python: '3.8'
-            ansible: stable-2.13
           - python: '3.8'
             ansible: stable-2.14
+          - python: '3.8'
+            ansible: stable-2.15
+          - python: '3.8'
+            ansible: stable-2.16
           - python: '3.8'
             ansible: devel
-          - python: '3.9'
-            ansible: stable-2.12
 
     steps:
       - name: >-
diff --git a/.github/workflows/ansible-test-roles.yml b/.github/workflows/ansible-test-roles.yml
index 13e7d41..da8a805 100644
--- a/.github/workflows/ansible-test-roles.yml
+++ b/.github/workflows/ansible-test-roles.yml
@@ -24,31 +24,16 @@ jobs:
         mysql:
           - 2.0.12
         ansible:
-          - stable-2.11
-          - stable-2.12
           - stable-2.13
+          - stable-2.14
+          - stable-2.15
           - devel
         python:
-          - 3.6
           - 3.8
           - 3.9
         exclude:
-          - python: 3.6
-            ansible: stable-2.12
-          - python: 3.6
-            ansible: stable-2.13
-          - python: 3.6
-            ansible: devel
-          - python: 3.8
-            ansible: stable-2.11
-          - python: 3.8
-            ansible: stable-2.13
           - python: 3.8
             ansible: devel
-          - python: 3.9
-            ansible: stable-2.11
-          - python: 3.9
-            ansible: stable-2.12
 
     steps:
 
diff --git a/README.md b/README.md
index b024453..f7e062c 100644
--- a/README.md
+++ b/README.md
@@ -82,9 +82,11 @@ Here is the table for the support timeline:
 
 ### ansible-core
 
-- 2.12
-- 2.13
-- 2.14
+- stable-2.12
+- stable-2.13
+- stable-2.14
+- stable-2.15
+- stable-2.16
 - current development version
 
 ### Databases
diff --git a/TESTING.md b/TESTING.md
index 7bbafc3..7025391 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -52,6 +52,8 @@ The Makefile accept the following options
     - "stable-2.12"
     - "stable-2.13"
     - "stable-2.14"
+    - "stable-2.15"
+    - "stable-2.16"
     - "devel"
   - Description: Version of ansible to install in a venv to run ansible-test
 
diff --git a/changelogs/fragments/drop_ansible_core_2_12_and_2_13.yml b/changelogs/fragments/drop_ansible_core_2_12_and_2_13.yml
new file mode 100644
index 0000000..29a363e
--- /dev/null
+++ b/changelogs/fragments/drop_ansible_core_2_12_and_2_13.yml
@@ -0,0 +1,11 @@
+---
+
+major_changes:
+
+  - The community.mysql collection no longer supports ``ansible-core 2.12`` and
+    ``ansible-core 2.13``. While we take no active measures to prevent usage
+    and there are no plans to introduce incompatible code to the modules, we
+    will stop testing those versions. Both are or will soon be End of Life and
+    if you are still using them, you should consider upgrading to the
+    ``latest Ansible / ansible-core 2.15 or later`` as soon as possible
+    (https://github.com/ansible-collections/community.mysql/pull/574).
diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt
deleted file mode 100644
index c0323af..0000000
--- a/tests/sanity/ignore-2.13.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-plugins/modules/mysql_db.py validate-modules:doc-elements-mismatch
-plugins/modules/mysql_db.py validate-modules:parameter-list-no-elements
-plugins/modules/mysql_db.py validate-modules:use-run-command-not-popen
-plugins/modules/mysql_info.py validate-modules:doc-elements-mismatch
-plugins/modules/mysql_info.py validate-modules:parameter-list-no-elements
-plugins/modules/mysql_query.py validate-modules:parameter-list-no-elements
-plugins/modules/mysql_user.py validate-modules:undocumented-parameter
-plugins/modules/mysql_variables.py validate-modules:doc-required-mismatch
diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.17.txt
similarity index 84%
rename from tests/sanity/ignore-2.12.txt
rename to tests/sanity/ignore-2.17.txt
index c0323af..da0354c 100644
--- a/tests/sanity/ignore-2.12.txt
+++ b/tests/sanity/ignore-2.17.txt
@@ -6,3 +6,5 @@ plugins/modules/mysql_info.py validate-modules:parameter-list-no-elements
 plugins/modules/mysql_query.py validate-modules:parameter-list-no-elements
 plugins/modules/mysql_user.py validate-modules:undocumented-parameter
 plugins/modules/mysql_variables.py validate-modules:doc-required-mismatch
+plugins/module_utils/mysql.py pylint:unused-import
+plugins/module_utils/version.py pylint:unused-import