feat(cli): thread Config into the share path - #200
Draft
ecalifornica wants to merge 1 commit into
Draft
Conversation
The share command receives `&Config` from run() and passes it down: the harness bundle, the derive helpers, the manifest record surfaces, and the configured-remote lookup. - `cmd_share::run` takes `&Config`. `share_explicit`, `derive_session`, and `resolve_destination` take it as a parameter. - The picker bundle and the freshness-stat bundle come from `providers::harness_bundle(config)`. - `sync::fresh_cache_id` takes `&Config`. It is the last record surface that loaded one per call. - `share_config::resolve_remote` takes `&Config` and resolves the config file through `Config::config_dir`. - `HarnessBundle::from_environment` is deleted. Share was its last caller.
|
🔍 Preview deployed: https://5f4d65d9.toolpath.pages.dev |
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 8 of the plan there). Stacked on the export PR (branch
robert/config-export). path-cli only.What
run()passes&Configtocmd_share.share_explicit,derive_session, andresolve_destinationtake it as a parameter. The twoConfig::load()sites incmd_shareare gone.providers::harness_bundle(config).HarnessBundle::from_environmentis deleted.sharewas its last caller.sync::fresh_cache_idtakes&Config. No record surface in the sync engine loads aConfigper call.share_config::resolve_remotetakes&Configand locatesconfig.tomlthroughConfig::config_dir. The~/expansion of a rule'sdirstill uses the freehome_dir().cache.rsandcmd_pathbase.rsstill resolve their directory through the freeconfig_dir(). Later PRs own them.$PATHBASE_URL, the credentials file, and thecmd_exportPathbase machinery keep their current form.Emscripten
from_environmentare native-only (cfg(not(target_os = "emscripten"))), so the emscripten build is unaffected.Behavior change
shareas well. This PR does not change that resolution further.Tests
resolve_destinationunit tests take aConfigcarrying the temp config dir.cmd_sharesets no environment variable and needs noTEST_ENV_LOCKguard.fresh_cache_id_tracks_source_and_evictionpasses the jailConfig.tests/integration.rsshare_configured_repo_requires_loginandshare_configured_repo_uploads_when_authedrun the binary with$TOOLPATH_CONFIG_DIRset, soConfigreachesresolve_remoteend to end.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.