NVIDIA-NeMo / NVIDIA-NeMo/DataDesigner
tests: cover structural_impact.py pure helpers; thread repo_root and align path resolution
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 211
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 40
Description
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
-
Unit tests — add
.agents/tools/tests/test_structural_impact.pycovering:_get_package— engine / config / interface / external paths, including thedata-designervsdata-designer-enginesubstring-precedence ordering_dedup— collisions on shared label prefixes (regression guard for the bug fixed inbfc5db69)_collect_source_files— smoke test against a tmp dir with mockpackages/<name>/src/...layout_unknown_package_dirs— synthetic packages outside_KNOWN_PACKAGE_DIRS
-
CI wiring —
.agents/tools/lives outside the three package test suites, somake testwon't pick it up. Decide between (a) a new Makefile target, (b) a step inagentic-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. -
Thread
repo_rootthrough helpers — replace the module-level_REPO_ROOTglobal +global _REPO_ROOTmutation inmain()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. -
Symmetric path resolution — once helpers take
repo_rootexplicitly, either drop.resolve()onchanged_paths(current_changed_files_mode:198) or also.resolve()paths inside_collect_source_files. Latent today because no symlinks live underpackages/, 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—_dedup30-char prefix-collision bug (pre-merge)55f0bdda—changed_node_idsID-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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .agents/tools/structural_impact.py, especially _get_package, _dedup, _collect_source_files, _unknown_package_dirs, _rel, _changed_files_mode, and _full_mode; then inspect PR #567 and the existing agentic CI workflows. Add .agents/tools/tests/test_structural_impact.py for the listed cases, wire it into CI, and verify explicit repo_root handling and symmetric path resolution with the test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, testing-qa, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100