refactor(cli): extract provider commands into commands/provider module - #2605
Open
varshaprasad96 wants to merge 1 commit into
Open
refactor(cli): extract provider commands into commands/provider module#2605varshaprasad96 wants to merge 1 commit into
varshaprasad96 wants to merge 1 commit into
Conversation
Move all provider-related functions, helpers, constants, and tests from the monolithic run.rs (~2,700 lines) into a dedicated commands/provider.rs module. This is PR3 of the CLI refactor series (issue NVIDIA#2304). The extraction follows the same pattern established in PR2 (gateway): - Self-contained module with own imports - pub use re-exports in run.rs so callers (main.rs) are unchanged - Inline #[cfg(test)] mod tests Signed-off-by: Varsha Prasad Narsing <vnarsing@nvidia.com> Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
varshaprasad96
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
August 3, 2026 23:36
7 tasks
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
run.rsinto a dedicatedcommands/provider.rsmodulepub usere-exports inrun.rssomain.rsrequires zero changes — all call sites continue usingrun::provider_create(...)etc.run.rs(provider proto types,openshell_providers,dialoguer::Confirm,HashSet, etc.)Related Issue
Part of #2304 — CLI refactor series PR3 (provider commands). PRs 1–2 (scaffolding + gateway) are merged.
Changes
crates/openshell-cli/src/commands/mod.rspub mod provider;crates/openshell-cli/src/commands/provider.rscrates/openshell-cli/src/run.rsNot changed
main.rs— all calls go throughrun::re-exports, no changes neededTesting
cargo check -p openshell-cli— zero errors, zero warningscargo test -p openshell-cli— all 211 tests pass (22 provider tests running from new location undercommands::provider::tests)mise run pre-commit— all lint, format, and license checks passpub usere-exports match the 19 call sites inmain.rsplus internal cross-module usageChecklist