Skip to content

feat(pm): detect duplicate workspace package names / 检测重复 workspace package name #3174

Description

@elrrrrrrr

English

Detect duplicate workspace package names and report a clear error.

The Arborist fixture workspaces-duplicate is currently skipped because utoo does not detect when multiple workspace packages declare the same name in package.json. This can make workspace resolution ambiguous and should fail early with an actionable error.

Team Size

2 contributors.

Basic Requirements

  • Familiarity with Rust basics.
  • Ability to read workspace discovery/topology code.
  • Ability to add unit tests and update E2E fixture skip lists.

Suggested Code Areas

  • crates/pm/src/service/workspace.rs
  • crates/pm/src/helper/ruborist_context.rs
  • e2e/pm-arborist.sh
  • e2e/pm/arborist/README.md

Expected Output

  • Detect duplicate workspace names during workspace discovery or topology building.
  • Error message includes the duplicated package name and related workspace paths.
  • Unskip or update the workspaces-duplicate Arborist fixture.
  • Add regression tests.

Acceptance Criteria

  • A project with duplicate workspace package names fails early.
  • The error is deterministic and easy to understand.
  • Existing valid workspace projects continue to work.
  • cargo fmt and cargo clippy --all-targets -- -D warnings --no-deps pass.

中文

检测重复的 workspace package name,并给出清晰错误。

当前 Arborist fixture workspaces-duplicate 处于 skip 状态,原因是多个 workspace 的 package.json 声明相同 name 时,utoo 尚未明确报错。这会导致 workspace 解析存在歧义,应尽早失败并给出可操作提示。

组队人数

2 人。

基本要求

  • 熟悉 Rust 基础。
  • 能阅读 workspace discovery/topology 相关代码。
  • 能补充单元测试并更新 E2E fixture skip 列表。

建议关注代码

  • crates/pm/src/service/workspace.rs
  • crates/pm/src/helper/ruborist_context.rs
  • e2e/pm-arborist.sh
  • e2e/pm/arborist/README.md

目标产出

  • 在 workspace discovery 或 topology 构建阶段检测重复名称。
  • 错误信息包含重复的包名和相关 workspace 路径。
  • 解除或更新 workspaces-duplicate Arborist fixture 的 skip 状态。
  • 补充回归测试。

验收标准

  • 存在重复 workspace package name 的项目会尽早失败。
  • 错误信息稳定且易理解。
  • 合法 workspace 项目行为不受影响。
  • cargo fmtcargo clippy --all-targets -- -D warnings --no-deps 通过。

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Pkg ManagerArea: Package ManagerOSS-MediumOSS26-TeamOSS 2026 team task for group contributorsS-FeatureStatus: new feature to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions