diff --git a/changelogs/fragments/ansible-test-collection-classification.yml b/changelogs/fragments/ansible-test-collection-classification.yml new file mode 100644 index 00000000000..7299ceeaddd --- /dev/null +++ b/changelogs/fragments/ansible-test-collection-classification.yml @@ -0,0 +1,2 @@ +bugfixes: +- "ansible-test - improve classification of changes to ``.gitignore``, ``COPYING``, ``LICENSE``, ``Makefile``, and all files ending with one of ``.in`, ``.md`, ``.rst``, ``.toml``, ``.txt`` in the collection root directory (https://github.com/ansible/ansible/pull/72353)." diff --git a/test/lib/ansible_test/_internal/classification.py b/test/lib/ansible_test/_internal/classification.py index 8eaf573c114..bfe6ccc34a8 100644 --- a/test/lib/ansible_test/_internal/classification.py +++ b/test/lib/ansible_test/_internal/classification.py @@ -660,6 +660,9 @@ class PathMapper: if result is not None: return result + filename = os.path.basename(path) + dummy, ext = os.path.splitext(filename) + minimal = {} if path.startswith('changelogs/'): @@ -668,6 +671,24 @@ class PathMapper: if path.startswith('docs/'): return minimal + if '/' not in path: + if path in ( + '.gitignore', + 'COPYING', + 'LICENSE', + 'Makefile', + ): + return minimal + + if ext in ( + '.in', + '.md', + '.rst', + '.toml', + '.txt', + ): + return minimal + return None def _classify_ansible(self, path): # type: (str) -> t.Optional[t.Dict[str, str]]