Repository navigation
Manage a Machine's Projects over the Machine connection - #100
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Closes #99
A connected Machine's Projects can now be managed from this app as this computer's are: add (folder picked and scanned on the Machine), import a Project file from the Machine, edit a Project, its Environment and Profiles, add/edit/remove Services, Detect Services, delete, and favourite. Nothing of a Machine's Projects is stored here.
Protocol and core
MACHINE_PROTOCOL_VERSIONis now 2 (MANAGES_PROJECTS). NewMachineRequests:ListDirectory,ScanFolder,ScanProject,DetectPythonEnvironment,AddProject,EditProject,RemoveProject,AddService,AddServices,EditService,RemoveService,SaveEnvironment,SetActiveProfile,SecretValue,ReadProjectFile,ImportProject. Favourite goes throughEditProject(isFavorite). Reordering isn't offered here, since there's no local operation for it.relayanswers them on the Machine asOrigin::Machine, using the sameProjectLibrarycalls its own app makes, thenannounce_projects_savedso an app open there shows the change. Paths are validated there (existing_project_folder,~expanded there), so errors such as a missing folder or no permission are the Machine's.core::editingmodule holds the steps that take more than one library call: remove a Project or Service (stopped first, logs removed after), edit with a move to another Execution Target, import with Replace, save the Environment editor. Pluslist_directoryandread_project_file. The relay and the desktop app's local editors both use it, so the logic isn't forked.NewService,ProjectChanges,ServiceChanges(with a small double-option helper, so "leave it" and "clear it" stay distinct),ProfileChanges,VariableInputandKeyClashare now serde types. Also new:ProfileInput,DirectoryListing,ProjectFileText, andfree_project_key(projects, key).MachinesandMachineConnectionget the matching methods; FFI exports them for macOS.MachineNeedsUpdate { machine }("Update localhost on devbox to manage its Projects.") andFolderUnreadable { path, reason }.Older Machines
MachineState::Connectedgainsmanages_projects, from the Machine's hello. With an older localhost there (protocol 1), the app shows its Projects as view-and-run only and says "Update localhost on to manage its Projects." The calls refuse before sending anything. AnUnsupportedreply is also mapped to that error, so the user never sees a broken form. Older apps ignore the new hello field and requests, as before.Secrets
Secret values typed in an editor go over the existing SSH connection to the Machine and are written only to its secret store. Reveal reads a value from the Machine (
SecretValue) to show it, the same rule as a local reveal, and never stores it here. Nothing of a Machine's Projects is persisted on the viewing computer: the end-to-end test checks the app's storage root gets noprojects/.Remote folder picker
The system's dialog can't browse another computer, so both apps get localhost's own picker, backed by
ListDirectory:.yaml/.yml), used by Import;It starts at the Machine's home. Errors (not found, permission denied) are shown inline in the Machine's words. Working directories picked on a Machine are made relative to the Project folder.
Apps
machine_editors.rswithmachine_*commands mirroring the local editors.editing.tssends their calls to this computer or the Machine.+next to each Machine's name in the sidebar (New Project / Import Project on devbox…);⋯, and the Profile menu;AppModelrouting to the library orMachines, plus thin wrappers inLocalhostCoreFFI. Details are in the commit.Tests
core/localhost-core/tests/machines.rs:Some(None);editing.rsunit tests forlist_directory: ordering, hidden names, missing folder, permission denied.core/localhost-cli/tests/machines_ssh.rs: end to end over a privatesshdwith the reallocalhost remote --stdio. It lists, scans, adds, edits a Project and a Service, checks they are saved on the Machine and not here, then removes the Project.editProblem; VitestMachineEditing.test.tsxcovers:cargo testandcargo fmt --checkincore/; all pass.cargo clippy --all-targets -D warnings, and forx86_64-pc-windows-msvc: clean for this change. On the local toolchain (1.99) clippy flagslogs.rs:304andsrc-tauri/src/wsl.rs:59, both onmainand untouched here; CI's 1.90 doesn't raise them.apps/desktop:pnpm typecheck,pnpm test,pnpm build,cargo testandcargo clippyinsrc-tauri/(bindings.tsregenerated).Not tested / left out
uniffi-bindgen(swift testandxcodebuildnot run). Things to check first in Xcode:AppModel+Machines.swift:machines(for:)shares its name with themachinesproperty;RemoteFolderPicker.swift:List(selection:)with an optionalString, and the conditionalkeyboardShortcut;Sheetcases' defaulted associated values.Onboarding.test.tsx› "remembers the first Running Service…" failed twice in about 25 fullpnpm testruns on this branch. It passed 4/4 full runs onmain, and 25/25 run alone on both branches; I couldn't tie it to this change.