From 1464e0d5c6e3f475118ceec116c4b1e80f7c74b1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 14:05:30 +0200 Subject: [PATCH 1/8] Do extra docs validation. Explicitly disallow semantic markup in docs. --- tests/sanity/extra/extra-docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index 67310492..d7bbe35e 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -15,7 +15,7 @@ def main(): """Main entry point.""" if not os.path.isdir(os.path.join('docs', 'docsite')): return - p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '.'], check=False) + p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'], check=False) if p.returncode not in (0, 3): print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) From 53f2ea5f80dd63334e10764e4dc47cf8cab45c8f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 14:09:56 +0200 Subject: [PATCH 2/8] Forgot to add new requirement. --- tests/sanity/extra/extra-docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sanity/extra/extra-docs.json b/tests/sanity/extra/extra-docs.json index c2e612e5..753a125c 100644 --- a/tests/sanity/extra/extra-docs.json +++ b/tests/sanity/extra/extra-docs.json @@ -5,6 +5,7 @@ ], "output": "path-line-column-message", "requirements": [ + "ansible-core", "antsibull-docs" ] } From 127ada020ca7a4dc7440f1b9910520f47d80173a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 16:39:01 +0200 Subject: [PATCH 3/8] Improve test. --- tests/sanity/extra/extra-docs.json | 4 +++- tests/sanity/extra/extra-docs.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sanity/extra/extra-docs.json b/tests/sanity/extra/extra-docs.json index 753a125c..9a28d174 100644 --- a/tests/sanity/extra/extra-docs.json +++ b/tests/sanity/extra/extra-docs.json @@ -1,7 +1,9 @@ { "include_symlinks": false, "prefixes": [ - "docs/docsite/" + "docs/docsite/", + "plugins/", + "roles/" ], "output": "path-line-column-message", "requirements": [ diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index d7bbe35e..9ddfcc60 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -13,8 +13,6 @@ def main(): """Main entry point.""" - if not os.path.isdir(os.path.join('docs', 'docsite')): - return p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'], check=False) if p.returncode not in (0, 3): print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) From 54baa31ff4727bb1b1937e10d8a760f675f39e1b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 16:40:56 +0200 Subject: [PATCH 4/8] TEMP - make CI fail. --- plugins/modules/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/modules/api.py b/plugins/modules/api.py index f9c619fc..d33153b1 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -16,6 +16,7 @@ description: - Ansible module for RouterOS API with the Python C(librouteros) library. - This module can add, remove, update, query and execute arbitrary command in RouterOS via API. + - M(foo). notes: - I(add), I(remove), I(update), I(cmd) and I(query) are mutually exclusive. - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules From dd2cd20f9fd7f15065577923f596b08dd8a49686 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 16:57:13 +0200 Subject: [PATCH 5/8] Remove unnecessary import. --- tests/sanity/extra/extra-docs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index 9ddfcc60..53f6b818 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -6,7 +6,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import os import sys import subprocess From 043610d8e1592e0e93ebd5978f7f6fe41bc467d5 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 17:13:15 +0200 Subject: [PATCH 6/8] Make sure ANSIBLE_COLLECTIONS_PATH is set. --- tests/sanity/extra/extra-docs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index 53f6b818..1bae401b 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -6,13 +6,21 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +import os import sys import subprocess def main(): """Main entry point.""" - p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'], check=False) + env = os.environ.copy() + suffix = f':{env["ANSIBLE_COLLECTIONS_PATH"]}' if 'ANSIBLE_COLLECTIONS_PATH' in env else '' + env['ANSIBLE_COLLECTIONS_PATH'] = f'{os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd())))}{suffix}' + p = subprocess.run( + ['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'], + env=env, + check=False, + ) if p.returncode not in (0, 3): print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) From 02164b169cfdbe1d874fea062823d1b232b34648 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 17:31:09 +0200 Subject: [PATCH 7/8] Revert "TEMP - make CI fail." This reverts commit 445c56e7e1bcd844be59f1df9df00a9c8334ff55. --- plugins/modules/api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/modules/api.py b/plugins/modules/api.py index d33153b1..f9c619fc 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -16,7 +16,6 @@ description: - Ansible module for RouterOS API with the Python C(librouteros) library. - This module can add, remove, update, query and execute arbitrary command in RouterOS via API. - - M(foo). notes: - I(add), I(remove), I(update), I(cmd) and I(query) are mutually exclusive. - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules From 5ba19d29edc4bcfcd1c972cd804d43988dd6b97b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 16 Apr 2023 17:42:13 +0200 Subject: [PATCH 8/8] Make sure sanity tests from older Ansible versions don't complain. --- tests/sanity/extra/extra-docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index 1bae401b..c636beb0 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -14,8 +14,8 @@ def main(): """Main entry point.""" env = os.environ.copy() - suffix = f':{env["ANSIBLE_COLLECTIONS_PATH"]}' if 'ANSIBLE_COLLECTIONS_PATH' in env else '' - env['ANSIBLE_COLLECTIONS_PATH'] = f'{os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd())))}{suffix}' + suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else '' + env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix) p = subprocess.run( ['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'], env=env,