Revert "fix: Add plugin to load routes" by HimavarshaVS · Pull Request #11878 · langflow-ai/langflow (original) (raw)
Walkthrough
This PR removes SSO (Single Sign-On) plugin functionality and the plugin route discovery system from the codebase. It deletes the Alembic migration for SSO tables, removes SSO model definitions and exports, eliminates the plugin route loader mechanism, and removes related test modules while refactoring platform-specific database tests to use mocks.
Changes
| Cohort / File(s) | Summary |
|---|---|
| SSO Feature Removal src/backend/base/langflow/alembic/versions/2ef4ca4016a3_add_sso_plugin_tables_sso_user_profile_.py, src/backend/base/langflow/services/database/models/auth/sso.py | Deleted Alembic migration script and SSO SQLModel definitions (SSOConfig, SSOUserProfile tables, columns, constraints, indices). |
| SSO Model Exports src/backend/base/langflow/services/database/models/__init__.py, src/backend/base/langflow/services/database/models/auth/__init__.py | Removed SSOConfig and SSOUserProfile from package public API exports. |
| Plugin Route System Removal src/backend/base/langflow/plugin_routes.py, src/backend/base/langflow/main.py | Deleted entire plugin route discovery mechanism (load_plugin_routes, _PluginAppWrapper, _get_route_keys); removed plugin route loading call from application startup. |
| SSO Tests Deletion src/backend/tests/unit/test_sso_models.py | Removed unit test module covering SSOUserProfile and SSOConfig model operations against a test database. |
| Plugin Route Tests Deletion src/backend/tests/unit/test_plugin_routes.py | Removed unit test module covering plugin route discovery, conflict detection, and plugin integration behavior. |
| Database Test Refactoring src/backend/tests/unit/test_database_windows_postgres_integration.py | Rewrote tests to use mock settings service and mock engine creation instead of real settings and engine; added platform-aware test variations for Windows, Linux, macOS with explicit event loop configuration assertions. |
| Windows PostgreSQL Test Expansion src/backend/tests/unit/test_windows_postgres_helper.py | Expanded test coverage across platforms (Windows, Linux, Darwin, FreeBSD); replaced custom mock policy class with generic type stub; added granular platform and environment variable mocking; extended URL format handling tests. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~50 minutes
🚥 Pre-merge checks | ✅ 5 | ❌ 2
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Test Quality And Coverage | ⚠️ Warning | Tests lack proper environment variable isolation using @patch.dict decorator, violating test isolation principles and established project patterns. | Replace direct os.environ mutations with @patch.dict decorator pattern already established in the codebase for consistent environment variable scoping. |
| Excessive Mock Usage Warning | ⚠️ Warning | Test files use excessive mocks (36 @patch decorators across 15 tests) that obscure actual behavior verification rather than clarifying intended functionality. | Reduce mock usage by testing real outcomes instead of mock call counts; remove mocks of asyncio policy functions and configure_windows_postgres_event_loop to enable true integration testing. |
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the primary action: reverting a previous commit that added plugin route loading functionality. It clearly summarizes the main change. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 95.45% which is sufficient. The required threshold is 80.00%. |
| Test Coverage For New Implementations | ✅ Passed | This PR is a revert removing SSO and plugin functionality with their tests; modified database tests are unrelated rewrites, not new implementations. |
| Test File Naming And Structure | ✅ Passed | Both test files follow correct naming patterns, have proper pytest structure with descriptive test function names, appropriate fixtures for setup/teardown, and comprehensive coverage of positive/negative scenarios and edge cases. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
- 📝 Generate docstrings (stacked PR)
- 📝 Generate docstrings (commit on current branch) 🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
revert-11759-feat/oss-enterprise-plugin-support
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.