Skip to content

Replace walk with built-in filesystem traversal - #1672

Open
minggangw wants to merge 1 commit into
RobotWebTools:developfrom
minggangw:remove-walk
Open

minggangw wants to merge 1 commit into
RobotWebTools:developfrom
minggangw:remove-walk

Conversation

@minggangw

@minggangw minggangw commented Oct 30, 2026 •

Copy link
Copy Markdown
Member
  • Remove the walk dependency and use fs.promises with an async generator.
  • Reuse interface collection logic for source-tree and ament-index discovery.
  • Preserve symbolic-link paths and prevent directory traversal cycles.
  • Await service message generation and propagate processing failures.

Fix: #1673

Copilot AI balanced review requested due to automatic review settings October 30, 2026 09:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new source-tree traversal lacks regression coverage for nested interfaces, file and directory symlinks, cycle termination, and lexical-path preservation through sibling aliases.

1 open issue
What changed in this PR

Replaces walk with built-in asynchronous filesystem traversal for ROS interface discovery, sharing collection logic between source trees and ament-index installations.

Changes:

  • Uses an async generator that preserves symbolic-link paths and prevents ancestor-directory cycles.
  • Reuses interface processing and awaits it so processing failures propagate.
  • Removes the walk dependency.
File Description
rosidl_gen/​packages.cjs Adds filesystem traversal and shares awaited interface collection logic.
package.json Removes the walk dependency.

Review effort: Balanced

Comment thread rosidl_gen/packages.cjs
return pkgMap;
}

async function* findFilesInDirectory(dir, ancestors = new Set()) {
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 91.164%. remained the same — minggangw:remove-walk into RobotWebTools:develop

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Existing tests bypass the rewritten source-tree traversal, leaving symlink path preservation, sibling alias handling, and cycle termination without regression coverage.

1 open issue

Review effort: Max

This branch has not been deployed

No deployments
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.

Remove walk from dependencies

3 participants