feat(update): add --dry-run flag showing version, images, and .env diff without applying#411
Conversation
Lightheartdevs
left a comment
There was a problem hiding this comment.
Review: Needs Work
The dry-run concept is solid but there are a couple bugs:
1. --force flag silently removed (breaking change)
The new argument parsing in cmd_update() replaces the old case block and drops --force|-f handling entirely. Unrecognized flags are now silently ignored via *) shift. Users relying on dream update --force will get no error — it'll just be ignored. Please restore the --force flag alongside --dry-run.
2. Bash subshell variable scoping bug
images_shown is set to false, then updated to "true" inside a pipe (| while read ...). Due to bash subshell scoping, the update never propagates to the parent shell. The fallback image display will always run regardless. Fix: use a process substitution or temp file instead of a pipe.
3. Ruff lint failure
CI shows a Python lint failure — likely the str | None union syntax which requires Python 3.10+. Use Optional[str] for broader compatibility.
What's good
- The
cmd_dry_run()function is strictly read-only — verified no writes anywhere - Good coverage: version, images, model config, .env keys
- API endpoint properly auth-gated
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
|
Thanks for the detailed review — addressed all three items:
Pushed in the latest commit; let me know if you want anything else tightened before re-review. |
Summary
dream update --dry-run(alias-n) previews what an update would change without pulling images or restarting any containersGET /api/update/dry-runendpoint inrouters/updates.pyreturns version comparison, configured image tags, and update-relevant.envkeys as structured JSONdocker compose pullwould fetch), Model configuration (TIER, LLM_MODEL, GGUF_FILE, CTX_SIZE, GPU_BACKEND, N_GPU_LAYERS), and .env keys the update path reads/writescmd_update()dispatcher now passes"$@"so all flags reach the functionFiles changed
routers/updates.py— addedGET /api/update/dry-runendpoint and_UPDATE_ENV_KEYSconstantdream-cli— addedcmd_dry_run(), wired--dry-run/-nintocmd_update(), fixed dispatcher arg forwarding, added help exampleTest plan
dream update --dry-runon an up-to-date install → shows "up to date", lists current images and .env keys, exits 0dream update --dry-runwhen a newer GitHub release exists → shows "update available" with version diff and changelog URLdream update -n(short flag) works identicallydream update(no flag) still performs the real update unchangedGET /api/update/dry-runvia dashboard API returnsdry_run: true, correctcurrent_version,imageslist, andenv_keysdocker events)