Repository navigation
fix(clone): enable long paths for every clone teamai starts on Windows - #1954
Conversation
|
A process question rather than a bump on the change itself: the four workflows on this PR ( Could someone approve the run when convenient? No code is waiting on my side — |
d45c23e to
09f66cc
Compare
Review was read-only; nothing from the PR was run, built, or installed. |
09f66cc to
55c0170
Compare
Resolved: The earlier coverage mismatch is fixed: the current diff updates all seven named clone paths, both CNB branches, and both Windows guides. Review was read-only; nothing from the PR was run, built, or installed. |
The shared Git clients carry core.longpaths since Tencent#1518, but all seven clone sites start git through spawnSync, so the first `teamai init` still failed with "Filename too long" for a team repo holding a path past MAX_PATH, and the Windows guide asked the member to set the option globally first. longPathConfig() and longPathArgs() keep the two spellings in one place: the clients take the config, and a clone takes `-c core.longpaths=true` ahead of the subcommand, where a git-level option has to sit.
55c0170 to
177e0ae
Compare
Resolved: The coverage mismatch is fixed: all seven named clone paths, including both CNB branches, and both Windows guides are updated. The unrelated backup-cleanup/error-handling and credential-redaction changes are absent from the current diff. No additional confident bugs found. Review was read-only; nothing from the PR was run, built, or installed. |
|
On the real-CLI requirement: the description now carries the record, and it is a pair.
So the pair was produced with the real CLI on Windows instead: a bare team repo whose content sits at a 120-character relative path, a workspace that puts the clone target at 319 characters, and
Same workspace depth, same command, |
Summary
Every
git cloneteamai starts now carriescore.longpaths=trueon Windows.#1518gave the shared Git clients that setting, but all seven clone paths startgitthroughspawnSync, so a team repo holding a path longer thanMAX_PATHstill fails the very firstteamai init— anddocs/guide/windows.mddocuments that as something the user has to fix withgit config --global core.longpaths true. With this change the workaround is no longer needed.Reproduction
Windows, Node 22.22.2, Git for Windows (no
core.longpathsin any config):GenericGitProvider.cloneRepoturns that 128 intogit clone failed: … Filename too long, soteamai initstops with a half-checked-out team repo behind it.What changed
src/utils/git.tsexportslongPathConfig()andlongPathArgs()so the two spellings cannotdrift:
createGit/createGitWithBlockTimeoutkeep taking the config, and a clone that startsgititself takes-c core.longpaths=trueahead of the subcommand.src/clone.ts(shallowClone),providers/git,providers/github,providers/gitlab,providers/gitcode,providers/cnb(both the token and the credential-helperbranch),
providers/tgit.docs/guide/windows.md,docs/guide/zh-CN/windows.md: the init-clone caveat is gone.Test Plan
The new cases are load-bearing: reverting the two call sites makes them fail
(
6 failed | 37 passed), andlongPathArgsis asserted per platform the same way#1518assertedthe simple-git config.
Real-CLI record: not available from this machine.
npm run verify:worldrefuses to start here —A world needs a POSIX shell; Windows is not supported. Say so in the PR instead.The reproductionabove is the same
gitinvocation the provider makes, run against a real long path.npm run linton this checkout is red with 26teamai(family-facts)errors, all inpackages/tool-*/src/facts.ts— the Windows false positive #1927 fixes. Unrelated to this change,which is why the lint evidence above is scoped to the changed files.
Verification — real CLI, both sides of the fix
npm run verify:worldmarks WindowsUNVERIFIABLEby its own verdict table, and this change isprocess.platform === 'win32': a POSIX world cannot reach the code under test. So the pair theharness asks for was produced with the real CLI on Windows instead — same workspace depth, same
command, one build from
mainand one from this branch.Fixture: a bare team repo whose only content sits at a 120-character relative path; the workspace
puts the clone target at 319 characters, past
MAX_PATH.url.<local>.insteadOfmapshttps://teamai.test/team/repo.gitto that local repo so no network is involved.Before —
main(distbuilt frommain, no change):After — this branch:
Same binary shape (
tsupoutput,node dist/index.js), sameHOME, same workspace depth. The onlydifference is the
-c core.longpaths=truethis branch passes to the clone.Related Issues
Follows #1518, which covered the shared clients.
npx tsc --noEmitpassesnpm run lintpasses on the changed files (0 warnings and 0 errors)Filename too long, this branch clones); the verify world itself reports Windows as UNVERIFIABLE, which is why the record is the real CLI on the platform the change is for