summaryrefslogtreecommitdiff
path: root/.github/instructions
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-04-16 08:09:06 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-04-16 08:10:17 +0300
commit9555eb81ec1030f9834254d3bacb9ef223c9f8a9 (patch)
treecc4b894829c718a5e906137e03b2513a2ba788e0 /.github/instructions
parent8507846c78b053104e2e80048095cd8299ae3719 (diff)
downloadvyos.vyos-chore/copilot-review-instructions.tar.gz
vyos.vyos-chore/copilot-review-instructions.zip
T8523: fix four more inaccuracies flagged by Copilot reviewchore/copilot-review-instructions
- CLI quoting: address values in firewall groups are unquoted in fixtures; instruct reviewers to align with surrounding fixture style rather than flagging all unquoted addresses - Resource module mocking: add .start()/.stop() calls to the snippet so it matches the actual setUp/tearDown pattern in existing tests - terminal plugin versions: reference README.md instead of hardcoding a version list that diverges from README - changelog fragment: remove stale "copyright headers" claim (that section was dropped from the instruction files) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to '.github/instructions')
-rw-r--r--.github/instructions/modules.instructions.md2
-rw-r--r--.github/instructions/tests.instructions.md10
2 files changed, 10 insertions, 2 deletions
diff --git a/.github/instructions/modules.instructions.md b/.github/instructions/modules.instructions.md
index 85a34015..d7782e1e 100644
--- a/.github/instructions/modules.instructions.md
+++ b/.github/instructions/modules.instructions.md
@@ -34,4 +34,4 @@ Verify any changed redirect target exists as a real module file under `plugins/m
## cliconf / terminal plugins
`plugins/cliconf/vyos.py` — do not modify without understanding edit-mode and commit semantics.
-`plugins/terminal/vyos.py` — handles prompt detection; regex changes require testing against all supported VyOS versions (1.3.8, 1.4.1, 1.4.2, 1.5 rolling).
+`plugins/terminal/vyos.py` — handles prompt detection; regex changes require testing against all supported VyOS versions listed in README.md.
diff --git a/.github/instructions/tests.instructions.md b/.github/instructions/tests.instructions.md
index 66f08f88..150db41e 100644
--- a/.github/instructions/tests.instructions.md
+++ b/.github/instructions/tests.instructions.md
@@ -20,15 +20,23 @@ class TestVyosFooModule(TestVyosModule):
## Mocking: resource modules
-Resource module tests require two framework-level patches in `setUp`:
+Resource module tests require two framework-level patches in `setUp` with corresponding cleanup in `tearDown`:
```python
+# in setUp:
self.mock_get_resource_connection_config = patch(
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.cfg.base.get_resource_connection"
)
+self.get_resource_connection_config = self.mock_get_resource_connection_config.start()
+
self.mock_get_resource_connection_facts = patch(
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection"
)
+self.get_resource_connection_facts = self.mock_get_resource_connection_facts.start()
+
+# in tearDown:
+self.mock_get_resource_connection_config.stop()
+self.mock_get_resource_connection_facts.stop()
```
Most resource module tests also patch the facts class's `get_device_data` method directly and use it in `load_fixtures`: