Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

tests: cover structural_impact.py pure helpers; thread repo_root and align path resolution

未关闭
#601 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
github-actions, python

调研方向

从 .agents/tools/structural_impact.py 开始,重点查看 _get_package、_dedup、_collect_source_files、_unknown_package_dirs、_rel、_changed_files_mode 和 _full_mode;然后检查 PR #567 以及现有的 agentic CI 工作流。为列出的用例添加 .agents/tools/tests/test_structural_impact.py,将其接入 CI,并通过测试套件验证显式的 repo_root 处理和对称路径解析。

由索引模型根据 Issue 内容生成。

描述

task
Priority Level

Medium

Task Summary

Add unit-test coverage for the pure helpers in .agents/tools/structural_impact.py and clean up two latent issues that get cheap to fix in the same pass: the module-level _REPO_ROOT global and the asymmetric .resolve() between changed-files paths and source-file paths.

Follow-up to PR #567 review feedback from @nabinchha.

Technical Details & Implementation Plan
  1. Unit tests — add .agents/tools/tests/test_structural_impact.py covering:

    • _get_package — engine / config / interface / external paths, including the data-designer vs data-designer-engine substring-precedence ordering
    • _dedup — collisions on shared label prefixes (regression guard for the bug fixed in bfc5db69)
    • _collect_source_files — smoke test against a tmp dir with mock packages/<name>/src/... layout
    • _unknown_package_dirs — synthetic packages outside _KNOWN_PACKAGE_DIRS
  2. CI wiring — .agents/tools/ lives outside the three package test suites, so make test won't pick it up. Decide between (a) a new Makefile target, (b) a step in agentic-ci-pr-review.yml / agentic-ci-daily.yml, or (c) folding into an existing CI workflow. Lean toward (b) since the file's own change cadence is tied to the agentic-CI surface.

  3. Thread repo_root through helpers — replace the module-level _REPO_ROOT global + global _REPO_ROOT mutation in main() with explicit parameter passing through _collect_source_files, _unknown_package_dirs, _rel, _changed_files_mode, _full_mode. Removes test-time fragility (no need to mutate a global to vary input) and decouples the otherwise-pure helpers from module state.

  4. Symmetric path resolution — once helpers take repo_root explicitly, either drop .resolve() on changed_paths (current _changed_files_mode:198) or also .resolve() paths inside _collect_source_files. Latent today because no symlinks live under packages/, but the symmetric form removes a future-divergence trap.

Investigation / Context

PR #567 review thread: https://github.com/NVIDIA-NeMo/DataDesigner/pull/567 (review by @nabinchha and follow-up at https://github.com/NVIDIA-NeMo/DataDesigner/pull/567#issuecomment-4373073701)

Relevant prior fixes that justify the test coverage:

  • bfc5db69 — _dedup 30-char prefix-collision bug (pre-merge)
  • 55f0bdda — changed_node_ids ID-stability bug (pre-merge)

Both bugs were caught during review; tests would have surfaced them earlier and would protect against the most likely future failure mode (graphify API drift at the loose graphifyy==0.4.23 pin).

Dependencies

None

主要语言
Python
星标
2.4k
派生
234
平均合并
1 天 22 分钟
30 天内合并 PR
83

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA-NeMo/DataDesigner 的其他 Issue

查看 NVIDIA-NeMo/DataDesigner 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。