Skip to content

Fix Codex review findings; prep NetDiagram-PS 1.3.0 for Gallery - #8

Merged
jacobyoby merged 5 commits into
mainfrom
fix/codex-review-gallery-ready
Jul 30, 2026
Merged

jacobyoby merged 5 commits into
mainfrom
fix/codex-review-gallery-ready

Conversation

@jacobyoby

@jacobyoby jacobyoby commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Addresses the Codex review so NetDiagram-PS is clean to publish to the PowerShell Gallery. Module bumped to 1.3.0.

Fixed

High

  1. SNMP discovery returned nothing after import. Get-SnmpNeighbors only queried Reachable -eq $true, but imported inventory has Reachable = $null. Untested nodes are now eligible by default; added -OnlyReachable opt-in. The documented import-then-discover workflow now works end to end.
  2. Community string leaked to verbose output. Invoke-SnmpWalk now redacts -c <community> to -c ****. Process-list exposure documented as a known limitation.
  3. Fragile LLDP/CDP parsing. Now inspects only the value portion of each line, validates IPv4 octets, decodes 4-octet Hex-STRING management addresses, and skips self-loops. Documented as best-effort MVP in help + README.
  4. Wizard assumed /24. examples/New-NetworkDiagram.ps1 now derives hosts from the real CIDR prefix and caps Full scans of large subnets at a /22 (1022 hosts) with a warning.

Medium

  1. Windows-separator Join-Path fixed in the wizard module path.
  2. Invoke-SnmpWalk validates Version (v1/v2c/v3), TargetIP (IPv4/FQDN), OID (dotted-decimal), rejects args starting with -, and restricts binary resolution to -CommandType Application.
  3. Invoke-PortScan validates ports (1-65535) and timeout (1-60000); removed TCP 161 from defaults (SNMP is UDP).
  4. Export-DrawIO de-duplicates node IPs (no more duplicate mxCell ids).
  5. Export-DrawIO parents nodes into their matching subnet container via Test-IPInSubnet; unmatched nodes laid out below the containers.

Low

  1. Resolve-IPHostname now honors -TimeoutSeconds (async DNS); previously ignored.
  2. Reconciled stale docs (README 7.4+, STRUCTURE 1.3.0 + CI section).

Tests

Behavior change to note

  • The quick-start wizard's scan depths changed: Quick samples up to 8 hosts across the real range, Medium the first 50, Full all usable hosts capped at a /22. It is no longer /24-only.

jacobyoby and others added 5 commits July 30, 2026 08:55
- Get-SnmpNeighbors: query untested nodes (Reachable=$null) by default so the
  import-then-discover workflow works; add -OnlyReachable opt-in switch.
- Invoke-SnmpWalk: redact community from verbose output (-c ****); validate
  Version/TargetIP/OID and reject values starting with '-'; restrict binary
  resolution to -CommandType Application; document process-list exposure.
- Harden LLDP/CDP parsing (value-only, octet-validated, Hex-STRING aware,
  self-loop guard) and document it as best-effort.
- Export-DrawIO: de-duplicate node IPs; parent nodes into their matching subnet
  container via Test-IPInSubnet, laying unmatched nodes out below the containers.
- Invoke-PortScan: ValidateRange on ports (1-65535) and timeout (1-60000);
  drop TCP 161 from defaults (SNMP is UDP).
- Resolve-IPHostname: honor -TimeoutSeconds via async DNS with a bounded wait.

Co-Authored-By: wren <wren@users.noreply.github.com>
- Manifest ModuleVersion 1.2.0 -> 1.3.0 with review-summary ReleaseNotes.
- Add CHANGELOG 1.3.0 entry.
- README: require 7.4+ (was 7.0+); document SNMP eligibility, -OnlyReachable,
  best-effort LLDP parsing, and community redaction/process-list caveat.
- STRUCTURE: update to 1.3.0/2026-07-30, add .github CI to the layout, and
  describe the CI workflow.

Co-Authored-By: wren <wren@users.noreply.github.com>
- Replace the /24 assumption with real IPv4 CIDR host enumeration derived from
  the interface prefix; cap Full scans of large subnets at a /22 (1022 hosts)
  with a warning; extract Get-SubnetScanTarget for testability.
- Fix Windows-separator Join-Path for the module path.

Co-Authored-By: wren <wren@users.noreply.github.com>
Covers SNMP node eligibility (#1), Invoke-SnmpWalk parameter validation (#6),
Invoke-PortScan validation (#7), Export-DrawIO duplicate-IP dedupe (#8) and
subnet-container parenting (#9), and the wizard CIDR math (#4).

Co-Authored-By: wren <wren@users.noreply.github.com>
Co-Authored-By: wren <wren@users.noreply.github.com>
@jacobyoby
jacobyoby merged commit f092854 into main Jul 30, 2026
4 checks passed
@jacobyoby
jacobyoby deleted the fix/codex-review-gallery-ready branch July 30, 2026 15:57
jacobyoby added a commit that referenced this pull request Sep 9, 2026
- Strip bare #1/#4/#6/#7/#8/#9 references that collided with real GitHub
  issue numbers; keep real issue references (#10, #13, #15, #17, #19,
  #20, #27, #34). Manifest ReleaseNotes already free of #n.
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