Repository navigation
Update the README to match the code - #433
Open
somethingwithproof wants to merge 4 commits into
Open
somethingwithproof wants to merge 4 commits into
somethingwithproof wants to merge 4 commits into
Conversation
Requirements, install, upgrade, uninstall, settings, poller script, panels, panel libraries, translations and test commands were checked against the code. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The keys are refresh and trefresh, not interval, trends functions exist, and the group is registered in $registry. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
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.



Title
Bring the README in line with the code on the default branch
Description
The README was short and several statements no longer matched the code. This PR rewrites it against origin/develop (13159fc) and checks each statement by reading the code or running the command. No PHP, JavaScript or SQL is touched.
README.md: requirements, optional plugins, install, upgrade and uninstall as they behave now, realms and who gets which panels, dashboards and sharing, favorite graphs, settings with defaults and values, the poller script and its options, the panel list, the tables, how to add a panel library, translations, and the development and test commands. The old bullet list of panels is replaced by the real list. The 2018 screenshot is replaced by a current one (images/intropage-dashboard.png, taken on Cacti 1.2.32 with demo devices).panellib/README.md: the description of how to write a panel followed keys that do not exist (interval) and said trend functions were not implemented. It now documents the keys the code reads, with an example that was run on both cores.INFO:deverlopers@cacti.netis a typo ofdevelopers@cacti.net(the address used in the plugin's translation template). Nothing else inINFOormanifest.jsonwas wrong.Statements in the old README that were wrong or incomplete, and what replaces them:
graph_image.phpuses the image format of the graph (PNG or SVG).panellib, and the upgrade removestests/andphpunit.xml; both are now stated.Found while checking and left alone because this PR does not change code:
--forceofpoller_intropage.phpis parsed and listed in the help but the variable is never used.intropage_add_panel()andintropage_remove_panel()still exist and fail (see the table). A separate PR deals with them.tests/Security/PhpCompatibilityTest.phpsays Cacti 1.2 fails to start below PHP 8.0; Cacti 1.2.32 checks for PHP 8.2 (include/vendor/composer/platform_check.php:7).locales/po/ka-GE.pohas no compiledlocales/LC_MESSAGES/ka-GE.mo.locales/build_gettext.shprintscat: include/cacti_version: No such file or directoryin a plugin checkout and then works.Related Issue
No tracking issue.
Motivation and Context
Someone installing or upgrading the plugin, or writing a panel, should be able to follow the README. Following the old
panellib/README.mdexample produced PHP warnings and a fatal TypeError (run below).How Has This Been Tested?
Environment: Cacti 1.2.32 (the 1.2.x branch, cloned) and the Cacti development branch (1.3.0 dev), PHP 8.3, MariaDB 11.8.9, in Docker; plugin from this branch's parent (origin/develop). Both cores were used for every command unless one is named. Not available here: Cacti 1.2.17 itself, PHP 8.0 to 8.2 and 8.4, a web browser. The three files changed here have no tests of their own; the repository's checks still pass (72 passed, 1 skipped, 1 warning as on origin/develop;
validate-manifest.phpandcheck-i18n-pot.phppass).Verification table. "Ran" means the command was executed and the result is given; otherwise the evidence is the file and line on origin/develop.
INFO:29compat = 1.2.17; 1.2.32 and development ran.github/workflows/plugin-ci-workflow.ymlCACTI: 1.2.xplugin_manage.php --plugin=intropage --install --enable, thenpoller_intropage.php --debug, exit 0tests/Security/PhpCompatibilityTest.php(no post-8.0 functions);str_containsused inincludes/functions.phpinclude/vendor/composer/platform_check.php:7in each tree (PHP_VERSION_ID >= 80200/80300)phpif emptysetup.php:530-544(poller_bottom,path_php_binary); setting is on the Paths tab (include/global_settings.php,'path'array)panellib/busiest.php:204and eleven more,panellib/analyze.php:1194; settingdsstats_enableis in the'data'arraysocketsfor the NTP check, listed as required by Cactiincludes/functions.php:2258socket_create; Cactilib/utility.php:2523listssocketspanellib/thold.php:91,109,panellib/system.php:134(requires)panellib/syslog.php:61,79,97,mactrack.php:61,79,misc.php:79,97,115panellib/analyze.php:1033(monitor),:810(thold, log-only thresholds)initialize_panel_library()returns 29 panels with no other plugin, 40 is the count with all in the source;includes/functions.php:1525-1560; e.g.panellib/mactrack.php:114display.php:541-551includes/functions.php:1503-1520--installplugin_config.statusis 4, after--enable1; 7 tables, 20 hooks (2 enabled until enabling), realms 2 and 3php cli/plugin_manage.php --plugin=intropage --install --enableincludes/settings.php:54include/global_arrays.php:1046-1049(1.2) and:1135-1138(development);includes/settings.php:155-195adds the tabsuser_auth_realmhas rows only for user 1 (realms 102 and 103)setup.php:85-86,:190-191;display.php:407(Reload Panel Definitions),includes/functions.phpintropage_action_settings(admin realm)includes/database.php:57-70,:171-182; Ran: user 1 had 29 panels after a CLI installintropage_new_user_permission(99): 17 panels, 0 system panels,favourite_graphon;includes/settings.php:665-703display.php:494-531("Welcome to Intropage!")heightcolumns dropped;--enableset version 4.0.5 and added the columns;includes/database.php:208-402; Cacti callscheck_configon install and enable (lib/plugins.phpapi_plugin_check_config,api_plugin_enable)include/,themes/,tests/,phpunit.xml, and logs other unknown top-level entriesnot described in manifest.json: stray-file.txt;tests/and aninclude/directory were gone afterwards;setup.php:321-437,manifest.json:2-5includes/functions.php:1525loads onlypanellib/*.phpintropage_*settings, resets the login optionuser_auth.login_opts4 became 1;includes/database.php:34-44settings_userrows are keptintropage_autorefreshrow remained after uninstalldisplay.php:300,:304display.php:270-480,includes/intropage.js,includes/cards/cards.js; not seen in a browserincludes/functions.phpcase 'useshared',display.php:439-477(:452),display.php:119-154display.php:410-425includes/functions.php:2338-2371graph_image.php:54-77in both Cacti treesincludes/variables.phpafter loading it in Cacti; defaults and options copied from that output*_intervalsettings are not readgrepforntp_interval,dns_interval,analyse_db_intervalover all PHP and JS: onlyincludes/variables.php:125,158,176panellib/system.php:354(html_escape),display.php:555--debug,--version,--help;--forcehas no effectpoller_intropage.php:45,71-72,171,183($forceis set and declared but never read)poller_intropage.php:99-105poller_intropage.php:107-108,134-155poller_intropage.php:306-314requiresprinted from the registered definitions; the other 11 from therequireslines aboveSHOW TABLES LIKE 'plugin_intropage%'returned 7;includes/database.php:57-194panellib,register_<name>(),$registry, unique idsincludes/functions.php:1525-1536; Ran: the example inREADME.mdandpanellib/README.mdregistered and stored its data on both corespanellib/README.mdexampleclass,refresh,trefreshand a fatalTypeErrorinintropage_readable_interval()on both coresincludes/functions.phpcase 'forcereload',update_registered_panels()at:1612plugins/intropage/panellib/*.phpis globbedintropage_add_panel()does not workDB Exec Failed ... Unknown column 'file', no definition row;setup.php:577-587,:604(DROP ?)intropage, files inlocales/LC_MESSAGES/<language>.moinclude/global_languages.php:111-124,255sh locales/build_gettext.sh,sh locales/build_mo.shgettextinstalled, from a copy of the tree: build_gettext.sh exit 0 (rewrotecacti.pot, merged 22.po, wrote.mo), build_mo.sh exit 0.mols locales/po locales/LC_MESSAGESinclude/vendor/bin/pest --configuration=plugins/intropage/phpunit.xmltests/.cacti-versionset to1.2.xand todeveloptests/.cacti-version1.2.xaccepts any releasetests/bootstrap-unit.phpcheck; Ran with1.2.xon the development branch--coverage-clover=plugins/intropage/coverage/clover.xmlphp tests/bin/validate-manifest.php,check-i18n-pot.php origin/develop,patch-coverage.php coverage/clover.xml origin/develop 100.github/workflows/plugin-ci-workflow.ymlcurlreturned 200 for eachcurlreturned 403 (it blocks scripts); keptimages/intropage-dashboard.pngwas captured from Intropage 4.0.5 on Cacti 1.2.32 with nine panels; the old external image is no longer linkedRollback
Revert the merge commit. Documentation only, plus one character fix in the
INFOaddress.Types of changes
Checklist