Development setup
rcfg-sim is open source (MIT) and contributions are welcome. This page covers the local workflow; read Scope & versioning before proposing changes that touch user-facing surfaces.
Prerequisites
Section titled “Prerequisites”- Go 1.24+ (CI tests 1.24 and 1.25)
make,git
git clone https://github.com/rconfig/rconfig-sim.gitcd rconfig-simmake buildThe pre-merge gate
Section titled “The pre-merge gate”Every PR must pass the same gate CI runs. Run it locally before pushing:
make fmt # gofmt -s, no diff after runningmake vet # go vet, with and without the integration tagmake test # unit tests, incl. determinism and metrics cardinalitymake build # both binaries compileAnd for changes that touch the SSH path, the integration suite:
make integration # real SSH listeners on loopback (build tag: integration)Tests you should know about
Section titled “Tests you should know about”- Determinism tests (
TestRunDeterministic,TestCienaDeterministic) hash the generated output across two same-seed runs. Any change to template output for a given seed fails them by design; update the fixture only when the diff is intentional. See Determinism. - Cardinality test asserts the Prometheus label sets stay bounded. Adding a label or value without updating it will fail. See Metrics overview.
- Characterization tests pin Cisco output (greeting, enable-mode flow, session close) so
refactors stay byte-identical. Run
make integrationbefore and after a refactor.
Benchmarks
Section titled “Benchmarks”make benchThe hot path (command dispatch) benchmarks around 640 ns/op. Preserve the zero-copy path — no
per-command allocations on show running-config. See
Architecture.
Dependencies
Section titled “Dependencies”The project intentionally depends on only three external libraries
(golang.org/x/crypto, golang.org/x/sys, prometheus/client_golang). New dependencies need
discussion first — see Scope.