Next release#1665
Conversation
📝 WalkthroughWalkthroughThis PR consolidates documentation reference links to use canonical plugin documentation URLs and refactors subnet parsing logic from two plugins into a shared plugin_helper utility, reducing code duplication and enabling consistent interface resolution across ICMP and IP neighbor scanning. ChangesDocumentation Link Updates and Formatting
Subnet Parsing Refactoring
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/ADVISORY_MULTI_NETWORK.md`:
- Line 10: The documentation uses inconsistent casing for plugin query params;
update the link in ADVISORY_MULTI_NETWORK.md that currently uses ?h=dbclnp to
use the plugin ID's uppercase form ?h=DBCLNP so it matches the plugin ID
(DBCLNP) used in PLUGINS.md and aligns with the existing ?h=SNMPDSC link; search
for occurrences of ?h=dbclnp and replace them with ?h=DBCLNP to ensure
case-sensitive matching.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dbf6928b-51de-4db3-9490-98918fe8319f
📒 Files selected for processing (9)
docs/ADVISORY_MULTI_NETWORK.mddocs/ADVISORY_MULTI_SITE_MONITORING.mddocs/CUSTOM_PROPERTIES.mddocs/DEV_ENV_SETUP.mddocs/PLUGINS.mddocs/SUBNETS.mdfront/plugins/icmp_scan/icmp.pyfront/plugins/ipneigh/ipneigh.pyfront/plugins/plugin_helper.py
| * **B. Plan Subnet & Scan Interfaces:** Explicitly configure each accessible segment in `SCAN_SUBNETS` with the corresponding interfaces. | ||
| * **C. Remote & Inaccessible Networks:** For networks unreachable via ARP, use these strategies: | ||
| * **Alternate Plugins:** Supplement discovery with [SNMPDSC](SNMPDSC) or [DHCP lease imports](https://docs.netalertx.com/PLUGINS/?h=DHCPLSS#available-plugins). | ||
| * **Alternate Plugins:** Supplement discovery with [SNMPDSC](https://docs.netalertx.com/PLUGINS/?h=SNMPDSC#available-plugins) or [DHCP lease imports](https://docs.netalertx.com/PLUGINS/?h=DHCPLSS#available-plugins). |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check plugin ID casing in docs/PLUGINS.md to determine correct format
# Search for SNMPDSC and DBCLNP plugin references
rg -n "^\| \`(SNMPDSC|DBCLNP)\`" docs/PLUGINS.mdRepository: netalertx/NetAlertX
Length of output: 497
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check the specific file for h= query casing
rg -n "\?h=" docs/ADVISORY_MULTI_NETWORK.md
# Also list any occurrences of these plugin IDs in the file for context
rg -n "\bSNMPDSC\b|\bDBCLNP\b" docs/ADVISORY_MULTI_NETWORK.md
# Check where those plugin IDs appear elsewhere in docs (optional but helpful)
rg -n "DBCLNP|SNMPDSC" docs --glob='*.md' | head -n 50Repository: netalertx/NetAlertX
Length of output: 3101
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find how `?h=` is used/parsed in the repo
rg -n "\"\?h=|\\?h=|\\bh=\\$\\{?|\\bh=\" --glob='*.{js,ts,tsx,jsx,py,rb,go,java,cs,php,sh,md,html,css,scss,vue}' . || true
# Look for `available-plugins` anchor/id generation
rg -n "available-plugins" docs . || true
# Find any code/docs that mention DBCLNP/SNMPDSC link construction
rg -n "SNMPDSC|DBCLNP|DHCPLSS" docs . || true
# Check if there's a docs-link helper for plugin IDs
rg -n "PLUGINS/.+\\?h=|docs\\.netalertx\\.com/PLUGINS/\\?h=" . || trueRepository: netalertx/NetAlertX
Length of output: 133
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find how `?h=` is used/parsed in the repo (search relevant patterns)
rg -n --glob='*.{js,ts,tsx,jsx,py,rb,go,java,cs,php,sh,md,html,css,scss,vue}' '(\\\?h=|\\bh=\\$\\{|\\bh=)' . || true
# Find any docs anchor generation / references for "available-plugins"
rg -n "available-plugins" docs . || true
# Check for any code/docs that construct PLUGINS search URLs with ?h=
rg -n "docs\\.netalertx\\.com/PLUGINS/\\?h=|/PLUGINS/\\?h=" . || true
# Check for any helper that builds plugin links with `h` param
rg -n "PLUGINS.*\\?h=|\\?h=.*`#available-plugins`|plugin.*\\?h=" . || trueRepository: netalertx/NetAlertX
Length of output: 3543
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Confirm canonical casing in docs/PLUGINS.md
rg -n "^\| `(DBCLNP|SNMPDSC|DHCPLSS)`" docs/PLUGINS.md || true
# Find any code/templates that parse `?h=` (static-site/search logic)
rg -n "h=|\\?h=|searchParams\\.get\\(['\"]h['\"]\\)|URLSearchParams\\(|get\\(['\"]h['\"]\\)" . --glob='*.{js,ts,tsx,jsx,py,rb,go,java,cs,php,sh,md,html,css,scss,vue}' || true
# Look specifically for any case-normalization logic around that parameter
rg -n "toLowerCase\\(\\)|toUpperCase\\(\\)|lowercase|uppercase" . --glob='*.{js,ts,tsx,jsx,py,rb,go,java,cs,php,sh,md,html,css,scss,vue}' || trueRepository: netalertx/NetAlertX
Length of output: 50532
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Where the frontend reads query param `h`
rg -n "get\\(['\"]h['\"]\\)" . --glob='*.{js,ts,tsx,jsx,php,html,css,scss}' --glob='!**/node_modules/**' || true
rg -n "URLSearchParams\\([^\\)]*\\)\\s*;|new URLSearchParams\\(window\\.location\\.search\\)" front docs server --glob='*.{js,ts,tsx,jsx,php,html}' || true
# If there's any case normalization around it
rg -n "get\\(['\"]h['\"]\\).*toLowerCase|toLowerCase\\(\\).*get\\(['\"]h['\"]\\)|toUpperCase\\(\\).*get\\(['\"]h['\"]\\)" . --glob='*.{js,ts,tsx,jsx,php,html}' || true
# Inspect any docs override that might implement query highlighting
rg -n "\\?h=|\\b'h\\b|available-plugins" docs/overrides docs --glob='*.{html,js,css,md}' --max-count=200 || trueRepository: netalertx/NetAlertX
Length of output: 2081
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Find where `h` is read from query params
rg -n "get\\(['\"]h['\"]\\)" front server --glob='*.{js,ts,php}' || true
rg -n "\\?h=|/PLUGINS/\\?h=|available-plugins" front server docs --glob='*.{js,ts,php,md,html}' || true
# 2) For the likely locations, print small context blocks around where URLSearchParams is proxied/used.
for f in \
front/js/common.js \
front/pluginsCore.php \
front/report.php \
front/deviceDetails.php \
front/js/ui_components.js \
; do
if [ -f "$f" ]; then
echo "===== $f (context around h) ====="
rg -n "h['\"]\\)|get\\(['\"]h['\"]\\)" "$f" || true
# Print a small window around occurrences to avoid huge output
rg -n "get\\(['\"]h['\"]\\)" "$f" -n | head -n 20 | cut -d: -f1 | while read -r line; do
start=$((line-15)); end=$((line+40));
sed -n "${start},${end}p" "$f" | nl -ba | sed -n '1,120p'
echo "----"
done || true
fi
done
# 3) Also check server side for handling of query param `h`
rg -n "REQUEST.*\\?h|\\bh\\b.*request|\\?h=" server --glob='*.{php,py,js,ts}' || true
rg -n "getQueryParam\\(|query.*h|search.*h" server --glob='*.{php,py,js,ts}' || trueRepository: netalertx/NetAlertX
Length of output: 7687
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for any code that explicitly reads query param `h`
rg -n --hidden --no-ignore-vcs --glob='!**/node_modules/**' \
"(get\\(['\"]h['\"]\\)|searchParams\\.get\\(['\"]h['\"]\\)|URLSearchParams\\([^\\)]*\\)\\s*\\)|location\\.search)" .
# Search for any usage of `available-plugins` in scripts/templates (might tie to `h=...`)
rg -n --hidden --no-ignore-vcs --glob='!**/node_modules/**' \
"available-plugins|PLUGINS\\/?\\?h=|\\?h=" docs front server . --glob='*.{js,ts,php,py,html,css,md}'
# Narrow further to docs theme overrides
rg -n --hidden --no-ignore-vcs --glob='!**/node_modules/**' \
"URLSearchParams|location\\.search|\\?h=|available-plugins|get\\(['\"]h['\"]\\)" docs/overrides docs --glob='*.{js,html,css,md}'Repository: netalertx/NetAlertX
Length of output: 771
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find any code that reads query param `h` directly
rg -n "params\\.get\\(['\"]h['\"]\\)|get\\(['\"]h['\"]\\)\\s*\\)|request\\.args\\.get\\(['\"]h['\"]\\)|args\\.get\\(['\"]h['\"]\\)" front server docs . --glob='*.{js,ts,php,py,rb,html,md,css,scss,vue}' || true
# Look for any `h` handling on query/search params (normalization or lower/upper)
rg -n "['\"]h['\"]\\s*\\)|\\bh\\b\\s*[:=].*\\?h=|lowercase|uppercase|toLowerCase\\(|toUpperCase\\(" front server docs . --glob='*.{js,ts,php,py,rb,html,md,css,scss,vue}' || true
# If nothing found, at least inspect the occurrences of URLSearchParams usage to see if 'h' is used.
for f in front/report.php front/pluginsCore.php front/deviceDetails.php front/js/ui_components.js front/js/common.js; do
if [ -f "$f" ]; then
echo "==== $f ===="
rg -n "URLSearchParams\\(|window\\.location\\.search" "$f" || true
# show nearby lines for the first few matches
rg -n "URLSearchParams\\(" "$f" | head -n 10 | cut -d: -f1 | while read -r line; do
start=$((line-10)); end=$((line+60));
sed -n "${start},${end}p" "$f" | nl -ba
echo "----"
done
fi
doneRepository: netalertx/NetAlertX
Length of output: 50439
Standardize h query param casing to match plugin IDs
docs/ADVISORY_MULTI_NETWORK.md uses ?h=SNMPDSC (line 10), which matches the plugin ID SNMPDSC in docs/PLUGINS.md. Line 113 uses ?h=dbclnp, but the plugin ID there is DBCLNP; update the link to ?h=DBCLNP for consistent casing (and to avoid any case-sensitive matching).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/ADVISORY_MULTI_NETWORK.md` at line 10, The documentation uses
inconsistent casing for plugin query params; update the link in
ADVISORY_MULTI_NETWORK.md that currently uses ?h=dbclnp to use the plugin ID's
uppercase form ?h=DBCLNP so it matches the plugin ID (DBCLNP) used in PLUGINS.md
and aligns with the existing ?h=SNMPDSC link; search for occurrences of
?h=dbclnp and replace them with ?h=DBCLNP to ensure case-sensitive matching.
Summary by CodeRabbit