Skip to content

fix: format models.py with Black, add ensureDefaultProfile to E2E tests#64

Merged
namtroi merged 1 commit into
mainfrom
setting
Dec 28, 2025
Merged

fix: format models.py with Black, add ensureDefaultProfile to E2E tests#64
namtroi merged 1 commit into
mainfrom
setting

Conversation

@namtroi

@namtroi namtroi commented Dec 28, 2025

Copy link
Copy Markdown
Owner

User description

  • Reformat ai-worker/src/models.py with Black
  • Add ensureDefaultProfile() call to all E2E tests to fix upload failures

PR Type

Bug fix, Tests


Description

  • Add ensureDefaultProfile() call to E2E test setup

    • Fixes upload failures in error-handling, pdf-upload-flow, and query-flow tests
  • Reformat models.py with Black code formatter

    • Fixes whitespace and line length issues in ProfileConfig class

Diagram Walkthrough

flowchart LR
  A["E2E Tests<br/>error-handling<br/>pdf-upload-flow<br/>query-flow"] -- "import ensureDefaultProfile" --> B["database.js helpers"]
  A -- "call in beforeEach" --> C["ensureDefaultProfile()"]
  C -- "ensures" --> D["Default Profile Setup"]
  E["models.py<br/>ProfileConfig"] -- "Black formatting" --> F["Code Style<br/>Compliance"]
Loading

File Walkthrough

Relevant files
Tests
error-handling.test.ts
Add ensureDefaultProfile to error-handling tests                 

apps/backend/tests/e2e/error-handling.test.ts

  • Import ensureDefaultProfile from database helpers
  • Call ensureDefaultProfile() in beforeEach hook to ensure default
    profile exists before each test
+2/-1     
pdf-upload-flow.test.ts
Add ensureDefaultProfile to pdf-upload-flow tests               

apps/backend/tests/e2e/pdf-upload-flow.test.ts

  • Import ensureDefaultProfile from database helpers
  • Call ensureDefaultProfile() in beforeEach hook to ensure default
    profile exists before each test
+2/-1     
query-flow.test.ts
Add ensureDefaultProfile to query-flow tests                         

apps/backend/tests/e2e/query-flow.test.ts

  • Import ensureDefaultProfile from database helpers
  • Call ensureDefaultProfile() in beforeEach hook to ensure default
    profile exists before each test
+2/-1     
Formatting
models.py
Format ProfileConfig class with Black                                       

apps/ai-worker/src/models.py

  • Remove trailing whitespace from docstring and class fields
  • Reformat ocr_languages_list property to comply with Black line length
    limits
  • Normalize blank lines between class sections
+8/-6     

- Reformat ai-worker/src/models.py with Black
- Add ensureDefaultProfile() call to all E2E tests to fix upload failures
@namtroi namtroi merged commit bd8d0f1 into main Dec 28, 2025
7 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant