fix(desktop): classify long-path checkout failures as actionable repo errors - #6461
Open
santhiprakash wants to merge 1 commit into
Open
fix(desktop): classify long-path checkout failures as actionable repo errors#6461santhiprakash wants to merge 1 commit into
santhiprakash wants to merge 1 commit into
Conversation
… errors projectRepoUnavailableReason returned 'unknown' for git failures that mention 'filename too long' or 'unable to checkout working tree', so the Projects panel fell back to the generic 'Repository unavailable' copy. This is the second reported instance of a fixable local-git problem being flattened into the unknown bucket (block#5989, sibling of block#5348), and the panel needs a reason it can route to actionable copy. Add a new 'path' reason that matches the Windows MAX_PATH surface, give it copy that points the user at git's core.longpaths / Windows long-path setting, and register a TriangleAlert icon plus the card tooltip status. The core.longpaths injection itself ships in block#6095; this PR ships the classification half so the panel can render meaningful text once the config fix lands (or for any user whose core.longpaths is unreachable for other reasons). Fixes block#5989 (classification half) Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
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.
Summary
projectRepoUnavailableReasonreturnsunknownwhenever a git failure mentionsfilename too longorunable to checkout working tree, so the Projects panel falls back to the generic "Repository unavailable" copy and the user has no hint that the cause is a fixable local git setting.This is the second reported instance of a specific, fixable local-git problem being flattened into the
unknownbucket (#5989 notes the Windows MAX_PATH case, sibling of #5348 for the macOS git <2.46 case). The panel needs a reason it can route to actionable copy.Changes
pathreason toProjectRepoUnavailableReasonthat matches/filename too long|unable to checkout working tree/.pathactionable copy ("Paths exceed local limit") pointing the user atcore.longpathsand the Windows long-path setting.TriangleAlerticon inProjectRepositoryUnavailableState.tsxand a "Path too long" status row inProjectCards.tsxso the card-level indicator stays in sync with the full panel.The
core.longpathsinjection itself ships in #6095. That PR resolves the user-visible failure on machines where git's own setting is the lever; this PR ships the classification half so the panel can render meaningful text once the config fix lands — and also for any user whosecore.longpathsis unreachable for other reasons (e.g. they did not know to set it, or a future code path produces the same git error string).Related issue
Fixes the classification half of #5989.
The reporter's option 1 (one-line config injection) is PR #6095. This PR is option 3 from the same report. The two are independent and can land in either order; the panel classification is correct with or without the config injection, and the config injection is correct with or without the classification.
Testing
pnpm typecheckfromdesktop/clean.node --import ./test-loader.mjs --experimental-strip-types --test src/features/projects/lib/projectRepoAvailability.test.mjs: 12 passed, 0 failed (3 new: classification, refinement pass-through, presentation).pnpm lint: 3 warnings / 2 infos, all pre-existing and unrelated to the touched files.Manual:
projectRepoUnavailableReasonreturnspathfor both fixture strings from the issue ("Filename too long" and "fatal: unable to checkout working tree");refineRepoUnavailableReasonleavespathuntouched, matching its behavior for other non-missingreasons;projectRepoUnavailablePresentation('path')returns the expected{title, description}pair.