Repository navigation
fix(desktop): stop portable launchers from persisting bind overrides into config.json - #1836
Open
fengyue-xve wants to merge 1 commit into
Open
fengyue-xve wants to merge 1 commit into
fengyue-xve wants to merge 1 commit into
Conversation
octop run writes --host/--port CLI overrides into config.json, so the desktop exe and the start.bat/start.sh portable launchers rewrote a hand-edited bind_host on every start (issue TencentCloud#1816). - process.go passes OCTOP_BIND_HOST/OCTOP_PORT env instead of flags; env is honored by resolve_bind and never persisted - start.bat/start.sh forward --host/--port only when the user passed them explicitly, so plain launches read config.json untouched Fixes TencentCloud#1816
Author
|
Heads-up: develop currently has two unrelated repo-level CI failures that also surface on this PR. (1) The Linux job flakes on |
This branch has not been deployed
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
Fixes #1816.
octop run --host/--portpersists the CLI overrides intoconfig.jsonby design, but the desktop exe and the portable launchers passed their own defaults as flags on every start, so a hand-editedbind_hostreverted to127.0.0.1the moment the app restarted.desktop/src/process.go: the spawnedlaunch.py runno longer carries--host 127.0.0.1 --port <port>flags. The same values are passed asOCTOP_BIND_HOST/OCTOP_PORTenv entries, whichresolve_bindhonors (env > config.json) and never writes back. The desktop still binds loopback exactly as before, so no behavior changes beyond persistence.desktop/portable/templates/start.bat/start.sh:--host/--portare now forwarded only when the user passed them explicitly (documentedoctop runflag semantics preserved). A plain launch passes neither, so the bind comes fromconfig.jsonand the file is left untouched. The status line now says when values come fromconfig.jsoninstead of printing a possibly-wrong default URL.config.jsonis the default source.Target branch
develop(feature / fix — default)Type of change
Test plan
gois not installed / cannot be executed), so theprocess.gochange is verified by inspection + CI/manual; it only replaces argv flags with env entries on the sameexec.Command.uv run pytest tests/unit/cli/test_run_bind_resolution.py— passed, including the newtest_env_overrides_do_not_touch_config_filewhich runsoctop runwithOCTOP_BIND_HOST/OCTOP_PORTset and assertsconfig.jsonkeeps its original bytes (no "Saved config", uvicorn gets the env values).uv run pytest tests/unit/desktop/test_portable_launcher_argv.py— 3 passed. The tests run the realstart.shwith a stubbed portable Python: a default launch executeslaunch.py runwith no--host/--portat all, while explicit flags are still forwarded. Red→green: on the unpatched script the first and third cases fail because the defaults are always appended.ruff check/ruff format --checkon the changed test files — clean.Checklist
CHANGELOG.md(if user-facing)