Skip to content

Commit 1ad1ca2

Browse files
author
Copilot
committed
docs/tests: standardize test header and correct manifest-contract notes
- Use the full license header (from the plugin's own setup.php) in tests/Unit/PruneFilesTest.php instead of the abbreviated copyright banner. - Document that the manifest drift check and the upgrade-time prune also handle phpunit.xml and .md* files, matching the implemented behavior.
1 parent f703491 commit 1ad1ca2

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎.github/copilot-instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,4 @@ existing code or adding new code, not just in dedicated cleanup passes:
176176

177177
## File manifest & upgrade pruning
178178

179-
The plugin ships a root `manifest.json` with three arrays: `tombstones` (files/directories older versions shipped that have since moved or been removed), `expected` (the top-level files and directories that ship today, directories written with a trailing `/`), and `whitelist` (paths holding user data that must never be touched). Keep `expected` current: CI runs `tests/bin/validate-manifest.php`, which fails on any drift between `expected` and the real top-level tree (it ignores `tests/`, `.git*`, and whitelisted paths). Custom customer CSS/theme files belong in `expected`, and stylesheets live in `css/` (not `themes/`). On upgrade, `plugin_quicktree_prune_files()` deletes the tombstoned paths and the dev-only `tests/` tree, leaves `whitelist` and `.git*` alone, and logs (without removing) any top-level entry the manifest does not account for. As a safety measure it refuses any tombstone that resolves outside the plugin directory (a tampered manifest.json) and logs a warning for any file or directory it cannot remove. When you move or delete a shipped file, add its old path to `tombstones` and update `expected` in the same change.
179+
The plugin ships a root `manifest.json` with three arrays: `tombstones` (files/directories older versions shipped that have since moved or been removed), `expected` (the top-level files and directories that ship today, directories written with a trailing `/`), and `whitelist` (paths holding user data that must never be touched). Keep `expected` current: CI runs `tests/bin/validate-manifest.php`, which fails on any drift between `expected` and the real top-level tree (it ignores `tests/`, `phpunit.xml`, `.git*`, `.md*`, and whitelisted paths). Custom customer CSS/theme files belong in `expected`, and stylesheets live in `css/` (not `themes/`). On upgrade, `plugin_quicktree_prune_files()` deletes the tombstoned paths, the dev-only `tests/` tree, and the `phpunit.xml` test config, leaves `whitelist`, `.git*`, and `.md*` alone, and logs (without removing) any top-level entry the manifest does not account for. As a safety measure it refuses any tombstone that resolves outside the plugin directory (a tampered manifest.json) and logs a warning for any file or directory it cannot remove. When you move or delete a shipped file, add its old path to `tombstones` and update `expected` in the same change.

‎tests/Unit/PruneFilesTest.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4+
| Copyright (C) 2004-2022 Howard Jones |
45
| Copyright (C) 2004-2026 The Cacti Group |
6+
| |
7+
| This program is free software; you can redistribute it and/or |
8+
| modify it under the terms of the GNU General Public License |
9+
| as published by the Free Software Foundation; either version 2 |
10+
| of the License, or (at your option) any later version. |
11+
| |
12+
| This program is distributed in the hope that it will be useful, |
13+
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
14+
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15+
| GNU General Public License for more details. |
16+
+-------------------------------------------------------------------------+
17+
| Cacti: The Complete RRDtool-based Graphing Solution |
18+
+-------------------------------------------------------------------------+
19+
| This code is designed, written, and maintained by the Cacti Group. See |
20+
| about.php and/or the AUTHORS file for specific developer information. |
21+
+-------------------------------------------------------------------------+
22+
| http://www.cacti.net/ |
523
+-------------------------------------------------------------------------+
624
*/
725

0 commit comments

Comments
 (0)