Repository navigation
feat: bring the operator's checkout up to a closed mission's destination - #2457
Merged
Merged
Conversation
… project with no remote as skipped
…e a catch-up on another branch
Contributor
Author
|
Merging while main's push run 43091533179 (e53b664) reads failure: every one of its 46 lanes passed or was skipped, and only the aggregate |
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.
Related: PRD mission-destination (pull request 4 of 4, D-41), after #2451 (merged). Paired with with-hide/hide-private#869.
Summary
When a mission ends, the operator's own folder now gets its results without a manual pull, but only when that is safe.
On a close as done or
merge_wait(and when a waiting mission turns done), Hide fetches the project once, even with background fetch off, and fast-forwards the checkout the mission was made in to the destination.Anything else (another branch, detached, own commits, changes in the way, a fetch that fails, a device project) leaves the folder exactly as it is.
The report gets one line, such as
내 폴더도 최신으로 당겨왔어요 (2커밋)or내 폴더 2커밋 뒤 · git pull; nothing else is shown.A
directchange's worktree is now cleaned up like a merged pull request's once its branch is in the destination, and the guide has the Conductor brief the mission's five options with the plan.Settings › Mission's
머지되면 워크트리 정리hint now reads작업이 도착 브랜치에 머지되면 그 워크트리와 빌드 캐시를 지워요. 브랜치는 남기고, 고치던 파일이 남아 있거나 쓰는 중이면 그대로 둬요., with the same meaning in English, Japanese and Chinese; the title stays.No screenshot: only the one-line Settings hint text changes.
Review
origin/<destination>, behind it and with no commit of its own, and the host's own받기(BranchCatchUp), told that branch, finds the sameHEADon the same branch and nothing it would overwrite. Any other branch, including one cut from the destination's upstream (git switch -c topic origin/main), gets the결과는 <dest>에 들어갔어요 · 내 폴더는 <branch>line and is not moved.mission.folder_pullin the log: failed fetch (or a ref lock held), noorigin, a branch with no upstream or another upstream,HEADmoved between read and fast-forward, a device project, cancel, nothing of the mission landed in the destination (D-47).A destination pushed without
-uis skipped rather than compared withorigin/<destination>directly: the catch-up follows the configured upstream only, and setting one would write the operator's Git config.hide-core/src/runtime/mission_pull.rs- the write to the operator's checkout and every skip; chooses under the lock from memory, runs off it on one issue worker.hide-core/src/runtime/missions.rs- the three close paths (close_mission_with,close_if_landed, the GitHub read's close) callowe_folder_pull; cancel does not.hide-core/src/runtime/mission_cleanup.rs- a done direct change's branch joins the retire targets oncenode_landingisLanded { InMain }, no GitHub answer needed; same retire, same caps.hide-core/src/missions.rs- new optional record fieldfolder_line({text, current}, schema 4 unchanged); a later close that finds the checkout current keeps a line whosecurrentis set, so a Conductor's own close after Hide's keeps당겨왔어요 (N커밋).hide-host/src/branch_merge.rs,hide-node-link/src/{protocol,branch}.rs-catch_uptakes an optional expected branch and answersOtherBranchwhenHEADhas another out; it reuses thesymbolic-ref HEADread it already made, so the read count andCATCH_UP_WAITare unchanged. The header's받기and the merge flow pass none and behave as before.hide-host/src/worktrees.rs- the checkout read now fillsbranchfrom the# branch.headline of thegit statusit already runs.Mutex<Runtime>each close adds a book/catalog lookup and a queue push; no git, fetch or file read. Off the lock: one fetch (bounded byFETCH_TIMEOUT), oneCheckoutGit(4 s), at most one catch-up (CATCH_UP_WAIT), one pull at a time; the queue holds each mission at most once and is memory only. The cleanup pass is unchanged in shape (16 per pass, one worker).contracts/change. Node link:CheckoutGit.branchandBranchCatchUp.branchare optional and skipped when empty, andCatchUpOutcome::OtherBranchis answered only to a caller that named a branch, which only the closing pull does, on this machine's own node. The checkout header's facts in the snapshot carry the optionalbranch, which the web does not read.folder_lineis optional withskip_serializing_if; an older build ignores and drops it on its next save, keeping the line insidereport, so a later close then adds a second line instead of replacing it (stated in ARCHITECTURE.md and the private doc).a_done_nodes_merged_worktree_is_retired_only_on_githubs_answer_and_with_the_switch_onstill passes); direct nodes are added beside it. B-59 is untouched: direct worktrees go through the sameretire_worktree.Tests
runtime::mission_pull::tests(11): real git with a local bareorigininside a temp folder, throughhide_host::serve::handle_in.runtime::tests::missions(5): close hands the pull to a worker off the lock, cancel / nothing landed / device ask nothing, direct cleanup targets and kept outcomes.web/e2e/mission-pull.spec.ts: the one test that crosses the CLI close, the core's worker, the node and git, withauto_fetchoff.a_branch_cut_from_the_destinations_upstream_is_left_and_named) or switched to between the read and the fast-forward (a_switch_to_another_branch_after_the_read_is_not_fast_forwarded); a second close that replaces당겨왔어요 (N커밋)with이미 최신이에요(a_second_close_that_finds_the_checkout_current_keeps_the_pulled_line);HEADmoved mid-way; reporting a checkout ahead of origin as diverged (a_checkout_at_or_ahead_of_its_destination_on_origin_reads_current); a pull that relies on the background fetch (the e2e's(2커밋)needs the close's own fetch).mission-pull.spec.tsx 8 in a row (--repeat-each=8) on the final spec, all green, locally on macOS; the CI repeat lane runs it again inverify.wait_forfor the worker to reach the held node and for the report line (10 s hang guard each); the e2e waits on the snapshot (control.until) and the core's log records (untilLoggedonmission.folder_pullandmission.worktree_retired), no fixed sleeps.Evidence
runtime::mission_pull::tests10/10 against real repositories with a local bareorigin; the filtered mission and upgrade runtime suites (396 tests) pass;cargo clippy -D warningsandrustfmtclean.web/e2e/mission-pull.spec.tson an isolated daemon (own state folder, own repository, nothing of the operator's): the close fetched with background fetch off, movedfeat/loginforward 2 commits to the remote's newest, wrote내 폴더도 최신으로 당겨왔어요 (2커밋)as the report's last line, and removed the direct change's worktree with its branch kept.With the close's fetch taken out of the source, the same spec failed (the checkout one commit short of the remote); the source was restored and rebuilt before the green runs.
ConductorTab.test.tsxreads the new hint, and it and the i18n tests pass (59 tests).70890ddd4a,cb368af9b8): 54 targeted pull, catch-up, checkout-read and protocol tests acrosshide-core,hide-hostandhide-node-link, then the 234 mission tests ofhide-core, all pass; clippy-D warningson the three crates,rustfmtandcargo check -p hidedclean.Planted together, naming no branch to the catch-up and dropping the keep rule made
a_switch_to_another_branch_after_the_read_is_not_fast_forwardedanda_second_close_that_finds_the_checkout_current_keeps_the_pulled_linefail; the source was restored before the commits.hide mission helpstill names only commands the parser reads (each_mission_flag_the_parser_reads_is_one_the_contract_names).check-timed-waits.py,check-no-attribution.py,check-no-workstation-identity.sh, eslint andcheck-e2e-test-size.mjson the spec.a51da82855; the fixes change which read decides the branch, which the real-repository tests above cover through the host's owngit status, and the CI repeat lane runs the e2e on this head.받기, which their CI lanes cover; this PR's own runs were macOS only until CI.docs/INSTALL.md; not run against a real device.closed_by_mergepath) end to end: covered by the runtime test only, not by the e2e.Verification record