Skip to content

Add Cloud Agent development environment for NetDiagram-PS - #84

Closed
jacobyoby wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-3dc0
Closed

jacobyoby wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-3dc0

Conversation

@jacobyoby

@jacobyoby jacobyoby commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a reproducible, repo-managed Cloud Agent development environment so agents can run the NetDiagram-PS module, its Pester test suite, and the PSScriptAnalyzer linter end to end without manual setup.

The repository had no environment configuration; a fresh VM ships without PowerShell or the networking tools the discovery wizard depends on. This change captures the full toolchain in version control.

What was added

  • .cursor/Dockerfile — Ubuntu 24.04 base image with:
    • PowerShell 7 (the module targets 7.4+) installed from Microsoft's package repository
    • net-snmp for the optional SNMP discovery commands (snmpwalk)
    • iproute2 (ip) and net-tools (arp) — the Linux networking tools the quick-start wizard shells out to for interface/route/neighbor discovery
  • .cursor/install.sh — idempotent bootstrap that installs Pester (>= 5.0.0) and PSScriptAnalyzer for the current user (only when missing) and validates the module manifest.
  • .cursor/environment.json — wires the Dockerfile build and install step, running as the ubuntu user.

Validation

Verified on the VM before committing:

Check Result
./tests/run-tests.sh (Pester) 162 passed, 0 failed
Test-ModuleManifest NetDiagram-PS 1.4.0, PowerShellVersion 7.4
PSScriptAnalyzer -Severity Error 0 errors
Quick-start wizard (examples/New-NetworkDiagram.ps1) Discovers interface 172.30.0.2/24, gateway, DNS; generates diagram
Manual inventory workflow (Import-Inventory → Export-DrawIO/Export-Mermaid/Export-NetBox) Valid draw.io XML with all device IPs; Mermaid + NetBox CSV produced
install.sh idempotence Passed twice

Fresh built-environment verification

A draft environment build ran the install step against a clean checkout (exit 0), then a fresh Cloud Agent booted from that build and re-ran every check:

Check Result
PowerShell / net-snmp / iproute2 / net-tools 7.6.6 / 5.9.4 / iproute2-6.1.0 / /usr/sbin/arp
Pester / PSScriptAnalyzer 6.2.0 / 1.25.0
Test-ModuleManifest NetDiagram-PS 1.4.0
./tests/run-tests.sh Tests Passed: 162, Failed: 0 (exit 0)
End-to-end inventory → draw.io Valid dual-stack XML, 5 nodes

Rendered output

The generated .drawio opened and rendered correctly in diagrams.net (subnet containers with router/switch/server/workstation and an IPv6 router):

Generated NetDiagram-PS draw.io network diagram rendered in diagrams.net

Notes

  • Pester resolves to 6.x on a fresh install (the module and CI both pin only a >= 5.0.0 floor); the suite runs clean under it.
  • This is a repo-managed environment (.cursor/environment.json), so it takes precedence over any dashboard-managed environment and activates automatically for agents on this branch (and on main once merged) — no dashboard Save required.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Provide a reproducible repo-managed environment so agents can run the
module, test suite, and linter end to end:

- .cursor/Dockerfile: Ubuntu 24.04 base with PowerShell 7, net-snmp, and
  the Linux networking tools (iproute2, net-tools) the discovery wizard
  shells out to.
- .cursor/install.sh: idempotent bootstrap that installs Pester (>= 5) and
  PSScriptAnalyzer for the current user and validates the module manifest.
- .cursor/environment.json: wires the Dockerfile build and install step,
  running as the ubuntu user.

Co-authored-by: jacob <jacob@jacobrakai.org>
@cursor
cursor Bot deleted the cursor/setup-dev-environment-3dc0 branch September 19, 2026 18:20
@jacobyoby jacobyoby closed this Sep 19, 2026
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.

2 participants