Repository navigation
feat: bounded reverse-dep mode, inspect changed/graph, top-level doctor - #23
Merged
Merged
Conversation
…vel doctor Adds three non-breaking capabilities (all default behaviour unchanged): - `ws build --rdeps-depth N`: bound the reverse-dependency (ABI affected) rebuild to N levels as a middle ground between the full transitive walk (default) and `--no-rdeps`. Implemented as a level-by-level BFS in `get_reverse_deps(max_depth=...)`, threaded through `compute_changeset` and `run_workspace_colcon`. Mutually exclusive with `--no-rdeps`. - `inspect changed`: preview changed packages and their rebuild set without building, reusing the same `compute_changeset` pipeline as `ws build`. - `inspect graph`: scan-only dump of the package dependency DAG via a new public `forward_edges()` accessor. - top-level `doctor`: cross-cutting health check aggregating base/worktree state (reusing status helpers) plus a stale base build-dir count, delegating deep stale-CMakeCache diagnosis/repair to `base doctor`. Registers the new subcommands and updates README accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements R8 of the release roadmap (target tag v6.5.0, minor). All additions are non-breaking and default behaviour is unchanged.
cwm ws build --rdeps-depth N— bound the reverse-dependency (ABI affected) rebuild toNlevels (1= direct consumers only), a middle ground between the full transitive walk (default) and--no-rdeps(skip entirely). The two flags are mutually exclusive. Implemented as a level-by-level BFS inDependencyGraphAnalyzer.get_reverse_deps(max_depth=...), threaded throughcompute_changesetandrun_workspace_colcon(ws testis unaffected, defaulting toNone).cwm inspect changed [-w BRANCH] [--json]— preview changed packages and their reverse-dep rebuild set without building, reusing the samecompute_changesetpipeline asws buildso the preview never diverges from the real build scope.cwm inspect graph [-w BRANCH] [--json]— scan-only dump of the package dependency DAG (build/build_exportedges) via a new publicforward_edges()accessor (copy-returning to protect the internal map).cwm doctor [--json]— cross-cutting health check aggregating base + worktree state (reusingstatus_cmdhelpers) plus a stale base build-dir count; deep stale-CMakeCache diagnosis and repair are delegated tocwm base doctor --fix(no duplicate implementation).Reuse / design notes
resolve_worktree), change detection (compute_changeset), and worktree-status collection (_collect_base/_collect_worktrees/_print_base_status) are reused rather than reimplemented.get_reverse_depskeeps full backward compatibility:max_depth=Noneis the original transitive closure.Tests
test_dependency_graph.py: depth-bounded BFS (chain_wsfixture) +forward_edgesimmutability; verifies the default matches the full closure.test_inspect_changed_cmd.py,test_inspect_graph_cmd.py,test_doctor_cmd.py.test_cli_structure.py: updated command ordering + top-leveldoctorregistration.ruff checkclean.Verification (manual, minimal ROS WS)
cwm inspect changed -w <branch> --jsonmatchesws build --dry-run.cwm ws build --rdeps-depth 1rebuilds only direct consumers;--rdeps-depth 1 --no-rdepserrors (UsageError).cwm inspect graph -w <branch>prints the DAG adjacency.cwm doctoraggregates base + all worktrees, reports stale count pointing atbase doctor, and flags missing worktrees.