Skip to content

Refactor plan builder into focused modules#248

Merged
EffortlessSteven merged 1 commit into
mainfrom
codex/break-complex-function-into-srp-submodules-6dxi3k
May 14, 2026
Merged

Refactor plan builder into focused modules#248
EffortlessSteven merged 1 commit into
mainfrom
codex/break-complex-function-into-srp-submodules-6dxi3k

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • The previous build_plan implementation was large and mixed multiple responsibilities (metadata loading, publishability checks, graph construction, selection, sorting, and plan assembly), making it hard to reason about and test.
  • Split responsibilities into single-responsibility modules to improve clarity, testability, and future maintainability.

Description

  • Replace the long build_plan body with a short orchestration that delegates to focused submodules: metadata, publishability, graph, selection, and assembly, and wire their APIs together via build_plan.
  • Add crates/shipper-core/src/plan/metadata.rs to isolate the cargo metadata boundary and load_metadata call used by planning.
  • Add crates/shipper-core/src/plan/publishability.rs to compute the publishable workspace set, record skipped packages, and encapsulate publish_allowed/skip-reason logic.
  • Add crates/shipper-core/src/plan/graph.rs to construct manifest-level workspace dependency edges, validate non-publishable deps, and provide the deterministic topo_sort implementation.
  • Add crates/shipper-core/src/plan/selection.rs to resolve selected-package inclusion and transitively include internal dependencies.
  • Add crates/shipper-core/src/plan/assembly.rs to build PlannedPackage values, produce the dependency projection map, and compute the stable plan_id hash.
  • Update crates/shipper-core/src/plan/mod.rs to use the new modules and to assemble the final PlannedWorkspace from their outputs while preserving existing behavior and test surface.

Testing

  • Ran cargo check -p shipper-core and it completed successfully.
  • Ran cargo test -p shipper-core plan and the plan-related test suite completed successfully (all tests passed).
  • Ran formatting and style checks with cargo fmt --all -- --check and the code is properly formatted (check passed).

Codex Task

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 49 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3fe9b27c-b234-4941-84ff-e42f0f872854

📥 Commits

Reviewing files that changed from the base of the PR and between 38d23d5 and 950cb4c.

📒 Files selected for processing (6)
  • crates/shipper-core/src/plan/assembly.rs
  • crates/shipper-core/src/plan/graph.rs
  • crates/shipper-core/src/plan/metadata.rs
  • crates/shipper-core/src/plan/mod.rs
  • crates/shipper-core/src/plan/publishability.rs
  • crates/shipper-core/src/plan/selection.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/break-complex-function-into-srp-submodules-6dxi3k

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@factory-droid

factory-droid Bot commented May 13, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Review Complete

Phase 2 Validation Result: Approved — no issues found.

Summary: The refactoring cleanly splits the build_plan function into five focused single-responsibility modules (metadata, publishability, graph, selection, assembly) with correct delegation and no behavioral changes.

Phase Reviewer Status
Phase 1 (Review) No comments generated
Phase 2 (Validation) Droid Approved

View Phase 1 output |

@EffortlessSteven EffortlessSteven merged commit bb88fc2 into main May 14, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant