Repository navigation
fix(clone): treat Clone Repo's custom folder as a parent, like Create New - #774
Conversation
|
The one failed check is not from this change. It is The test depends on timing: the route re-reads I cannot re-run the job (no admin rights on the repository), so could you re-run the failed job? I did not push a dummy commit to trigger it. If you want the race fixed, I can send that separately: serialize the final check-and-write of the registry inside the clone route, which would make the test deterministic and also stop a lost update in real use. |
|
Thanks @opticon454 for this! It makes Clone Repo's Clone into a custom folder field a parent folder: the repository lands in It does what the description says. A real clone through the tab in Chromium landed in One design question is open. #744 made this field the exact clone target, and the 1.48.0 release notes announce it that way ("Clone Repo can clone straight into a folder you pick, empty or not yet created"). This PR reverses that, so the field has to be one or the other: the exact target, as shipped, or a parent, like Create New's.
That decision is not made yet. 68bd7e4 moved away from a parent on purpose, and neither the commit nor #744 records why. If that reason still applies, please add it here. If the parent behaviour stays, these need to change:
The red Unit & integration tests job is not from this PR, so there is nothing for you to fix there. It is This PR stays open while the question above is open. |
… the invariants paragraph
|
Items 1 to 3 are done in
The frontend checks and that test file pass. I did not rerun the full suite. On the open design question (exact target as shipped in #744, or a parent): I have no recorded reason for 68bd7e4, and the point about Thanks for pointing at #764 for the registry race; I had a fix for it in progress and will drop it. |
|
Decision on the open design question: keep the parent behaviour. 68bd7e4 was a mistake on my side, not a considered choice. Most people pick a projects folder in the picker and expect the repository in a subfolder named after the case, which is what the default clone and Create New already do. There was no mount-point requirement behind it. I accept the cost you pointed out: from the Add Case tab, an existing empty folder such as Your three items are already in |
|
Thanks @opticon454 for turning those three items around so quickly! This PR makes Clone Repo's Clone into a custom folder field a parent folder: the repository lands in All three items from my last comment are in at The design question is still open. #744 shipped this field as the exact clone target in 1.48.0, and this PR makes it a parent. With a parent, the last path segment from the tab is always the case name. The tab then can't reach an empty folder such as If the parent behaviour stays, one small thing is left:
This PR stays open while the question above is open. |
|
Added in On the design question: my comment from earlier today gives the decision. Keep the parent behaviour; 68bd7e4 was a mistake on my side with no mount-point requirement behind it, and I accept the cost for the tab. |
|
Thanks @opticon454 for the quick follow-up! This PR makes Clone Repo's Clone into a custom folder field a parent folder: the repository lands in The test from my last comment is in at The design question is still open. Thanks for your answer (keep the parent, 68bd7e4 was a mistake). It is on record here, and no further answer is needed from you. I have not decided between the exact target, as shipped in 1.48.0, and a parent. If the parent behaviour stays, two small things are left:
This PR stays open while the question above is open. |
|
Both done in the next push.
|
|
Thanks @opticon454 for the follow-up! This PR makes Clone Repo's Clone into a custom folder field a parent folder: the repository lands in Both items from my last comment are in at
At this commit a real clone through the tab in Chromium landed in Nothing is left for you to change. The design question is still open. #744 shipped this field as the exact clone target in 1.48.0, and this PR makes it a parent. A parent matches Create New and the default clone, and picking a projects folder that already has files works. The exact target works with an existing empty folder under any name, such as This PR stays open while that question is open. |
…like Create New Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eview) Clone Repo's custom folder became a parent that must already exist (#774), while its picker still had no New folder button (#761 turned it on for Create New only). A parent that does not exist yet was refused with no way to make it from the form, so the same job worked on one tab and dead-ended on the other. The test pin that kept Clone off dated from when the field was the exact target, which could be a folder not yet created. Clone moves to the on side of that pin, so every picker in the file stays covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, this is in the 1.49.0 release, and the design question is settled: I decided to keep the parent, so the field works like Create New's, and Your head is merged as it was, including the clearer 409 text. On top of it: the picker has the New folder button, because a parent that does not exist yet was a dead end there, and the test file gained more parent shapes and the Browse path through to the request. The race you found in |
Summary
In Add Case, Clone Repo → Clone into a custom folder uses the folder you pick as the clone target itself, so picking a parent such as a projects folder fails with " already has files in it". Create New's custom folder and the default clone both put the case in a subfolder named after it, so Clone Repo was the odd one out.
~/codeman-cases/<name><parent>/<name>(the page sends the joined path)<folder>itself<folder>/<name>This makes a custom folder behave as "use this folder instead of
~/codeman-cases" in both tabs.Change
Page only, mirroring
_newCaseTargetPath():_cloneTargetPath()returns the parent field plus the case name, and the request'spathcarries that joined path.docs/architecture-invariants.mdand the Core Concepts wiki table.The API is unchanged:
pathonPOST /api/cases/cloneis still the exact target, judged byprepareNewCasePath(), so the same checks apply (parent must exist, blocked trees, symlinks, empty or new target) and existing API callers are unaffected. The server still answers "already has files in it" if<folder>/<name>is not empty.Behaviour change
A user who used to type the exact empty folder they wanted the repo in now gets
<that folder>/<name>. They can type the parent and let the name supply the last segment.Verification
test/clone-custom-folder-ui.test.tsruns the realindex.htmlandsession-ui.jsin JSDOM: the request carries<folder>/<name>(trailing slash trimmed), the preview follows a name edit, and nopathis sent without the checkbox.check:frontend-syntaxandcheck:public-assetspass.npm test: 688 files passed, 14,112 tests passed, 12 skipped, 1 failed. The failure istest/frontend-public-tooling.test.ts, which needs gitignored spreadsheet assets missing from my test checkout; it does not touch this change.