Skip to content

Conversation

@DJJones66
Copy link
Contributor

🚀 Enhance Plugin Installer with Unified GitHub & Local File Upload Support

Summary

This PR significantly improves the BrainDrive plugin installation experience by introducing a unified installer interface that supports both:

  • 📦 GitHub-based plugin installations, and
  • 💾 Local archive file uploads (ZIP, TAR.GZ, RAR)

✨ Key Features & Changes

🔁 Unified Installer Endpoint (Backend)

  • New /api/v1/plugins/install endpoint in lifecycle_api.py

  • Supports multipart form data with method=github or method=local-file

  • Handles:

    • GitHub repo cloning or release download
    • Local archive file extraction and validation
    • Installation via lifecycle manager
    • Metadata storage and discovery refresh

📂 Local File Support

  • Supports .zip, .tar.gz, .tgz, and .rar formats (RAR currently not extracted — placeholder for future support)
  • File validation includes format detection, file size limits (100MB), and structure validation
  • Temp file cleanup with robust error handling

🧪 Plugin Validation Enhancements

  • Better error messages and fallback paths
  • Suggested solutions included in HTTPException details for frontend display

🔄 Backend Refactors

  • RemotePluginInstaller refactored to support both GitHub and file-based installations
  • Introduced _extract_local_file() for archive processing
  • Added _store_local_file_metadata() for local plugin audit trails
  • Enhanced _get_error_suggestions() with new failure types

🧰 Frontend Enhancements

🧭 New Install Method Tabs UI

  • Replaced single GitHub form with tab-based UI (InstallMethodTabs.tsx)

  • Two install methods now available:

    • GitHub – auto-parses repo URLs and fetches available versions
    • Local File Upload – drag-and-drop with validation and progress display

📁 Local File Upload Component

  • New FileUploadZone with:

    • Drag-and-drop support
    • Format detection
    • File size enforcement
    • Upload previews and removal
    • User feedback via alerts (info, error, success)

🧠 Context-Aware Steps

  • Installation progress adapts based on method (usePluginInstaller handles dynamic step flows)
  • Each step visually updates (validating, extracting, installing, complete)

✅ Validation

  • ✔️ Verified install via GitHub URLs and specific tags
  • ✔️ Verified install via uploaded .zip and .tar.gz files
  • ✔️ Checked max size rejection and unsupported format handling
  • ✔️ Confirmed plugin registry refresh post-install
  • ✔️ Ensured consistent step progress and error feedback

🧩 Future-Proofing

  • Plugin installer now structured to easily support:

    • Plugin marketplace integration
    • Authenticated GitHub/private installs
    • Plugin update flows

@DJJones66 DJJones66 merged commit ea5ef8b into main Jul 13, 2025
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.

2 participants