Repository navigation
fix(fiori-migration-writer): remove unnecessary path manipulation in launch config generation - #5400
korotkovao wants to merge 3 commits into
Conversation
…launch config generation Fixes path duplication bug where projectInfo.rootPath was being unnecessarily deconstructed and reconstructed, causing duplicated paths on Windows: Before: 'c:\Users\<user>\workspace\c:\Users\<user>\workspace\project\.vscode' After: 'c:\Users\<user>\workspace\project\.vscode' The issue was in generateLaunchConfiguration() which: 1. Extracted project name from rootPath 2. Got parent folder with join(rootPath, '..') 3. Rejoined them with join(parent, name) This path manipulation was unnecessary since projectInfo.rootPath is already the correct full path to the project. Solution: Use projectInfo.rootPath directly and extract projectName with basename() only when needed. Relates-To: https://github.wdf.sap.corp/ux-engineering/tools-suite/issues/39900
🦋 Changeset detectedLatest commit: 0871f48 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
SummaryThe following content is AI-generated and provides a summary of the pull request: Fix launch configuration path duplication during migrationDescriptionFixes VS Code launch configuration generation during Fiori migration by using the existing project root path directly. The previous path reconstruction could duplicate absolute Windows paths, causing
Related issue: https://github.wdf.sap.corp/ux-engineering/tools-suite/issues/39900 Type of change
How have you tested?
Checklist:
PR Bot InformationVersion:
|
| const projectPath = join(targetFolder, projectName); | ||
| // projectInfo.rootPath is already the full path to the project | ||
| const projectPath = projectInfo.rootPath; | ||
| const projectName = basename(projectPath); |
There was a problem hiding this comment.
Bug: projectName is now unused
This declaration is no longer referenced because fioriOptions.name calls basename(projectPath) directly, so the package's TypeScript/lint checks may fail on the unused local. Consider removing it.
| const projectName = basename(projectPath); |
Double-check suggestion before committing. Edit this comment for amendments.
Please provide feedback on the review comment by checking the appropriate box:
- 🌟 Awesome comment, a human might have missed that.
- ✅ Helpful comment
- 🤷 Neutral
- ❌ This comment is not helpful
| const targetFolder = join(projectInfo.rootPath, '..'); | ||
| const projectPath = join(targetFolder, projectName); | ||
| // projectInfo.rootPath is already the full path to the project | ||
| const projectPath = projectInfo.rootPath; |
There was a problem hiding this comment.
Best Practices: This published source fix has no changeset
Repository policy requires a patch changeset for every src/ bug fix, and .changeset currently contains no entry for @sap-ux/fiori-migration-writer, so changeset validation will fail. Please add a patch changeset whose summary starts with FIX:.
Please provide feedback on the review comment by checking the appropriate box:
- 🌟 Awesome comment, a human might have missed that.
- ✅ Helpful comment
- 🤷 Neutral
- ❌ This comment is not helpful
|



Description
Fixes path duplication bug where migration fails when generating VS Code launch configuration due to duplicated paths.
Problem
Multiple users reported migration failures with duplicated paths (sanitized examples):
Notice the path appears twice before
.vscode.Root Cause
Location:
packages/fiori-migration-writer/src/config/launch-config.tslines 32-34The code was unnecessarily deconstructing and reconstructing the path:
This caused path duplication on Windows when
join()operations were performed.Solution
Since
projectInfo.rootPathis already the correct full path to the project, use it directly:Testing
Impact
.vscodedirectory creation errorsRelated Issues