Skip to content

Conversation

@skevetter
Copy link
Owner

@skevetter skevetter commented Feb 2, 2026

  • refactor(workspace): provider functions and cleanup unused functions
  • fix: apply feedback

Summary by CodeRabbit

  • Refactor

    • Streamlined provider management system with centralized loading and discovery workflow.
    • Improved provider lookup and resolution logic for better reliability.
  • Bug Fixes

    • Enhanced error messages for provider resolution edge cases.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Samuel K <skevetter@pm.me>
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This pull request refactors the provider management system by introducing a ProviderParams struct to encapsulate configuration parameters, consolidating multiple provider-loading paths into centralized workflows (LoadAllProviders), and adding new functions for provider lookup, installation, and source resolution (FindProvider, AddProvider, UpdateProvider, etc.). New provider source resolution logic is added to handle internal, URL-based, file-based, and GitHub-hosted providers.

Changes

Cohort / File(s) Summary
Provider API Refactoring
cmd/pro/login.go, pkg/workspace/provider.go
Introduces ProviderParams struct to replace positional arguments in AddProviderRaw. Adds public functions (LoadAllProviders, FindProvider, AddProvider, AddProviderRaw, UpdateProvider, CloneProvider, ResolveProviderSource) and internal helpers to consolidate provider loading, resolution, and installation workflows. Implements resolution logic for different provider source types (internal, URL, file, GitHub).
Error Handling
pkg/workspace/workspace.go
Adds errProvideWorkspaceArg variable to signal when a workspace argument must be provided in non-terminal contexts.

Sequence Diagram

sequenceDiagram
    participant Client as Caller
    participant LAP as LoadAllProviders
    participant LCP as loadConfiguredProviders
    participant LUP as loadUnconfiguredProviders
    participant Resolver as Provider Source Resolver
    participant Downloader as Binary Downloader

    Client->>LAP: LoadAllProviders(devPodConfig, log)
    LAP->>LCP: Load from devPodConfig
    LCP-->>LAP: configured providers map
    LAP->>LUP: Discover from filesystem
    LUP-->>LAP: unconfigured providers map
    LAP->>LAP: Merge maps
    
    alt Provider needs source resolved
        LAP->>Resolver: Resolve source (internal/URL/file/GitHub)
        Resolver->>Downloader: Download if needed
        Downloader-->>Resolver: raw provider bytes
        Resolver-->>LAP: resolved provider config
    end
    
    LAP-->>Client: map[string]*ProviderWithOptions
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor workspace provider' directly summarizes the main change—refactoring provider-related functions in the workspace package with a new ProviderParams struct and consolidated provider loading logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch regactor-workspace-provider

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.

@skevetter skevetter enabled auto-merge (squash) February 2, 2026 03:54
@skevetter skevetter merged commit 3ee7a3d into main Feb 2, 2026
39 checks passed
@skevetter skevetter deleted the regactor-workspace-provider branch February 2, 2026 04:09
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