feat(cli): thread Config into the Pathbase path - #202
Draft
ecalifornica wants to merge 1 commit into
Draft
Conversation
|
🔍 Preview deployed: https://dd60415a.toolpath.pages.dev |
`resolve_url` takes `&Config` and reads `$PATHBASE_URL` from it. `credentials_path` and `preflight_auth` take `&Config` and resolve the config directory through `Config::config_dir`. `cmd_pathbase` reads no environment variable. `run()` passes `&Config` to `cmd_auth`. The Pathbase call sites in `cmd_import`, `cmd_export`, and `cmd_share` pass the `&Config` they already hold. Precedence is unchanged: `--url`, then `$PATHBASE_URL`, then https://pathbase.dev.
ecalifornica
force-pushed
the
robert/config-pathbase
branch
from
August 14, 2026 19:49
40bbe24 to
4dd9f37
Compare
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.
Part of #184 (PR 9 of the plan there). Stacked on the share PR (branch
robert/config-share). The resume PR (branchrobert/config-resume) stacks onthis one. path-cli only.
What
cmd_pathbase::resolve_urltakes&Configand reads the server override fromconfig.pathbase_url.cmd_pathbase::credentials_pathandcmd_pathbase::preflight_authtake&Configand locate the credentials file throughConfig::config_dir.cmd_pathbasereads no environment variable. It stops re-exportingPATHBASE_URL_ENV;config.rsis the only user of that constant.normalize_urlstrips one trailing/.resolve_urlcalls it.derive::parse_pathbase_refcalls it for the--urlflag, where the flagvalue always wins, so that function needs no
Config.run()passes&Configtocmd_auth::run.cmd_auth::logintakes it andcalls
resolve_url.cmd_export::run_pathbaseandcmd_export::resolve_upload_base_urltake&Config. Thep exportdispatch passes the&Configit already holds.cmd_share::runpasses its&Configtoresolve_upload_base_urland to bothpreflight_authcalls.derive::pathbase_fetch_to_doctakes&Config. Thep import pathbasearmpasses the
&Configit already holds.cmd_resumeis threaded by its own PR;resolve_inputloads a transitionalConfigat that call site.cache.rsstill resolves its directory through the freeconfig_dir(). Alater PR owns it.
Emscripten
cmd_pathbaseandcmd_authare#[cfg(not(target_os = "emscripten"))]modules; the emscripten bail arms incmd_importandcmd_exportconsume the&Configthey receive.Behavior change
--urlflag, then$PATHBASE_URL, thenhttps://pathbase.dev.Tests
Configin place of an environment variable:resolve_url_falls_back_to_config_then_defaultandcredentials_path_sits_under_the_config_dir.preflight_authtests inject aConfigcarrying a tempdir config dir.They drop their
$TOOLPATH_CONFIG_DIRscaffolding and the sharedTEST_ENV_LOCKguard, so they no longer serialize against the rest of thesuite. The
EnvGuardhelper is deleted; those 5 tests were its only users.cmd_export'spathbase_repo_flag_requires_logininjects aConfiganddrops its
$TOOLPATH_CONFIG_DIRsave/restore block and itsTEST_ENV_LOCKguard.
derive'spathbase_fetch_to_doc_url_inputpasses aConfigrooted at atempdir, so it reads no ambient credentials.
$PATHBASE_URL: the 12 Pathbase integration testspass
--url, which is the flag layer. The$PATHBASE_URLlayer is covered bythe
config.rsfigment jail test.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.