diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-04-17 15:22:01 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-17 13:22:01 +0100 |
| commit | db645c3fc5a66f0fdadd03b5096937f70787e3b0 (patch) | |
| tree | cc4b894829c718a5e906137e03b2513a2ba788e0 /.github/instructions/modules.instructions.md | |
| parent | 1bee3f7d8e1dca104c0b5c5d7a7833946aa7514a (diff) | |
| download | vyos.vyos-db645c3fc5a66f0fdadd03b5096937f70787e3b0.tar.gz vyos.vyos-db645c3fc5a66f0fdadd03b5096937f70787e3b0.zip | |
T8523: add Copilot custom review instructions (#465)
* Add easy-wins improvement spec for vyos.vyos collection
Covers five phases: formatting compliance, runtime.yml redirect fix,
deprecated feature cleanup, missing unit tests, and template deduplication.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add implementation plan for easy-wins improvements
15 tasks across 5 phases: formatting compliance, runtime.yml bugfix,
deprecated code cleanup, missing unit tests, template deduplication.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update spec and plan with architect review corrections
Key changes:
- Defer Phase 5 (template deduplication) to v7.0.0: route_maps
are not identical, BGP dedup blocked by Python module-level
scoping, OSPF has fundamentally different command paradigms
- Add .git-blame-ignore-revs step to Phase 1
- Add missing test cases: overridden/rendered for resource modules,
aggregate/purge/with_address for vyos_vlan
- Fix incorrect claim that version.py LooseVersion is unused
- Add sequential merge requirement to preamble
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: add .worktrees/ and .claude/ to .gitignore
* T8523: add Copilot custom review instructions
Add .github/copilot-instructions.md and path-specific instruction
files under .github/instructions/ to teach Copilot project conventions:
copyright attribution, changelog fragment key selection, test mocking
patterns, required state coverage for resource modules, and module
option description standards.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* T8523: remove copyright instructions from Copilot config
Copyright attribution rules are internal guidance kept in Claude
config, not in Copilot review instructions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* T8523: remove docs/superpowers files inadvertently included
These spec/plan files came from local main commits that were
pulled in during rebase. They are unrelated to this PR.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* T8523: fix inaccuracies flagged by Copilot review
- CLI quoting: clarify that boolean flags and bare keywords are
unquoted; only string/address values use single quotes
- Test mocking: describe get_device_data / execute_show_command as
the primary resource module pattern (used by most existing tests);
note get_resource_connection_facts approach as an alternative
- modules.instructions.md: broaden applyTo to include meta/runtime.yml
so redirect guidance fires when that file is edited
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* T8523: fix legacy module mocking guidance in tests.instructions.md
Existing legacy tests use side_effect for run_commands, not
return_value. Updated to describe side_effect as the standard
approach, note return_value as also acceptable for fixed responses,
and clarify that the patched helper varies by module (run_commands
for command/facts/ping, load_config/get_config for vyos_config).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* T8523: fix four more inaccuracies flagged by Copilot review
- 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>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to '.github/instructions/modules.instructions.md')
| -rw-r--r-- | .github/instructions/modules.instructions.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/.github/instructions/modules.instructions.md b/.github/instructions/modules.instructions.md new file mode 100644 index 00000000..d7782e1e --- /dev/null +++ b/.github/instructions/modules.instructions.md @@ -0,0 +1,37 @@ +--- +applyTo: "plugins/**,meta/runtime.yml" +--- + +# Plugin conventions + +## Module option descriptions + +- Must be complete English sentences ending with a period. +- No grammar errors. Common mistake: "the number hops" should be "the number of hops". +- Deprecated options must include `removed_in_version` and `removed_from_collection` fields. +- Do not add new options with `deprecated: true` — remove deprecated options entirely. + +## rm_templates files + +Files in `plugins/module_utils/network/vyos/rm_templates/` define regex parsers and Jinja2 generators for a resource module. Each entry has: +- `name` — unique identifier +- `getval` — compiled regex with named groups +- `setval` — Jinja2 template or callable producing a VyOS CLI command +- `result` — dict mapping regex groups to facts structure +- `shared` (optional) — bool, whether the template applies to a shared config block + +## meta/runtime.yml redirects + +Short-name redirects must point to the actual module name with the `vyos_` prefix. For example: +```yaml +snmp_server: + redirect: vyos.vyos.vyos_snmp_server # correct + # NOT: vyos.vyos.vyos_snmp_servers # wrong (pluralized) +``` + +Verify any changed redirect target exists as a real module file under `plugins/modules/`. + +## 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 listed in README.md. |
