Skip to content

feat(automation): lab config push/verify/report pipeline - #1

Merged
buraglio merged 18 commits into
mainfrom
worktree-lab-automation
Jul 30, 2026
Merged

feat(automation): lab config push/verify/report pipeline#1
buraglio merged 18 commits into
mainfrom
worktree-lab-automation

Conversation

@buraglio

Copy link
Copy Markdown
Contributor

Summary

  • Adds a complete automation/ Python project (uv-managed, no venv) that renders Jinja2 config templates, pushes them to OCNOS and Juniper MX204 devices over SSH, captures show-command output to disk, and pre-populates the compliance tracker SQLite database with N/A TestResult rows for human review.
  • Plugin-style platform driver architecture (drivers/base.pyOcnosDriver, JunosDriver) means adding a new NOS requires only one new file + two lines in the registry — no changes to the pipeline or CLI.
  • Ansible-compatible inventory (hosts.yaml / groups.yaml) readable by both Nornir and Ansible.
  • Jinja2 templates for all 9 lab scenarios (36 device configs total); all addresses and shared vars centralized in templates/vars/global.yaml; secret placeholders parameterized via secrets.* vars.
  • Click CLI: uv run lab-push render|push|verify|report|all --scenario <N|all> [--device X] [--workers N]
  • Parallel push via ThreadPoolExecutor; failed hosts skipped in verify/report without aborting other hosts.
  • 18 pytest tests (unit + SQLite integration); 18/18 passing.

Test plan

  • cd automation && uv sync && uv run pytest -v → 18/18 passing
  • uv run lab-push render --scenario all → 36 .cfg files in rendered/, no Jinja2 errors
  • uv run lab-push --help → shows all 5 subcommands with correct options
  • Set LAB_USERNAME, LAB_PASSWORD, DATABASE_URL and run uv run lab-push all --scenario 1 against real devices
  • Verify N/A TestResult rows appear in the compliance tracker web UI after report phase

🤖 Generated with Claude Code

buraglio and others added 18 commits July 29, 2026 16:35
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…_scenario

Co-Authored-By: Claude <noreply@anthropic.com>
…/all)

Co-Authored-By: Claude <noreply@anthropic.com>
…nario, exit code

Co-Authored-By: Claude <noreply@anthropic.com>
…narios

Co-Authored-By: Claude <noreply@anthropic.com>
…scenario templates

Co-Authored-By: Claude <noreply@anthropic.com>
…holders in templates

Replace vacuous test body with a direct _deep_merge assertion that validates
scenario vars override global vars while preserving non-overridden keys.

Parameterize hardcoded RADIUS-SECRET, TACACS-SECRET, IPSEC-SECRET, L2TP-SECRET,
and SNMP PUBLIC strings in scenario-01 and scenario-09 templates via a new
secrets section in global.yaml, so operators cannot accidentally deploy
unsubstituted placeholder values.

Co-Authored-By: Claude <noreply@anthropic.com>
…ct compiler errors

Regexes with the `g` flag are stateful (lastIndex). Resetting lastIndex
inside useMemo violates the React compiler's immutability rules. Dropping
`g` makes each .test() call stateless, eliminating both the mutation and
the need to reset.

Co-Authored-By: Claude <noreply@anthropic.com>
- PlatformComplianceSection: move setState calls out of synchronous
  effect body by chaining through Promise.resolve(); add AbortController
  cleanup; derive displayedContent from state instead of setting null
  inside the effect
- ConfigViewer: move keywords lookup inside useMemo to fix exhaustive-deps
  warning (testCaseName is now the direct dependency)
- print/route.ts: remove unused notFound import

Co-Authored-By: Claude <noreply@anthropic.com>
@buraglio
buraglio merged commit 535fa8c into main Jul 30, 2026
1 check 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