0.8.0-dev3.1: netbox_writeback_dry_run config knob (deploy-safety follow-up)#4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_netboxhas supporteddry_run=Trueend-to-end since 0.7.0; this PR just exposes it throughSettingsso an operator can flip it via env var (Helmworker.extraEnv) or via the core secret. Default remainsFalse— production behavior unchanged for any deployment that doesn't explicitly opt in.Motivation
cpn-ful-netcortex1is currently running0.6.0.dev66(helm rev 53 from May 31). The merge of #1–#3 has pushedmainto0.8.0-dev3. Deploying tomainactually rolls out everything since the public-repo initial publish: the full 0.7.0 NetBox-as-system-of-record release (commit1c90b61), 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
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