Skip to content

fix: Resolve ruff lint violations in deployment service #11993

Closed
Cristhianzl wants to merge 1 commit into
mainfrom
cz/fix-ruff-style
Closed

fix: Resolve ruff lint violations in deployment service #11993
Cristhianzl wants to merge 1 commit into
mainfrom
cz/fix-ruff-style

Conversation

@Cristhianzl
Copy link
Copy Markdown
Member

@Cristhianzl Cristhianzl commented Mar 3, 2026

Objective
Fix 40 ruff lint errors introduced in #11979 across the deployment service module.

Changes

  • Break long string literal in DeploymentNotConfiguredError to comply with 120-char line limit (E501)
  • Use TypeError instead of ValueError for type-check validations in BaseFlowArtifact (TRY004)
  • Add per-file-ignore for ARG002 on deployment stub service, matching existing auth/service.py pattern
  • Simplify pytest.raises blocks and remove unnecessary parentheses on raised exceptions (PT012, RSE102)

Summary by CodeRabbit

  • Bug Fixes

    • Updated exception type handling in deployment schema validation for improved error consistency.
  • Chores

    • Added new linting rule configuration for deployment services.
    • Updated error message formatting in deployment configuration exceptions.

@Cristhianzl Cristhianzl self-assigned this Mar 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91219be and db5885e.

📒 Files selected for processing (4)
  • pyproject.toml
  • src/lfx/src/lfx/services/deployment/exceptions.py
  • src/lfx/src/lfx/services/deployment/schema.py
  • src/lfx/tests/unit/services/deployment/test_deployment_exceptions.py

Walkthrough

This PR adds a lint rule mapping to the project configuration, updates exception message formatting, changes an exception type from ValueError to TypeError in validation logic, and adjusts test patterns to use bare exception raises with associated assertions about exception hierarchies.

Changes

Cohort / File(s) Summary
Configuration & Linting
pyproject.toml
Added lint rule mapping for deployment service file with ARG002 code (no-op stub argument indicator).
Exception Handling
src/lfx/src/lfx/services/deployment/exceptions.py
Updated default message string for DeploymentNotConfiguredError by splitting into two adjacent string literals for compile-time concatenation. No behavioral impact.
Validation Logic
src/lfx/src/lfx/services/deployment/schema.py
Changed exception type from ValueError to TypeError when "nodes" or "edges" validation fails in validate_data.
Test Assertions
src/lfx/tests/unit/services/deployment/test_deployment_exceptions.py
Added explicit subclass assertion for CredentialResolutionError and DeploymentError. Replaced parenthesized exception calls with bare exception raises in test cases for CredentialResolutionError and DeploymentNotFoundError.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ 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 cz/fix-ruff-style

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.

@Cristhianzl Cristhianzl closed this Mar 3, 2026
@github-actions github-actions Bot added the bug Something isn't working label Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 23%
22.87% (7981/34889) 15.45% (4224/27334) 15.6% (1147/7348)

Unit Test Results

Tests Skipped Failures Errors Time
2611 0 💤 0 ❌ 0 🔥 43.246s ⏱️

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.31%. Comparing base (91219be) to head (db5885e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11993      +/-   ##
==========================================
- Coverage   37.32%   37.31%   -0.01%     
==========================================
  Files        1592     1592              
  Lines       78279    78277       -2     
  Branches    11824    11824              
==========================================
- Hits        29216    29212       -4     
- Misses      47443    47445       +2     
  Partials     1620     1620              
Flag Coverage Δ
backend 57.34% <ø> (-0.01%) ⬇️
frontend 20.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/lfx/src/lfx/services/deployment/exceptions.py 100.00% <ø> (ø)
src/lfx/src/lfx/services/deployment/schema.py 94.06% <ø> (-0.06%) ⬇️

... and 8 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant