Skip to content

feat: generate custom coverage config to omit legacy and external compoents#9221

Merged
epinzur merged 5 commits into
mainfrom
esp/fix_component_coverage
Jul 30, 2025
Merged

feat: generate custom coverage config to omit legacy and external compoents#9221
epinzur merged 5 commits into
mainfrom
esp/fix_component_coverage

Conversation

@epinzur
Copy link
Copy Markdown
Contributor

@epinzur epinzur commented Jul 29, 2025

Added a script to generate a custom python-cov config, to omit legacy and external components from the test coverage reporting.

Set the script to run at CI time... to generate the config file before running backend unit tests.

Also created a separate bucket for code coverage reporting, for getting a test coverage level on the components alone.

Summary by CodeRabbit

  • New Features

    • Automated generation of a test coverage configuration file, ensuring accurate exclusion of bundled frontend and legacy backend components from coverage reports.
  • Documentation

    • Added detailed documentation explaining the dynamic coverage configuration process and usage instructions.
  • Chores

    • Updated CI workflow to use the dynamically generated coverage configuration.
    • Enhanced code coverage tracking configuration and .gitignore to support the new process.

@SonicDMG SonicDMG temporarily deployed to esp/fix_component_coverage - langflow-manual-install PR #9221 July 29, 2025 11:42 — with Render Destroyed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 29, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A dynamic system for generating and using a .coveragerc file for backend test coverage was introduced. This involves a new Python script and documentation, updates to the GitHub Actions workflow and .gitignore, and enhancements to codecov.yml to track backend component coverage. No public code entities were modified.

Changes

Cohort / File(s) Change Summary
CI Workflow Update
.github/workflows/python_test.yml
Added a step to generate .coveragerc dynamically before tests; updated test command to use this config.
Codecov Component Configuration
codecov.yml
Added a components section to track coverage for backend components; no changes to existing flags or rules.
Coverage Config Generation Script
scripts/generate_coverage_config.py
New script to generate .coveragerc by excluding bundled frontend and legacy backend components.
Script Documentation
scripts/generate_coverage_config.md
New documentation describing the coverage config generation script, its process, and usage.
Gitignore Update
src/backend/.gitignore
Added .coveragerc to ignored files, marking it as a generated artifact.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions CI
    participant Script as generate_coverage_config.py
    participant Backend as Backend Tests

    CI->>Script: Run generate_coverage_config.py
    Script->>Script: Extract bundled/legacy components
    Script->>Script: Generate .coveragerc
    CI->>Backend: Run tests with pytest-cov using .coveragerc
    Backend->>CI: Report coverage results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

size:M, lgtm

Suggested reviewers

  • jordanrfrazier
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch esp/fix_component_coverage

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
codecov.yml (1)

72-72: Fix trailing spaces.

Static analysis detected trailing spaces on this line.

-    name: "Backend Components" 
+    name: "Backend Components"
scripts/generate_coverage_config.py (1)

80-136: Fix docstring formatting and ensure directory creation safety.

The coverage configuration generation logic is well-implemented with good error handling and clear output formatting.

-def generate_coveragerc(bundle_names: set[str], legacy_files: set[str], output_path: str):
-    """Generate .coveragerc file with omit patterns"""
+def generate_coveragerc(bundle_names: set[str], legacy_files: set[str], output_path: str):
+    """Generate .coveragerc file with omit patterns."""
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86c54de and ad22ca4.

📒 Files selected for processing (5)
  • .github/workflows/python_test.yml (1 hunks)
  • codecov.yml (1 hunks)
  • scripts/generate_coverage_config.md (1 hunks)
  • scripts/generate_coverage_config.py (1 hunks)
  • src/backend/.gitignore (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.487Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.
.github/workflows/python_test.yml (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.487Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Validate input/output behavior and test component initialization and configuration in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test flows using predefined JSON data and utility functions such as 'create_flow', 'build_flow', 'get_build_events', and 'consume_and_assert_stream' in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Mock external dependencies appropriately in backend Python tests to isolate unit tests from external services.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to {tests/**/*.py,Makefile} : Run make unit_tests to execute backend unit tests

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

src/backend/.gitignore (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

codecov.yml (13)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.md : Create comprehensive unit tests for all new components. If unit tests are incomplete, create a Markdown file with manual testing steps in the same directory as the unit tests, using the same filename as the component but with a '.md' extension.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/backend//components//*.py : In your Python component class, set the icon attribute to a string matching the frontend icon mapping exactly (case-sensitive).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.487Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

scripts/generate_coverage_config.md (13)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.md : Create comprehensive unit tests for all new components. If unit tests are incomplete, create a Markdown file with manual testing steps in the same directory as the unit tests, using the same filename as the component but with a '.md' extension.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Each frontend test should have a clear description or comment explaining its purpose, especially for complex setups or mocks.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Mock external dependencies appropriately in frontend test files to isolate unit tests from external services.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Documentation is automatically deployed on commit to the main branch; build artifacts are output to the build/ directory and served via CDN.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: All documentation changes must be built and served locally using yarn build and yarn serve before deployment.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Applies to docs/docs/**/*.{md,mdx} : All documentation Markdown and MDX files must begin with a frontmatter block including at least title and description fields.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Validate input/output behavior and test component initialization and configuration in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Validate input/output behavior and test component initialization and configuration in frontend test files.

scripts/generate_coverage_config.py (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test component configuration updates in backend Python tests by asserting correct updates to build configuration objects.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Validate input/output behavior and test component initialization and configuration in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to {src/backend//*.py,tests//*.py,Makefile} : Run make format_backend to format Python code before linting or committing changes

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.py : Mock external dependencies appropriately in backend Python tests to isolate unit tests from external services.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/backend/tests/**/*.md : Create comprehensive unit tests for all new components. If unit tests are incomplete, create a Markdown file with manual testing steps in the same directory as the unit tests, using the same filename as the component but with a '.md' extension.

🪛 YAMLlint (1.37.1)
codecov.yml

[error] 72-72: trailing spaces

(trailing-spaces)

🪛 GitHub Check: Ruff Style Check (3.13)
scripts/generate_coverage_config.py

[failure] 81-81: Ruff (D415)
scripts/generate_coverage_config.py:81:5: D415 First line should end with a period, question mark, or exclamation point


[failure] 63-63: Ruff (PTH123)
scripts/generate_coverage_config.py:63:26: PTH123 open() should be replaced by Path.open()


[failure] 61-61: Ruff (PTH118)
scripts/generate_coverage_config.py:61:29: PTH118 os.path.join() should be replaced by Path with / operator


[failure] 58-58: Ruff (B007)
scripts/generate_coverage_config.py:58:15: B007 Loop control variable dirs not used within loop body


[failure] 53-53: Ruff (PTH110)
scripts/generate_coverage_config.py:53:12: PTH110 os.path.exists() should be replaced by Path.exists()


[failure] 50-50: Ruff (D415)
scripts/generate_coverage_config.py:50:5: D415 First line should end with a period, question mark, or exclamation point


[failure] 28-28: Ruff (PTH123)
scripts/generate_coverage_config.py:28:10: PTH123 open() should be replaced by Path.open()


[failure] 22-22: Ruff (PTH110)
scripts/generate_coverage_config.py:22:12: PTH110 os.path.exists() should be replaced by Path.exists()


[failure] 20-20: Ruff (PTH118)
scripts/generate_coverage_config.py:20:24: PTH118 os.path.join() should be replaced by Path with / operator


[failure] 19-19: Ruff (D415)
scripts/generate_coverage_config.py:19:5: D415 First line should end with a period, question mark, or exclamation point

🪛 GitHub Actions: Ruff Style Check
scripts/generate_coverage_config.py

[error] 19-19: D415: First line should end with a period, question mark, or exclamation point.

🔇 Additional comments (6)
src/backend/.gitignore (1)

134-137: LGTM - Appropriate .gitignore additions.

The addition of .coveragerc to .gitignore is correct since this file is dynamically generated by the new script. The descriptive comment clearly explains its purpose.

.github/workflows/python_test.yml (2)

73-79: LGTM - Well-integrated coverage configuration step.

The new step is properly positioned in the workflow and provides clear logging about the coverage configuration generation process.


85-85: LGTM - Correct coverage configuration usage.

The unit test command correctly references the dynamically generated .coveragerc file, ensuring the custom exclusions are applied during coverage reporting.

codecov.yml (1)

69-77: LGTM - Well-structured coverage component configuration.

The new backend-components coverage component provides focused tracking for core backend components, with clear documentation about the exclusions handled by the generated .coveragerc file.

scripts/generate_coverage_config.md (1)

1-36: LGTM - Excellent documentation.

The documentation is comprehensive and well-structured, clearly explaining the purpose, implementation, usage, and benefits of the dynamic coverage configuration system. The examples and integration details are particularly helpful.

scripts/generate_coverage_config.py (1)

138-169: LGTM - Well-structured main function with clear flow.

The main function properly orchestrates the coverage configuration generation with good logging and user guidance. The path resolution using pathlib is appropriate.

Comment thread scripts/generate_coverage_config.py Outdated
Comment thread scripts/generate_coverage_config.py Outdated
@epinzur epinzur force-pushed the esp/fix_component_coverage branch from ad22ca4 to 90a5305 Compare July 29, 2025 11:54
@SonicDMG SonicDMG temporarily deployed to esp/fix_component_coverage - langflow-manual-install PR #9221 July 29, 2025 11:54 — with Render Destroyed
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@epinzur epinzur added the lgtm This PR has been approved by a maintainer label Jul 29, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@epinzur epinzur force-pushed the esp/fix_component_coverage branch from dac3d1d to 522f627 Compare July 29, 2025 12:45
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.68%. Comparing base (96b35e0) to head (f068470).
⚠️ Report is 5 commits behind head on main.

❌ Your project status has failed because the head coverage (55.68%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9221      +/-   ##
==========================================
+ Coverage   52.72%   55.68%   +2.95%     
==========================================
  Files         634      396     -238     
  Lines       43605    32794   -10811     
  Branches      125      125              
==========================================
- Hits        22991    18261    -4730     
+ Misses      20564    14483    -6081     
  Partials       50       50              
Flag Coverage Δ
backend 55.50% <ø> (+2.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 242 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread scripts/generate_coverage_config.py
@epinzur epinzur force-pushed the esp/fix_component_coverage branch from 8c7fd21 to 3a2a42c Compare July 29, 2025 18:36
@SonicDMG SonicDMG temporarily deployed to esp/fix_component_coverage - langflow-manual-install PR #9221 July 29, 2025 18:36 — with Render Destroyed
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@epinzur epinzur force-pushed the esp/fix_component_coverage branch from 281f829 to fa99dd6 Compare July 29, 2025 18:56
@SonicDMG SonicDMG temporarily deployed to esp/fix_component_coverage - langflow-manual-install PR #9221 July 29, 2025 18:56 — with Render Destroyed
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@SonicDMG SonicDMG temporarily deployed to esp/fix_component_coverage - langflow-manual-install PR #9221 July 29, 2025 18:58 — with Render Destroyed
*/__init__.py

# Deactivate Components
*/components/deactivated/*
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now also excluding deactivated components

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@epinzur epinzur added this pull request to the merge queue Jul 30, 2025
Merged via the queue into main with commit da4208d Jul 30, 2025
34 of 35 checks passed
@epinzur epinzur deleted the esp/fix_component_coverage branch July 30, 2025 04:57
2getsandesh pushed a commit to 2getsandesh/langflow-IBM that referenced this pull request Aug 6, 2025
…poents (langflow-ai#9221)

* feat: generate custom coverage config to omit legacy and external components

* lint

* fix components config

* also remove deactivated componenets

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants