Skip to content

0.8.0-dev3.1: netbox_writeback_dry_run config knob (deploy-safety follow-up)#4

Merged
stevenca merged 2 commits into
mainfrom
fix/0.8.0-dev3.1-writeback-dry-run-knob
Jun 1, 2026
Merged

0.8.0-dev3.1: netbox_writeback_dry_run config knob (deploy-safety follow-up)#4
stevenca merged 2 commits into
mainfrom
fix/0.8.0-dev3.1-writeback-dry-run-knob

Conversation

@stevenca
Copy link
Copy Markdown
Owner

@stevenca stevenca commented Jun 1, 2026

Summary

Adds the missing toggle to put the worker's NetBox writeback loop into observe-only mode for a release rollout. The diff/report machinery in reconcile_to_netbox has supported dry_run=True end-to-end since 0.7.0; this PR just exposes it through Settings so an operator can flip it via env var (Helm worker.extraEnv) or via the core secret. Default remains False — production behavior unchanged for any deployment that doesn't explicitly opt in.

Motivation

cpn-ful-netcortex1 is currently running 0.6.0.dev66 (helm rev 53 from May 31). The merge of #1#3 has pushed main to 0.8.0-dev3. Deploying to main actually rolls out everything since the public-repo initial publish: the full 0.7.0 NetBox-as-system-of-record release (commit 1c90b61), ThousandEyes adapter, FMC adapter, MCP auth, plus 0.8.0-dev1's NATS infrastructure and dev2/dev3 reflex foundations.

The risky portion of that delta is the 0.7.0 NetBox writeback work. A one-cycle observe-only baseline lets us verify the intended diff against the live NetBox before any PATCH/POST/DELETE fires.

Operational pattern

```bash
helm upgrade netcortex deploy/helm
--set image.tag=0.8.0-dev3.1
--set worker.extraEnv[0].name=NETBOX_WRITEBACK_DRY_RUN
--set worker.extraEnv[0].value="true"
--wait

kubectl -n netcortex logs deploy/netcortex-worker -f | grep netbox_writeback_done
helm upgrade netcortex deploy/helm --set image.tag=0.8.0-dev3.1 --wait
```

Test plan

  • New `tests/test_config_writeback_dry_run.py` covers: default off, env truthy values, env falsy values, core-secret promotion, string-form core-secret values
  • Existing CI: unit, contracts, lint, typecheck, golden, replay, security, SBOM jobs

Risk

Minimal. Settings-only addition with safe default (`False`). No template changes, no schema changes, no behavior change unless explicitly opted in.

Made with Cursor

stevenca and others added 2 commits June 1, 2026 15:11
Adds the missing toggle to put the worker's NetBox writeback loop into
observe-only mode for a release rollout. The diff/report machinery in
`reconcile_to_netbox` has supported `dry_run=True` end-to-end since 0.7.0;
this commit just exposes it through `Settings` so an operator can flip it
via env var (Helm `worker.extraEnv`) or via the core secret.

Default remains `False` — production behavior unchanged for any deployment
that doesn't explicitly opt in.

Motivation: cpn-ful-netcortex1 is jumping from 0.6.0.dev66 directly to
0.8.0-dev3 in one upgrade window, picking up the entire 0.7.0 NetBox-SoR
release along the way. A one-cycle observe-only baseline lets us verify
the intended diff against the live NetBox before any PATCH/POST/DELETE
fires.

Includes 5 unit tests covering: default off, env truthy parsing, env
falsy parsing, core-secret promotion, and string-form values in the
core secret.

Co-authored-by: Cursor <cursoragent@cursor.com>
Hatchling rejects '0.8.0.dev3.post1' per PEP 440. Bump the dev counter
instead; the originally-planned dev4 (first publisher) shifts to dev5.

Co-authored-by: Cursor <cursoragent@cursor.com>
@stevenca stevenca merged commit 4da6df2 into main Jun 1, 2026
8 checks passed
@stevenca stevenca deleted the fix/0.8.0-dev3.1-writeback-dry-run-knob branch June 1, 2026 15:14
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