From 020e868e3b200d389cfc3b95225657d835f42c10 Mon Sep 17 00:00:00 2001 From: Bikouo Aubin <79859644+abikouo@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:00:49 +0100 Subject: [PATCH 1/3] Update collection installation path (#190) * Update collection installation path * Reference remote repository * Set path to the upstream when calling github action --- .../list_changed_common.py | 25 +++++++++++++++++++ .../list_changed_targets.py | 4 +++ 2 files changed, 29 insertions(+) diff --git a/.github/actions/ansible_test_splitter/list_changed_common.py b/.github/actions/ansible_test_splitter/list_changed_common.py index fb721080..49e59af9 100644 --- a/.github/actions/ansible_test_splitter/list_changed_common.py +++ b/.github/actions/ansible_test_splitter/list_changed_common.py @@ -272,6 +272,14 @@ def plugin_utils(self) -> Generator[tuple[PosixPath, str], None, None]: """ yield from self._util_matches("plugins/plugin_utils/", "plugin_utils") + def extensions_audit_event_query(self) -> bool: + """Return true when the extensions/audit/event_query.yml file has been updated""" + event_query_files = ( + "extensions/audit/event_query.yml", + "extensions/audit/event_query.yaml", + ) + return any([str(d) in event_query_files for d in self.changed_files()]) + class Target: """A class to store information about a specific target.""" @@ -427,6 +435,23 @@ def add_target_to_plan(self, target_name: str) -> None: if t.is_alias_of(target_name) and self.is_candidate_target(t): self._my_test_plan.append(t) + def add_targets_to_plan_from_aliases_or_prefix_name( + self, alias_line="", prefix_name="" + ): + """Add targets to the plan from aliases line or prefix name.""" + for t in self._targets(): + if not self.is_candidate_target(t): + continue + # Add the target to the plan if either the name starts with `prefix_name` or + # The aliases file contains the line `alias_line` + if t.is_alias_of(alias_line) or t.name.startswith(prefix_name): + self._my_test_plan.append(t) + + def add_indirect_node_count_targets_to_plan(self): + alias_line="indirect_node_count" + prefix_name="node_query_" + self.add_targets_to_plan_from_aliases_or_prefix_name(alias_line, prefix_name) + def cover_all(self) -> None: """Cover all the targets available.""" for cover_target in self.targets(): diff --git a/.github/actions/ansible_test_splitter/list_changed_targets.py b/.github/actions/ansible_test_splitter/list_changed_targets.py index 94db2641..a2c86d7e 100644 --- a/.github/actions/ansible_test_splitter/list_changed_targets.py +++ b/.github/actions/ansible_test_splitter/list_changed_targets.py @@ -116,6 +116,10 @@ def _add_changed_target( _add_changed_target(whc.collection_name, target, "targets") for role in whc.roles(): _add_changed_target(whc.collection_name, role, "roles") + # indirect node count targets + if whc.extensions_audit_event_query(): + for collection in collections: + collection.add_indirect_node_count_targets_to_plan() print("----------- Test plan -----------") for collection in collections: From c69f6bba07fb1715d40a1d893a757c30f59534b0 Mon Sep 17 00:00:00 2001 From: Benny Rahmanim Date: Sun, 29 Mar 2026 20:01:24 +0300 Subject: [PATCH 2/3] Add trigger for extentions audit indirect node count targets --- .../{REAME.md => README.md} | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) rename .github/actions/ansible_test_splitter/{REAME.md => README.md} (78%) diff --git a/.github/actions/ansible_test_splitter/REAME.md b/.github/actions/ansible_test_splitter/README.md similarity index 78% rename from .github/actions/ansible_test_splitter/REAME.md rename to .github/actions/ansible_test_splitter/README.md index f6ce97fe..423cae4f 100644 --- a/.github/actions/ansible_test_splitter/REAME.md +++ b/.github/actions/ansible_test_splitter/README.md @@ -76,6 +76,26 @@ _Example_: For any change on `plugins/lookup/random.py`, this action will produce `lookup_random` and `test_random` as impacted targets. +## Relationship between extensions and targets + +This action reads elements to test from `extensions` directory and corresponding tests from `tests/integration/targets` directory. Here after more details on the relationship between extensions and integration tests targets: + +- `audit`, the test target name should have prefix `node_query_` or defines the `indirect_node_count` line into the `aliases` file, when `event_query.yml` file changed. + +_Example_: + +``` + |___extensions/audit/event_query.yml + |___tests + |___integration + |___targets + |___node_query_database_cluster + |___query_instance_ec2 + |___aliases (contains this line indirect_node_count) +``` + +For any change on `extensions/audit/event_query.yml` file, this action will produce `node_query_database_cluster` and `query_instance_ec2` as impacted targets. + ## Debugging - Set the label `test-all-the-targets` on the pull request to run the full test suite instead of the impacted changes. From 2f23434e1d44f10fbe011162bcac206e909c17be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:12:08 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../ansible_test_splitter/list_changed_common.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/actions/ansible_test_splitter/list_changed_common.py b/.github/actions/ansible_test_splitter/list_changed_common.py index 49e59af9..3c363d3c 100644 --- a/.github/actions/ansible_test_splitter/list_changed_common.py +++ b/.github/actions/ansible_test_splitter/list_changed_common.py @@ -435,9 +435,7 @@ def add_target_to_plan(self, target_name: str) -> None: if t.is_alias_of(target_name) and self.is_candidate_target(t): self._my_test_plan.append(t) - def add_targets_to_plan_from_aliases_or_prefix_name( - self, alias_line="", prefix_name="" - ): + def add_targets_to_plan_from_aliases_or_prefix_name(self, alias_line="", prefix_name=""): """Add targets to the plan from aliases line or prefix name.""" for t in self._targets(): if not self.is_candidate_target(t): @@ -446,12 +444,12 @@ def add_targets_to_plan_from_aliases_or_prefix_name( # The aliases file contains the line `alias_line` if t.is_alias_of(alias_line) or t.name.startswith(prefix_name): self._my_test_plan.append(t) - + def add_indirect_node_count_targets_to_plan(self): - alias_line="indirect_node_count" - prefix_name="node_query_" + alias_line = "indirect_node_count" + prefix_name = "node_query_" self.add_targets_to_plan_from_aliases_or_prefix_name(alias_line, prefix_name) - + def cover_all(self) -> None: """Cover all the targets available.""" for cover_target in self.targets():