Skip to content

refactor(install): split helper modules#698

Merged
jdx merged 1 commit into
mainfrom
codex/split-install-helpers
May 15, 2026
Merged

refactor(install): split helper modules#698
jdx merged 1 commit into
mainfrom
codex/split-install-helpers

Conversation

@jdx

@jdx jdx commented May 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • Split several helper clusters out of commands/install/mod.rs into focused modules:
  • lockfile_dir.rs for lockfile-dir importer remapping.
  • summary.rs for human install summary output.
  • sweep.rs for .aube invalidation and orphan cleanup.
  • unreviewed_builds.rs for skipped-build warning replay and emission.
  • Widened UnreviewedBuild visibility only within the install module tree so the new warning module can reuse the existing lifecycle type.

Why

install/mod.rs was carrying unrelated helper groups after the main install pipeline. Moving these groups into modules makes the install command easier to scan while preserving behavior.

Validation

  • cargo fmt --check
  • cargo check -p aube
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p aube commands::install

Note

Low Risk
Low risk refactor that primarily moves helper functions into new modules and adjusts visibility/imports; behavior should remain the same aside from minor risk of missed wiring or path/visibility mistakes.

Overview
Refactors commands/install/mod.rs by extracting several post-pipeline helper clusters into focused modules: lockfile_dir (importer-key remapping + foreign-importer guard for --lockfile-dir), summary (human-readable install output helpers), sweep (.aube cache invalidation/orphan cleanup), and unreviewed_builds (replay + emission of skipped-build warnings).

Updates call sites to use the new modules and widens UnreviewedBuild visibility to pub(in crate::commands::install) so the new unreviewed_builds module can reuse the existing lifecycle type.

Reviewed by Cursor Bugbot for commit 87f03ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a pure structural refactor: four helper clusters that had accumulated at the bottom of commands/install/mod.rs are extracted into focused sibling modules (lockfile_dir, summary, sweep, unreviewed_builds), and UnreviewedBuild's visibility is widened from pub(super) to pub(in crate::commands::install) so the new warning module can reach it.

  • All extracted functions are mechanically identical to their originals; the only non-trivial adjustment is should_print_human_install_summary in summary.rs updating its super path to super::super::global_output_flags(), which correctly reaches the same commands::global_output_flags that super::global_output_flags() resolved to from mod.rs.
  • Call sites in mod.rs are updated to namespace-qualified paths (e.g. unreviewed_builds::emit_warning, unreviewed_builds::from_state), improving readability without altering runtime behavior.

Confidence Score: 5/5

Safe to merge — this is a mechanical code-motion refactor with no logic changes.

Every moved function is a verbatim copy of its original; the one path-depth adjustment (super::super in summary.rs) resolves to the same target; cargo fmt/check/clippy/test are all listed as passing. No logic, behavior, or public API is altered.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube/src/commands/install/lifecycle.rs Single-line visibility widening of UnreviewedBuild from pub(super) to pub(in crate::commands::install) to allow access from the new unreviewed_builds sibling module; no logic change.
crates/aube/src/commands/install/lockfile_dir.rs New module containing the four lockfile-dir remap helpers extracted verbatim from mod.rs; visibility upgraded to pub(super) but logic is identical to the originals.
crates/aube/src/commands/install/mod.rs Removed ~460 lines of extracted helper functions and replaced with three new module declarations and corresponding use imports; call sites updated to namespace-qualified paths (e.g. unreviewed_builds::emit_warning).
crates/aube/src/commands/install/summary.rs New module with the human-readable install summary helpers; should_print_human_install_summary correctly adjusts its super path to super::super::global_output_flags() since it is now one level deeper than mod.rs.
crates/aube/src/commands/install/sweep.rs New module with invalidate_changed_aube_entries and sweep_orphaned_aube_entries; dep_path_to_filename import moved to module level (was function-local in the original) with no behavioral change.
crates/aube/src/commands/install/unreviewed_builds.rs New module exposing from_state and emit_warning; accesses UnreviewedBuild via super::lifecycle which is now visible thanks to the pub(in crate::commands::install) widening in lifecycle.rs.

Reviews (1): Last reviewed commit: "refactor(install): split helper modules" | Re-trigger Greptile

@jdx jdx merged commit 6e9c0bb into main May 15, 2026
18 checks passed
@jdx jdx deleted the codex/split-install-helpers branch May 15, 2026 02:31
This was referenced May 15, 2026
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.

1 participant