Skip to content

Next release#1665

Merged
jokob-sk merged 2 commits into
mainfrom
next_release
Jun 2, 2026
Merged

Next release#1665
jokob-sk merged 2 commits into
mainfrom
next_release

Conversation

@jokob-sk
Copy link
Copy Markdown
Collaborator

@jokob-sk jokob-sk commented Jun 1, 2026

Summary by CodeRabbit

  • Documentation
    • Improved clarity and formatting across multiple documentation files, including updated plugin reference links, expanded usage examples, and clearer instructions for setting up and troubleshooting.
  • New Features
    • Added structured support for representing and parsing subnet scan entries, enabling enhanced interface and VLAN management for network scanning plugins.
  • Refactor
    • Updated network scan plugins to use the new subnet parsing for standardized handling of subnets and interfaces, improving maintainability and consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Documentation Link Updates and Formatting

Layer / File(s) Summary
Link consolidation and documentation formatting
docs/ADVISORY_MULTI_NETWORK.md, docs/ADVISORY_MULTI_SITE_MONITORING.md, docs/CUSTOM_PROPERTIES.md, docs/DEV_ENV_SETUP.md, docs/PLUGINS.md, docs/SUBNETS.md
Plugin documentation links replaced with canonical docs.netalertx.com URLs, GitHub repo references updated, table formatting improved for clarity, and markdown syntax corrected for proper block-quote nesting.

Subnet Parsing Refactoring

Layer / File(s) Summary
Plugin helper subnet parsing infrastructure
front/plugins/plugin_helper.py
Module extended with logging initialization. Introduces ScanSubnet dataclass to represent parsed subnet entries with interface, VLAN, and resolved network interface details. Adds parse_scan_subnets(scan_subnets) function to extract --interface and --vlan flags via regex, normalize subnet strings, and resolve actual interface paths under /sys/class/net/.
ICMP scan plugin subnet parsing migration
front/plugins/icmp_scan/icmp.py
Plugin updated to import parse_scan_subnets from plugin_helper, removing local parsing logic. main() now calls parse_scan_subnets(scan_subnets) and derives subnets and interfaces from ScanSubnet objects' subnet and resolved_interface attributes.
IP neighbor plugin subnet parsing migration
front/plugins/ipneigh/ipneigh.py
Plugin updated to import parse_scan_subnets from plugin_helper. main() converts manual interface extraction to deduplicated resolved_interface list from parsed results. get_neighbors() iterates over parsed interface list directly instead of splitting comma-delimited strings, maintaining per-interface ping and neighbor scan logic.

🐰 Through the plugin woods we now refactor bright,
Parsing subnets once, now shared—a unified light!
Docs point true north to canonical ground,
Where ICMP and neighbors in helper are found.
One logic to rule them, no duplication to weigh,
NetAlertX hops forward in a cleaner way! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Next release' is too generic and does not clearly summarize the main changes in the PR, which include documentation updates, plugin helper refactoring, and code consolidation across multiple files. Consider using a more descriptive title that highlights the primary change, such as 'Refactor subnet parsing into plugin_helper and update documentation links' or 'Consolidate subnet parsing and update doc references'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next_release

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8f1da10 and f1a9109.

📒 Files selected for processing (9)
  • docs/ADVISORY_MULTI_NETWORK.md
  • docs/ADVISORY_MULTI_SITE_MONITORING.md
  • docs/CUSTOM_PROPERTIES.md
  • docs/DEV_ENV_SETUP.md
  • docs/PLUGINS.md
  • docs/SUBNETS.md
  • front/plugins/icmp_scan/icmp.py
  • front/plugins/ipneigh/ipneigh.py
  • front/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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 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.md

Repository: 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 50

Repository: 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=" . || true

Repository: 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=" . || true

Repository: 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}' || true

Repository: 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 || true

Repository: 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}' || true

Repository: 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
done

Repository: 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.

@jokob-sk jokob-sk merged commit 2ca5a80 into main Jun 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant