* Add comprehensive coverage check workflow
Created a dedicated workflow that runs code coverage before PR approval:
🚀 Coverage Runs Early:
- Triggers: Push to branches + PR events (opened, sync, ready_for_review)
- Smart filtering: Only runs when backend code changes
- Fast feedback: Unit tests only for quick coverage results
📊 Comprehensive Reporting:
- CodeCov integration with proper flags and naming
- PR comments with coverage status and links
- Workflow summary with coverage percentage
- Coverage artifacts (XML + HTML) saved for review
⚡ Intelligent Execution:
- Path filtering: src/backend/**, pyproject.toml, uv.lock
- Branch filtering: main, develop, feature/**, fix/**, hotfix/**
- Draft protection: Skips draft PRs
- Dynamic naming: Different names for push vs PR contexts
🎯 Benefits:
- Developers get immediate coverage feedback on push
- Reviewers see coverage context during PR review
- Coverage issues caught before approval, not after
- Continuous monitoring of coverage trends across branches
This replaces the previous "coverage after approval" approach with
"coverage before approval" - exactly what was requested!
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove all restrictions from coverage workflow
- Coverage now runs on ANY push to ANY branch
- Coverage runs on ANY PR with ANY changes
- No path filtering - runs regardless of what files changed
- No branch filtering - runs on all branches
- Ensures coverage runs on every PR as requested
* move test to be run when we submit pr
* Configure CI to run tests before PR approval
- Remove 'lgtm' label requirement from CI trigger
- Run tests immediately on PR opened/synchronized events
- Add ci.yml to path filters to trigger tests when workflow changes
- Coverage and tests now run before approval for early feedback
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add labeled
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Improve session fixture cleanup and engine handling
Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.
* Update src/backend/tests/conftest.py
* Increase pytest timeout to 150 seconds
Updated the pytest timeout setting from 120 to 150 seconds in pyproject.toml to allow tests more time to complete, potentially addressing issues with longer-running tests.
* Update store_pytest_durations.yml
---------
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* refactor: Simplify flow execution validation by removing unnecessary asyncio.wait_for calls
Updated the validate_flow_execution function to directly use the client.post and client.get methods with a timeout parameter, improving code readability and maintainability. This change eliminates redundant timeout handling while ensuring consistent timeout values across API calls.
* refactor: Enhance template tests for improved structure and validation
Refactored the template tests in `test_starter_projects.py` to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests. Updated individual test methods to validate JSON structure, flow execution, and endpoint validation, ensuring comprehensive coverage of template functionality. This change streamlines the testing process and enhances the robustness of the test suite.
* refactor: Update project metadata and import paths in starter project JSON files
Modified the metadata section in multiple starter project JSON files to reflect updated code hashes and module paths, transitioning from 'lfx' to 'langflow' components. This change enhances consistency across the codebase and ensures that the correct modules are referenced for improved maintainability and clarity.
* chore: Update template test commands to utilize parallel execution
Modified the commands in the Makefile and CI workflows to include the `-n auto` option for pytest, enabling parallel test execution for the starter project template tests. This change enhances test performance and efficiency across the codebase.
* chore: Remove news-aggregated.json file
Deleted the news-aggregated.json file
* Update test_template_validation.py
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* add template tests
* remove files
* adding validate flow build
* add validate endpoint and flow execution
* Update .github/workflows/template-tests.yml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update src/backend/base/langflow/utils/template_validation.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* [autofix.ci] apply automated fixes
* change workflow running
* add ci
* fix test
* fix test
* delete when push
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Remove remaining merge conflict markers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Improve validate.py unit tests to eliminate CI failures
Fixed 4 failing tests in test_validate.py:
- test_code_with_syntax_error: Better error message handling for syntax errors
- test_raises_error_for_missing_function: Handle StopIteration along with ValueError
- test_creates_simple_class: Use optional constructor parameter to avoid TypeError
- test_handles_validation_error: Use proper ValidationError constructor from pydantic_core
- test_creates_context_with_langflow_imports: Remove invalid module patching
- test_creates_mock_classes_on_import_failure: Use proper import mocking
All 50 validate tests now pass consistently, improving CI stability.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* enhance: Add comprehensive edge case tests for template_validation.py
Added 6 additional test cases to improve coverage of template_validation.py:
- test_validate_stream_exception: Tests Graph.validate_stream() exception handling
- test_code_validation_other_exceptions: Tests TypeError/KeyError/AttributeError handling
- test_vertices_sorted_without_end_vertex_events: Tests variable usage tracking
- test_vertex_count_tracking: Tests vertex_count increment paths
- test_empty_lines_in_stream: Tests empty line handling in event streams
- test_event_stream_validation_exception: Tests exception handling in _validate_event_stream
These tests target the remaining 7 uncovered lines to maximize coverage percentage.
Total tests: 40 (all passing)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
* feat: Add smoke tests workflow for PR validation
- Adds smoke-test label trigger for running tests without API keys
- Runs backend tests excluding api_key_required markers
- Runs full frontend test suite with mocked APIs
- Provides fast feedback (~10-15 min) before lgtm label
- Enables external contributors to validate changes without API costs
- Comments results back to PR automatically
Usage: Add 'smoke-test' label to any PR to trigger
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Fix YAML indentation in smoke-tests workflow script block
* refactor: Focus smoke tests on critical functionality only
- Run only 10 essential backend test files (version, schema, serialization, etc.)
- Run only frontend unit tests (skip integration/e2e)
- Reduce timeout from 15 to 8 minutes
- Target critical functionality without external dependencies
- Avoid problematic database/API-dependent tests
* fix: Use correct Jest CLI option --testPathPatterns
* add frontend tests
* add tests
* change to essential tests
* fix: Create superuser in test_load_bundles_from_urls test
The test_load_bundles_from_urls test was failing because the load_bundles_from_urls
function expects a superuser to exist in the database, but the test client fixture
sets LANGFLOW_AUTO_LOGIN=false by default, which doesn't create a superuser.
This fix creates a superuser in the test database before calling the function,
resolving the 'Superuser not found in the database' error.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add on conditions
* fix: Check PR labels correctly for smoke test trigger
Change condition from github.event.label.name to
github.event.pull_request.labels.*.name to work with all trigger
events (synchronize, opened, etc), not just labeled events.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add workdispatch
* remove initial test
* adding timeout minutes
* edit env var
---------
Co-authored-by: Claude <noreply@anthropic.com>
* update
* [autofix.ci] apply automated fixes
* refactor: update file query logic and enhance error logging in file deletion
* refactor: enhance error handling and improve code clarity in MCP server list retrieval
* refactor: improve type hinting and code clarity in MCP servers file tests
* fix: handle potential None value for server configuration file in async server list retrieval
* Update test_files.py
* fix: autofix.ci / Update Starter Projects (pull_request)
* chore: Add API key environment variables to CI workflows
* Updated .github/workflows/ci.yml and .github/workflows/python_test.yml to include OPENAI_API_KEY, ANTHROPIC_API_KEY, and other relevant API keys as environment variables for CI jobs.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
* fix: improve predecessors check for loop component
- Enhanced the handling of cycle vertices to prevent infinite loops by ensuring that a vertex can only run if all pending predecessors have completed.
- Updated conditions for the first execution of cycle vertices to allow running only if all pending predecessors are also cycle vertices.
- This refactor improves the robustness of the vertex management system in asynchronous workflows.
* fix: update _mark_branch method to return visited vertices and refine predecessor mapping
* fix: prevent duplicate item dependencies in LoopComponent
* feat: add loop connection handling in Component class
- Introduced methods to process loop feedback connections, allowing components to connect outputs to loop-enabled inputs.
- Implemented checks to validate loop connections and ensure proper handling of callable methods from other components.
- Enhanced the edge creation logic to support special loop feedback edges targeting outputs instead of inputs.
* fix: enhance name overlap validation in FrontendNode
- Updated the validate_name_overlap method to exclude outputs that allow loops from the overlap check.
- Improved error message to include the display name of the component, along with detailed lists of input and output names for better debugging.
* fix: correct condition for executing cycle vertices in RunnableVerticesManager
- Updated the logic to ensure that a cycle vertex can only execute if it is a loop and all pending predecessors are cycle vertices. This change enhances the robustness of the vertex management system in asynchronous workflows.
* feat: implement comprehensive loop flow for URL processing
- Added a new loop flow that processes multiple URLs through a series of components including URLComponent, SplitTextComponent, LoopComponent, ParserComponent, PromptComponent, OpenAIModelComponent, StructuredOutputComponent, and ChatOutput.
- Enhanced the StructuredOutputComponent to include a detailed system prompt and refined output schema to ensure proper JSON formatting.
- Introduced a test case to validate the creation and execution of the loop flow, ensuring all components are correctly integrated and the expected execution order is maintained.
* refactor: enhance loop target handling in Component and Edge classes
- Introduced LoopTargetHandleDict to better manage loop target structures in the Component and Edge classes.
- Updated the Component class to utilize type casting for loop target handles, improving type safety.
- Refactored the Edge class to accommodate the new loop target handling, ensuring compatibility with existing edge structures.
- Removed deprecated message handling methods from the Component class to streamline the codebase and improve maintainability.
* test: skip OpenAI model integration test if API key is not set
- Added a conditional skip to the test_build_model_integration_reasoning method to prevent execution when the OPENAI_API_KEY environment variable is not set, ensuring tests run only in appropriate environments.
* [autofix.ci] apply automated fixes
* chore: add required secrets for OpenAI and Anthropic APIs in CI workflows
* Updated ci.yml to include OPENAI_API_KEY and ANTHROPIC_API_KEY secrets.
* Modified python_test.yml to mark these secrets as required for workflow execution.
* fix: update OPENAI_API_KEY check in test_loop.py to handle dummy values
* Modified the condition in the pytest skipif decorator to also skip tests when OPENAI_API_KEY is set to "dummy", ensuring more robust test execution.
* refactor: streamline component setup in test_loop.py
* Removed redundant comments and improved formatting for component initialization in the loop_flow function.
* Added missing system_prompt to StructuredOutputComponent to resolve "Multiple structured outputs" error.
* Updated test_loop_flow to ensure it tests the graph creation with proper loop feedback connection.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* chore: add jest-junit dependency for improved test reporting
- Updated package.json and package-lock.json to include jest-junit version 16.0.0, enhancing test reporting capabilities in the project.
* chore: enhance Jest configuration for improved test coverage and CI reporting
- Added coverage collection settings, including coverage thresholds and report formats.
- Configured CI-specific options for Jest, including the use of jest-junit for test reporting and adjusted worker settings for better performance in CI environments.
* chore: update frontend test command for CI mode to ensure proper environment variable usage
- Modified the test command in the Makefile to set CI=true for accurate test execution in CI environments.
* chore: enhance frontend CI workflow with test reporting and coverage uploads
- Replaced the frontend dependency installation step with a command to run unit tests in CI mode.
- Added steps to publish test results using junit report and to comment on pull requests with coverage summaries.
- Implemented artifact upload for coverage reports to improve visibility and tracking of test coverage over time.
* chore: add frontend dependency installation step to CI workflow
- Introduced a step to install frontend dependencies using npm ci in the GitHub Actions workflow.
- This enhancement ensures that all necessary packages are available before running frontend unit tests, improving the reliability of the CI process.
* chore: update junit report action version in CI workflow
- Upgraded the junit report action from v5 to v5.5.1 in the GitHub Actions workflow to leverage the latest features and improvements for test result reporting.
* chore: add Jest unit test workflow for frontend
- Introduced a new GitHub Actions workflow to run Jest unit tests for the frontend.
- The workflow includes steps for checking out the repository, setting up the Node.js environment, running tests, publishing test results, adding coverage comments on pull requests, and uploading coverage reports.
- This enhancement improves the CI process by ensuring comprehensive testing and reporting for frontend components.
* chore: integrate Jest unit tests into CI workflow
- Added a new job to the CI workflow to run frontend unit tests using Jest.
- Updated the changes filter to include Jest test files, ensuring they are recognized during the CI process.
- This enhancement improves the testing coverage and reliability of the frontend components.
chore: Comment out Docker build workflow for langflow-all due to runner limitations
* Temporarily disabled the `call_docker_build_main_all` job in the nightly release workflow.
* Added a TODO note to revisit this when the runner can accommodate builds with large dependencies like PyTorch.
* ✨ (custom-get-download-folders.ts): update default filename to include folderName variable to provide more context and improve user experience
* ✨ (custom-get-download-folders.ts): update folder name from "My Projects" to "Starter Project" for better clarity and consistency
* 📝 (.github/changes-filter.yaml): add new directory 'serialization' to components list for changes filtering
🐛 (general-bugs-truncate-results.spec.ts): fix typo in 'truncated' word and update timeout for better test reliability
* 🔧 (custom-get-download-folders.ts): Remove unnecessary conditional statement and update default filename for download to "flows.zip" for better clarity.
* chore: update webrtcvad dependency and add optional audio support
- Updated webrtcvad version requirement to >=1.9.4 in pyproject.toml and uv.lock.
- Moved webrtcvad to optional dependencies under the new 'audio' category in both pyproject.toml files for better modularity.
- Ensured compatibility with existing dependencies while enhancing documentation for optional audio features.
* fix: handle optional import of voice_mode_router in API initialization
- Updated the API router initialization to conditionally include the voice_mode_router if it is available, improving modularity and preventing import errors.
- Adjusted the import statement for voice_mode_router to handle ImportError gracefully, ensuring the application remains robust in its absence.
* feat: add voice mode flag to API configuration
- Introduced a new function `get_voice_mode_enabled` to check for the availability of the `webrtcvad` library, enhancing the API's capability to support voice mode features.
- Updated the `ConfigResponse` schema to include `voice_mode_enabled` flag, allowing clients to query the status of voice mode support.
- Integrated the voice mode feature flag into the `get_config` endpoint response, improving the configurability of the API.
* test: skip voice mode tests if webrtcvad is not installed
- Added a conditional import for the webrtcvad library in the voice mode test suite.
- Implemented a pytest marker to skip tests when webrtcvad is unavailable, enhancing test robustness and preventing unnecessary failures.
* feat: add voice mode state management to flows manager store
- Introduced `voiceModeEnabled` state and `setVoiceModeEnabled` action in the flows manager store to manage the voice mode feature.
- Updated the `ConfigResponse` interface and `useGetConfig` hook to integrate the new voice mode state, allowing for dynamic configuration updates.
- Enhanced the API's configurability by ensuring the voice mode state is properly set based on the API response.
* feat: conditionally render voice button based on voice mode state
- Integrated `voiceModeEnabled` from the flows manager store to control the visibility of the VoiceButton component.
- The VoiceButton will now return null if voice mode is not enabled, enhancing the user interface by preventing unnecessary rendering.
* fix: ensure boolean conversion for voice mode state in config hook
- Updated the `setVoiceModeEnabled` function in the `useGetConfig` hook to explicitly convert the `voice_mode_enabled` value to a boolean, ensuring consistent handling of the voice mode state based on API responses.
* refactor: conditionally import voice_mode_router in API initialization
- Updated the API router to conditionally include the voice_mode_router based on its availability, enhancing modularity and preventing import errors.
- Adjusted the __init__.py file to dynamically add voice_mode_router to the __all__ list if the import is successful, improving the API's robustness.
* chore: revert mcp version update
* refactor: reorder router initialization and add audio flag to backend install task
* feat: add audio module to backend installation command in VS Code tasks
* ci: add audio extras to uv sync in frontend tests