Skip to content

fix(fiori-migration-writer): remove absolute paths from migration error telemetry - #5406

Closed
docirl wants to merge 2 commits into
mainfrom
fix/migration-telemetry-paths
Closed

docirl wants to merge 2 commits into
mainfrom
fix/migration-telemetry-paths

Conversation

@docirl

@docirl docirl commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Migration ERROR messages reported to telemetry could embed absolute filesystem paths taken verbatim from raw Node fs error messages (ENOENT/EACCES/EBUSY/EEXIST). This leaked the user's home folder (= SAP user id), as well as workspace and customer folder names — personal data under GDPR.

Real example seen in production telemetry:

Error committing changes while configuring launch json file: Error: ENOENT: no such file or directory, mkdir 'd:\WorkBuddySpace\zcustomer\.vscode'

This restores the pre-refactor behaviour where fs errors were converted to path-free messages at the point they are caught, rather than relying solely on a downstream sanitizer.

Changes

  • Add pathToFilename, stripPaths and curateErrorDescription to utils/migration-utils.ts. A caught Node fs error is reduced to its error code plus the offending file name only; directories (which can contain user/customer/workspace names) are removed. A path that ends in a plain folder is dropped entirely; files and dotfiles/dotfolders (.vscode, .gitignore) are kept.
  • Route the determineMessage fallback through stripPaths, so generic fs errors (anything that is not a SyntaxError or EPERM) no longer return the raw path. This also covers the sites that already route through determineMessage (files/project-files.ts, migration-process/validation.ts).
  • Curate the remaining raw error.message pass-throughs:
    • ProjectMigrator.ts — commit failure and TypeScript-enable failure
    • BulkProjectMigrator.ts — per-project catch, and the re-thrown commit error
    • project/regular-project.ts — project discovery failure

Behaviour

...mkdir 'd:\WorkBuddySpace\zcustomer\.vscode' is now reported as Error committing migration: ENOENT: no such file or directory, mkdir '.vscode' — the drive, workspace and customer folder names are gone, the error code and file name remain for diagnostics.

Test plan

  • New unit tests in migration-utils.test.ts for pathToFilename, stripPaths, curateErrorDescription, and a path-free assertion on determineMessage (using the real telemetry sample).
  • Full package suite green (512 passed, 2 skipped, 195 snapshots) — no regressions.
  • tsc --build clean; ESLint 0 errors.
  • Changeset added (patch).

…or telemetry

Migration ERROR messages reported to telemetry could embed absolute
filesystem paths from raw Node fs error messages (ENOENT/EACCES/EBUSY/
EEXIST), leaking the user home folder, workspace and customer folder
names. Node fs errors are now reduced to their error code and the
offending file name only; directories are removed.

Adds pathToFilename/stripPaths/curateErrorDescription in migration-utils,
routes the determineMessage fallback through stripPaths, and curates the
previously raw error.message pass-throughs in ProjectMigrator,
BulkProjectMigrator and project discovery.
@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b4d949

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sap-ux/fiori-migration-writer Patch
@sap-ux/create Patch

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

@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Title: Sanitize filesystem paths in Fiori migration error reporting

Description

Reduce exposure of user, workspace, and customer directory names in migration error telemetry while retaining useful diagnostic details.

  • Add and export shared utilities to reduce matched Windows, UNC, and POSIX paths to filenames or dotfiles/dotfolders, dropping plain directory names.
  • Sanitize the generic determineMessage fallback and error reporting for single-project migration, bulk migration, commit failures, TypeScript setup, and project discovery.
  • Preserve error context and filesystem error codes without duplicating codes already present in messages.
  • Add regression tests and a patch changeset for @sap-ux/fiori-migration-writer.

Type of change

  • Bug (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a new feature)
  • Breaking change (Bug or New feature that would cause existing functionality/consumers to not work as expected)
  • Non-Breaking chores (Changes to tools, libraries, build process, documentation, etc)
  • None of the above (Reviewers might ask for more clarification)

How have you tested?

  • Added unit coverage for path reduction, directory removal, error-code handling, non-Error values, and the production telemetry regression.
  • Reported validation: 512 tests passed, 2 skipped, 195 snapshots; tsc --build clean; ESLint reported no errors.
  • Reviewers can rerun the package unit suite, TypeScript build, and lint checks.

Checklist:

  • The code conforms to the general development principles
  • Supplied as many details as possible on this change
  • The code is easy to read and maintainable by others
  • Corresponding changes to the documentation has been done
  • Already existing and new unit tests pass locally
  • I have reviewed and addressed all Hyperspace bot findings (or explicitly explained dismissals)
  • I have done an Agentic review

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.33.50

  • Correlation ID: 2bbeb0c0-deaa-11f1-9387-ec44482faab2
  • Summary Prompt: Default Prompt
  • Event Trigger: pull_request.opened
  • LLM: gpt-6.1-sol
  • File Content Strategy: Full file content
  • Output Template: Repository PR Template

@sonarqubecloud

Copy link
Copy Markdown

@docirl docirl closed this Nov 20, 2026
@docirl
docirl deleted the fix/migration-telemetry-paths branch November 20, 2026 15:23

This branch was previously deployed

1 inactive deployment
ci-secrets — 0b4d9495 Deployed Nov 12, 2026 by open-ux-tools-release-bot[bot] via build (macos-latest, 24.x) #79299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant