docs: add Copilot instructions modeled on plugin_evidence - #387
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The guide contains unresolved omissions and inaccurate implementation guidance that should be corrected before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds repository-specific Copilot instructions for the Cacti Intropage plugin.
Changes:
- Documents project structure, conventions, architecture, and compatibility.
- Adds database, security, localization, hook, and panel guidance.
- Provides common pitfalls and repository references.
File summaries
| File | Description |
|---|---|
.github/copilot-instructions.md |
Adds tailored Copilot development instructions for the Intropage plugin. |
Review details
Suppressed comments (5)
.github/copilot-instructions.md:55
- The table inventory is incomplete.
include/database.phpcreatesplugin_intropage_panel_dashboard,plugin_intropage_trends,plugin_intropage_dashboard, andplugin_intropage_user_group_authas well; omitting them can lead contributors to miss real dashboard, trend, and group-authorization storage.
Plugin tables are prefixed `plugin_intropage_`: `plugin_intropage_panel_definition`, `plugin_intropage_user_auth`, `plugin_intropage_panel_data`.
.github/copilot-instructions.md:92
- This access-control guidance omits the registered administration realm.
setup.phpregisters bothintropage.phpandintropage_admin.php, and administrative code checks the latter; documenting only the viewer check can cause new administration paths to use incomplete realm protection.
Realm permissions: `api_user_realm_auth('intropage.php')` gates access. Panel permissions: `is_panel_allowed()` checks user/group authorization before rendering a panel.
.github/copilot-instructions.md:120
- This hook list is not the actual set registered by
setup.php; it omitsconfig_arrays,login_options_navigate,top_graph_header_tabs,graph_buttons_thumbnails, the user action/save hooks, the group action/save hooks, anduser_admin_setup_sql_save. Contributors following this as the plugin's hook guidance could omit required integration points.
Register hooks in `setup.php`: `config_settings`, `top_header_tabs`, `console_after`, `page_head`, `graph_buttons`, `poller_bottom`, `user_admin_tab`, plus the user/group admin lifecycle hooks (`user_remove`, `user_group_admin_tab`, `user_group_remove`, `copy_user`).
.github/copilot-instructions.md:115
- The data-flow statement says all user permissions live in
plugin_intropage_user_auth, but group permissions are stored separately inplugin_intropage_user_group_authand merged byis_panel_allowed(). This omission is especially misleading because the same guide documents group-admin hooks.
3. User permissions live in `plugin_intropage_user_auth` (JSON-encoded).
.github/copilot-instructions.md:110
panellib/index.phpis matched by the documented glob but is an entry point rather than a panel library;initialize_panel_library()explicitly skips it (include/functions.php:1179). Qualify this requirement so contributors do not add a nonexistentregister_index()function.
Every panel library file (`panellib/*.php`) MUST define a `register_<basename>()` function returning a panels array with keys like `name`, `description`, `class`, `level` (`PANEL_SYSTEM`/`PANEL_USER`), `refresh`, `width`, `height`, `priority`, `alarm`, `requires`, `update_func`, `details_func`, `trends_func`.
- Files reviewed: 1/1 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xmacan
previously approved these changes
Sep 15, 2026
Clarified usage of `__()`/`__esc()` for internationalization. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Document the registration of hooks and update functions for data collection. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor device scope handling for fetching hosts based on user permissions. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bmfmancini
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds/aligns .github/copilot-instructions.md to follow the structure used in Cacti/plugin_evidence, tailored to this plugin's actual hooks, database tables, naming conventions, and security-sensitive areas.