Skip to content

Conversation

@Devasy
Copy link
Owner

@Devasy Devasy commented Aug 2, 2025

Summary by CodeRabbit

  • Chores
    • Updated test coverage configuration with refined thresholds and expanded ignore patterns.
    • Enhanced backend test workflows for improved coverage reporting and streamlined analytics upload.
    • Removed frontend test job from CI workflows.
    • Replaced auto-formatting tool from autopep8 to flake8.
    • Added flake8 configuration with customized settings and exclusions.
    • Applied various code formatting improvements across backend, frontend, and test files for better readability without changing functionality.

@netlify
Copy link

netlify bot commented Aug 2, 2025

Deploy Preview for splitwizer failed. Why did it fail? →

Name Link
🔨 Latest commit 7ebcd0d
🔍 Latest deploy log https://app.netlify.com/projects/splitwizer/deploys/688dcc392173b200088100f9

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 2, 2025

Walkthrough

This update revises the .codecov.yml configuration to adjust coverage thresholds, ignore patterns, and branch exclusions. The GitHub Actions workflow for backend tests is refined for subdirectory execution, improved coverage reporting, debugging, and Codecov upload parameters, with the frontend test job removed. Multiple Python files and test scripts have formatting and import order improvements for consistency and readability.

Changes

Cohort / File(s) Change Summary
Codecov Configuration
.codecov.yml
Increased coverage threshold values, lowered patch coverage targets, expanded ignore patterns to exclude frontend and build artifacts, refined branch exclusions, removed frontend-related components and test analytics config, and updated comments and quoting for consistency.
GitHub Actions Workflow
.github/workflows/run-tests.yml
Renamed workflow, moved backend test execution into backend directory, simplified coverage reports, added debugging step, downgraded Codecov uploader version with updated parameters, and removed entire frontend test job and related steps.
Pre-commit Configuration
.pre-commit-config.yaml
Replaced autopep8 hook with flake8 hook, updating repository URL, revision, and hook ID accordingly.
Flake8 Setup
setup.cfg
Added new flake8 configuration file specifying max line length, ignored error codes, and excluded directories and files.
Python Code Formatting & Import Order
ui-poc/Home.py, ui-poc/pages/*, ui-poc/setup_test_data.py
Reordered imports and consolidated multi-line statements into single lines for improved readability without logic changes.
Backend Code Formatting
backend/app/auth/*, backend/app/expenses/*, backend/app/groups/*, backend/app/user/routes.py, backend/scripts/migrate_avatar_to_imageurl.py
Removed unnecessary line breaks and parentheses in function calls, exception raising, dictionary literals, and logging statements, consolidating multi-line expressions into single lines without altering logic or flow.
Backend Tests Formatting
backend/tests/auth/*, backend/tests/expenses/*, backend/tests/groups/*, backend/tests/user/*, backend/tests/conftest.py
Reformatted multi-line assertions, mock patches, and calls into single-line statements for consistency and readability without changing test logic or behavior.
Disabled Workflow
.github/workflows/bundle-analysis.yml.disabled
Added a fully commented-out GitHub Actions workflow for frontend bundle size analysis, currently disabled due to lack of frontend tests.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Backend Tests
    participant Codecov

    Developer->>GitHub Actions: Push code / open PR
    GitHub Actions->>Backend Tests: Run tests in backend/
    Backend Tests-->>GitHub Actions: Generate coverage.xml, test results
    GitHub Actions->>Codecov: Upload backend coverage
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

quality-assurance, gssoc25, level2, code-quality

Suggested reviewers

  • akshatshahh

Poem

🐇 In code's quiet burrow, lines align,
Formatting neat, all neat and fine.
Coverage thresholds raised with care,
Frontend tests paused, backend’s aware.
Workflows trimmed and imports set right,
This bunny hops off, review done light! ✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1523c85 and 7ebcd0d.

📒 Files selected for processing (1)
  • setup.cfg (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • setup.cfg
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/codecov-pytest

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

❌ Patch coverage is 34.00000% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.78%. Comparing base (e3fff9a) to head (7ebcd0d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

❌ Your patch status has failed because the patch coverage (8.33%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #112       +/-   ##
===========================================
- Coverage   88.96%   71.78%   -17.19%     
===========================================
  Files          29       17       -12     
  Lines        3923     1662     -2261     
  Branches      189      152       -37     
===========================================
- Hits         3490     1193     -2297     
+ Misses        433      416       -17     
- Partials        0       53       +53     
Components Coverage Δ
Authentication System 75.45% <63.63%> (∅)
Expense Management 68.75% <33.33%> (∅)
Group Management 66.77% <8.33%> (∅)
User Management 97.16% <ø> (∅)
Backend Core 69.41% <ø> (+2.74%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
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: 1

🧹 Nitpick comments (3)
ui-poc/Home.py (1)

2-2: Remove unused datetime import

datetime isn’t referenced anywhere in the module and Ruff flags it (F401).

-from datetime import datetime
.codecov.yml (1)

147-147: Add terminating newline to satisfy YAML linters

The file is missing a trailing newline (new-line-at-end-of-file).

-  - "frontend/::" # Remove frontend/ prefix from coverage paths
+  - "frontend/::" # Remove frontend/ prefix from coverage paths
+
.github/workflows/run-tests.yml (1)

133-140: Mixed Codecov action versions create maintenance debt

Frontend step uses codecov-action@v5 while backend uses @v4, and the inputs differ between versions.
Standardise on a single major version (ideally the same one already adopted for backend) to avoid surprises.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3fff9a and 3947e7b.

📒 Files selected for processing (3)
  • .codecov.yml (4 hunks)
  • .github/workflows/run-tests.yml (3 hunks)
  • ui-poc/Home.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
ui-poc/Home.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

ui-poc/Home.py: Frontend POC must be implemented using Streamlit, with the entry point in ui-poc/Home.py.
Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

Files:

  • ui-poc/Home.py
🧠 Learnings (3)
📚 Learning: applies to ui-poc/home.py : streamlit session state must be used to manage user sessions in the fron...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/Home.py : Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

Applied to files:

  • ui-poc/Home.py
📚 Learning: applies to backend/tests/**/*.py : backend tests must be placed in the /backend/tests/ directory and...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/tests/**/*.py : Backend tests must be placed in the /backend/tests/ directory and run using pytest.

Applied to files:

  • .github/workflows/run-tests.yml
📚 Learning: applies to backend/**/*.py : backend code must be implemented using fastapi with python 3.9+ and org...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/**/*.py : Backend code must be implemented using FastAPI with Python 3.9+ and organized under the /backend/ directory.

Applied to files:

  • .github/workflows/run-tests.yml
🪛 Ruff (0.12.2)
ui-poc/Home.py

2-2: datetime.datetime imported but unused

Remove unused import: datetime.datetime

(F401)

🪛 YAMLlint (1.37.1)
.codecov.yml

[error] 147-147: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/run-tests.yml

[error] 42-42: trailing spaces

(trailing-spaces)


[error] 48-48: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)


[error] 105-105: trailing spaces

(trailing-spaces)


[error] 111-111: trailing spaces

(trailing-spaces)


[error] 123-123: trailing spaces

(trailing-spaces)


[error] 145-145: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
.github/workflows/run-tests.yml (1)

124-131: JUnit upload path won’t exist for real frontend tests

jest-junit writes to ./junit.xml unless JEST_JUNIT_OUTPUT is set.
The workflow tries to upload frontend/test-results/frontend-results.xml, which only exists in the placeholder branch.
Please set the env var before running tests or adjust the upload path.

Comment on lines +59 to 66
uses: codecov/codecov-action@v4
if: github.actor != 'dependabot[bot]'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml,./coverage.json,./coverage.lcov
file: backend/coverage.xml
flags: backend,python,api
name: "Backend Coverage"
name: backend-coverage
fail_ci_if_error: false
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Incorrect input name for Codecov action v4

codecov/codecov-action@v4 accepts files: (plural), not file:.
Using the wrong key causes the coverage upload to be skipped.

-        file: backend/coverage.xml
+        files: backend/coverage.xml
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: codecov/codecov-action@v4
if: github.actor != 'dependabot[bot]'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml,./coverage.json,./coverage.lcov
file: backend/coverage.xml
flags: backend,python,api
name: "Backend Coverage"
name: backend-coverage
fail_ci_if_error: false
uses: codecov/codecov-action@v4
if: github.actor != 'dependabot[bot]'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: backend/coverage.xml
flags: backend,python,api
name: backend-coverage
fail_ci_if_error: false
🤖 Prompt for AI Agents
In .github/workflows/run-tests.yml around lines 59 to 66, the Codecov action
uses the incorrect input key 'file:' which should be 'files:' to properly upload
coverage reports. Change the key from 'file:' to 'files:' to ensure the coverage
upload is executed correctly.

Copy link
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: 1

🔭 Outside diff range comments (1)
ui-poc/Home.py (1)

9-25: Fix duplicate page configuration

There are two identical st.set_page_config() calls which could cause issues in Streamlit. The second one (lines 20-25) should be removed.

- # Configure the page
- st.set_page_config(
-     page_title="Splitwiser",
-     page_icon="💰",
-     layout="wide",
-     initial_sidebar_state="expanded",
- )
♻️ Duplicate comments (1)
.github/workflows/run-tests.yml (1)

62-65: Incorrect Codecov input key file – upload will be skipped
Codecov v4 expects the plural input files. The same issue was noted in the previous review but still persists, so coverage is never uploaded.

-        file: backend/coverage.xml
+        files: backend/coverage.xml
🧹 Nitpick comments (6)
.codecov.yml (1)

113-113: Add missing newline at end of file.

YAMLlint flagged the missing newline character at the end of the file.

 github_checks:
-  annotations: true
+  annotations: true
+
ui-poc/pages/Groups.py (1)

1077-1077: Remove unnecessary f-string prefix.

Static analysis correctly flagged an f-string without any placeholders.

-                        st.markdown(f":gray[You are not included in this expense]")
+                        st.markdown(":gray[You are not included in this expense]")
backend/app/expenses/routes.py (1)

184-184: Consider improving exception chaining

While the formatting consolidation is good, consider adding explicit exception chaining to distinguish between original errors and re-raised exceptions. This improves debugging by preserving the original exception context.

Example for line 184:

- raise HTTPException(status_code=500, detail="Failed to upload attachment")
+ raise HTTPException(status_code=500, detail="Failed to upload attachment") from e

Apply similar changes to other exception handling blocks where the original exception should be preserved for debugging.

Also applies to: 232-232, 290-290, 308-308, 327-327, 348-348, 408-408, 420-420, 439-439, 462-462

ui-poc/Home.py (1)

2-2: Remove unused import

The datetime import is not used in the file and should be removed as flagged by static analysis.

- from datetime import datetime
backend/app/expenses/service.py (1)

54-54: Consider improving exception chaining

Similar to other files, these exception handling blocks would benefit from explicit exception chaining to preserve debugging context.

Apply exception chaining for better error tracking:

# Line 54
- raise HTTPException(status_code=500, detail="Failed to process group ID")
+ raise HTTPException(status_code=500, detail="Failed to process group ID") from e

# Line 247  
- raise HTTPException(status_code=500, detail="Unable to process IDs")
+ raise HTTPException(status_code=500, detail="Unable to process IDs") from e

# Line 293
- raise HTTPException(status_code=400, detail="Invalid expense ID format")
+ raise HTTPException(status_code=400, detail="Invalid expense ID format") from None

Also applies to: 247-247, 293-293

.github/workflows/run-tests.yml (1)

41-48: Trailing whitespace reported by YAML-lint
Lines 42, 48 and 57 contain trailing spaces. Clean them up to keep the workflow YAML tidy and lint-clean.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3947e7b and 1523c85.

📒 Files selected for processing (27)
  • .codecov.yml (3 hunks)
  • .github/workflows/bundle-analysis.yml.disabled (1 hunks)
  • .github/workflows/run-tests.yml (2 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • backend/app/auth/routes.py (5 hunks)
  • backend/app/auth/security.py (2 hunks)
  • backend/app/auth/service.py (11 hunks)
  • backend/app/expenses/routes.py (11 hunks)
  • backend/app/expenses/schemas.py (2 hunks)
  • backend/app/expenses/service.py (17 hunks)
  • backend/app/groups/routes.py (4 hunks)
  • backend/app/groups/service.py (8 hunks)
  • backend/app/user/routes.py (1 hunks)
  • backend/scripts/migrate_avatar_to_imageurl.py (2 hunks)
  • backend/tests/auth/test_auth_routes.py (5 hunks)
  • backend/tests/auth/test_auth_service.py (10 hunks)
  • backend/tests/conftest.py (1 hunks)
  • backend/tests/expenses/test_expense_routes.py (2 hunks)
  • backend/tests/expenses/test_expense_service.py (31 hunks)
  • backend/tests/groups/test_groups_service.py (1 hunks)
  • backend/tests/user/test_user_routes.py (6 hunks)
  • backend/tests/user/test_user_service.py (4 hunks)
  • setup.cfg (1 hunks)
  • ui-poc/Home.py (5 hunks)
  • ui-poc/pages/Friends.py (5 hunks)
  • ui-poc/pages/Groups.py (24 hunks)
  • ui-poc/setup_test_data.py (5 hunks)
✅ Files skipped from review due to trivial changes (15)
  • .pre-commit-config.yaml
  • backend/app/user/routes.py
  • backend/app/auth/security.py
  • backend/tests/conftest.py
  • backend/app/expenses/schemas.py
  • backend/app/auth/service.py
  • backend/tests/expenses/test_expense_routes.py
  • backend/scripts/migrate_avatar_to_imageurl.py
  • backend/app/groups/routes.py
  • backend/tests/user/test_user_routes.py
  • ui-poc/pages/Friends.py
  • backend/tests/groups/test_groups_service.py
  • backend/app/groups/service.py
  • setup.cfg
  • .github/workflows/bundle-analysis.yml.disabled
🧰 Additional context used
📓 Path-based instructions (9)
backend/**/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Backend code must be implemented using FastAPI with Python 3.9+ and organized under the /backend/ directory.

Files:

  • backend/tests/auth/test_auth_routes.py
  • backend/app/auth/routes.py
  • backend/tests/user/test_user_service.py
  • backend/tests/auth/test_auth_service.py
  • backend/tests/expenses/test_expense_service.py
  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
backend/tests/**/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Backend tests must be placed in the /backend/tests/ directory and run using pytest.

Files:

  • backend/tests/auth/test_auth_routes.py
  • backend/tests/user/test_user_service.py
  • backend/tests/auth/test_auth_service.py
  • backend/tests/expenses/test_expense_service.py
backend/app/{auth,user,groups,expenses}/**/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

backend/app/{auth,user,groups,expenses}/**/*.py: Backend services should be modular, with authentication and user registration in app/auth/, user profile management in app/user/, group management in app/groups/, and expense tracking in app/expenses/.
When adding a new API endpoint, add the route to the appropriate service router file in the backend.

Files:

  • backend/app/auth/routes.py
  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
backend/app/auth/**/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

JWT authentication with refresh token rotation must be implemented in the backend.

Files:

  • backend/app/auth/routes.py
ui-poc/setup_test_data.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Test data for the frontend must be generated using ui-poc/setup_test_data.py.

Files:

  • ui-poc/setup_test_data.py
backend/app/expenses/**/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

backend/app/expenses/**/*.py: Support for different expense split types (equal, unequal, percentage-based) must be implemented in the expense tracking logic.
Settlements must track debt resolution between users in the expense tracking logic.

Files:

  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
ui-poc/Home.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

ui-poc/Home.py: Frontend POC must be implemented using Streamlit, with the entry point in ui-poc/Home.py.
Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

Files:

  • ui-poc/Home.py
ui-poc/pages/*.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

ui-poc/pages/*.py: Frontend POC application pages must be placed in ui-poc/pages/ as individual Python files.
When adding a new UI component, modify or add files in /ui-poc/pages/.

Files:

  • ui-poc/pages/Groups.py
ui-poc/pages/Groups.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

API calls from the frontend should use retry logic as demonstrated in Groups.py.

Files:

  • ui-poc/pages/Groups.py
🧠 Learnings (13)
📚 Learning: applies to backend/app/auth/**/*.py : jwt authentication with refresh token rotation must be impleme...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/auth/**/*.py : JWT authentication with refresh token rotation must be implemented in the backend.

Applied to files:

  • backend/app/auth/routes.py
📚 Learning: applies to backend/app/auth/security.py : to troubleshoot authentication issues, check jwt token han...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/auth/security.py : To troubleshoot authentication issues, check JWT token handling in app/auth/security.py.

Applied to files:

  • backend/app/auth/routes.py
📚 Learning: applies to backend/app/{auth,user,groups,expenses}/**/*.py : when adding a new api endpoint, add the...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/{auth,user,groups,expenses}/**/*.py : When adding a new API endpoint, add the route to the appropriate service router file in the backend.

Applied to files:

  • backend/app/auth/routes.py
  • backend/app/expenses/routes.py
📚 Learning: applies to ui-poc/setup_test_data.py : test data for the frontend must be generated using ui-poc/set...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/setup_test_data.py : Test data for the frontend must be generated using ui-poc/setup_test_data.py.

Applied to files:

  • ui-poc/setup_test_data.py
📚 Learning: applies to backend/app/expenses/**/*.py : settlements must track debt resolution between users in th...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/expenses/**/*.py : Settlements must track debt resolution between users in the expense tracking logic.

Applied to files:

  • backend/tests/expenses/test_expense_service.py
  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
  • ui-poc/pages/Groups.py
📚 Learning: applies to backend/app/expenses/**/*.py : support for different expense split types (equal, unequal,...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/expenses/**/*.py : Support for different expense split types (equal, unequal, percentage-based) must be implemented in the expense tracking logic.

Applied to files:

  • backend/tests/expenses/test_expense_service.py
  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
  • ui-poc/pages/Groups.py
📚 Learning: applies to backend/app/{auth,user,groups,expenses}/**/*.py : backend services should be modular, wit...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/app/{auth,user,groups,expenses}/**/*.py : Backend services should be modular, with authentication and user registration in app/auth/, user profile management in app/user/, group management in app/groups/, and expense tracking in app/expenses/.

Applied to files:

  • backend/tests/expenses/test_expense_service.py
  • backend/app/expenses/routes.py
  • backend/app/expenses/service.py
📚 Learning: applies to backend/tests/**/*.py : backend tests must be placed in the /backend/tests/ directory and...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to backend/tests/**/*.py : Backend tests must be placed in the /backend/tests/ directory and run using pytest.

Applied to files:

  • .github/workflows/run-tests.yml
📚 Learning: applies to ui-poc/home.py : frontend poc must be implemented using streamlit, with the entry point i...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/Home.py : Frontend POC must be implemented using Streamlit, with the entry point in ui-poc/Home.py.

Applied to files:

  • ui-poc/Home.py
📚 Learning: applies to ui-poc/home.py : streamlit session state must be used to manage user sessions in the fron...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/Home.py : Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

Applied to files:

  • ui-poc/Home.py
📚 Learning: applies to ui-poc/pages/*.py : when adding a new ui component, modify or add files in /ui-poc/pages/...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/pages/*.py : When adding a new UI component, modify or add files in /ui-poc/pages/.

Applied to files:

  • ui-poc/Home.py
  • ui-poc/pages/Groups.py
📚 Learning: applies to ui-poc/pages/*.py : frontend poc application pages must be placed in ui-poc/pages/ as ind...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/pages/*.py : Frontend POC application pages must be placed in ui-poc/pages/ as individual Python files.

Applied to files:

  • ui-poc/Home.py
  • ui-poc/pages/Groups.py
📚 Learning: applies to ui-poc/pages/groups.py : api calls from the frontend should use retry logic as demonstrat...
Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/pages/Groups.py : API calls from the frontend should use retry logic as demonstrated in Groups.py.

Applied to files:

  • ui-poc/pages/Groups.py
🧬 Code Graph Analysis (3)
backend/tests/auth/test_auth_routes.py (1)
backend/app/auth/security.py (1)
  • verify_password (21-32)
backend/tests/auth/test_auth_service.py (2)
backend/app/auth/service.py (1)
  • _create_refresh_token_record (533-573)
backend/tests/conftest.py (1)
  • mock_db (65-96)
ui-poc/pages/Groups.py (1)
ui-poc/pages/Friends.py (1)
  • make_api_request (46-71)
🪛 YAMLlint (1.37.1)
.github/workflows/run-tests.yml

[error] 42-42: trailing spaces

(trailing-spaces)


[error] 48-48: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)

.codecov.yml

[error] 113-113: no new line character at the end of file

(new-line-at-end-of-file)

🪛 Ruff (0.12.2)
backend/app/expenses/routes.py

184-184: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


232-232: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


290-290: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


308-308: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


327-327: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


348-348: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


408-408: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


420-420: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


439-439: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


462-462: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)

backend/app/expenses/service.py

54-54: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


247-247: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


293-293: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)

ui-poc/Home.py

2-2: datetime.datetime imported but unused

Remove unused import: datetime.datetime

(F401)

ui-poc/pages/Groups.py

1077-1077: f-string without any placeholders

Remove extraneous f prefix

(F541)

🔇 Additional comments (17)
.codecov.yml (3)

16-18: LGTM - Coverage threshold adjustments align with PR objectives.

The changes to make coverage thresholds less strict (1.0 threshold, 70% target, if_not_found: success) are consistent across all sections and will improve CI reliability by preventing failures when coverage data is missing.

Also applies to: 21-24, 37-42, 50-55


60-60: Good path standardization.

Enclosing paths in quotes improves consistency and correctly targets backend components for coverage tracking.

Also applies to: 64-64, 68-68, 72-72, 76-79


94-100: Appropriate ignore patterns for frontend exclusion.

The added ignore patterns correctly exclude frontend directories and build artifacts, aligning with the removal of frontend testing from the CI workflow.

backend/tests/auth/test_auth_routes.py (3)

57-57: Good formatting consolidation.

Consolidating the verify_password call to a single line improves readability without changing functionality.


104-105: Consistent formatting improvements.

The consolidation of dictionary updates and login data to single lines maintains consistency with the formatting improvements across the codebase.

Also applies to: 234-234, 261-261


189-189: Clean assertion formatting.

Converting the user ID assertion to a single line improves code compactness while preserving the test logic.

backend/app/auth/routes.py (1)

47-47: Consistent timedelta formatting improvements.

Consolidating the timedelta calls to single lines across all authentication endpoints improves code readability and maintains consistency with the broader formatting improvements in this PR.

Also applies to: 83-83, 118-118, 151-151, 202-202

ui-poc/pages/Groups.py (2)

89-89: Good formatting consolidation throughout the file.

The formatting improvements consistently consolidate multi-line statements into single lines, improving code readability while maintaining functionality.

Also applies to: 106-106, 256-256, 261-261, 289-289, 360-360, 370-370


422-422: Consistent formatting in split calculation logic.

The formatting improvements in the expense splitting logic maintain readability while consolidating multi-line expressions.

Also applies to: 452-452, 458-458, 470-470, 477-477, 486-486

backend/tests/user/test_user_service.py (1)

167-167: Clean mock assertion formatting.

Consolidating the assert_called_once_with calls to single lines improves test readability while maintaining the same assertion logic and parameters.

Also applies to: 177-177, 277-277, 289-289

backend/tests/expenses/test_expense_service.py (1)

94-94: LGTM! Formatting improvements enhance readability.

The formatting changes consistently consolidate multi-line statements into single lines throughout the test file, improving code compactness without affecting test logic, assertions, or functionality.

Also applies to: 302-302, 319-319, 325-325, 398-398, 616-616, 723-723, 748-748, 761-761, 824-824, 884-884, 929-929, 994-994, 1081-1081, 1122-1122, 1235-1235, 1238-1238, 1261-1261, 1279-1279, 1318-1318, 1348-1348, 1368-1368, 1483-1483, 1637-1637, 1699-1699, 1785-1786, 1789-1790, 1793-1794, 1844-1844, 1875-1875, 1968-1968, 1986-1986, 1991-1991, 1993-1994, 2004-2006, 2032-2032, 2036-2036, 2060-2060

ui-poc/setup_test_data.py (1)

64-64: LGTM! Consistent formatting improvements.

The formatting changes consolidate multi-line statements into single lines, maintaining consistency with the broader formatting improvements across this PR. The changes enhance readability without affecting the test data generation functionality.

Also applies to: 210-210, 277-277, 304-304, 583-583

backend/tests/auth/test_auth_service.py (1)

140-140: LGTM: Improved code formatting consistency

The consolidation of multi-line monkeypatch.setattr and similar mock setup calls into single lines improves readability and maintains consistency with the rest of the codebase. These formatting changes don't affect test functionality.

Also applies to: 187-187, 241-241, 260-260, 281-281, 423-423, 471-471, 640-640, 679-679, 712-712

backend/app/expenses/routes.py (1)

170-170: LGTM: File extension extraction simplified

The consolidation of the file extension extraction logic improves readability without changing functionality.

ui-poc/Home.py (1)

163-163: LGTM: Improved formatting consistency

The consolidation of multi-line function calls improves code readability and maintains consistency across the frontend codebase.

Also applies to: 182-182, 196-196, 251-252

backend/app/expenses/service.py (2)

112-112: LGTM: Excellent formatting improvements

The consolidation of dictionary comprehensions, list comprehensions, and MongoDB queries significantly improves code readability while maintaining the same functionality. This creates a more consistent and professional codebase.

Also applies to: 116-116, 339-339, 353-353, 638-638, 795-795, 880-880, 963-963, 1008-1009, 1023-1023, 1038-1038, 1040-1040, 1121-1121, 1123-1123, 1192-1192, 1228-1228


446-446: LGTM: MongoDB query consolidation

The consolidation of the MongoDB query parameters improves readability without affecting functionality.

Comment on lines +68 to +70
working-directory: ./
override_branch: ${{ github.head_ref }}
override_commit: ${{ github.event.pull_request.head.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

working-directory is not a recognised input for codecov/codecov-action@v4
This key is ignored. If you want to scope the search, use the supported directory input or move the key outside of with: as a step-level working-directory.

-        working-directory: ./
+        directory: backend
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
working-directory: ./
override_branch: ${{ github.head_ref }}
override_commit: ${{ github.event.pull_request.head.sha }}
directory: backend
override_branch: ${{ github.head_ref }}
override_commit: ${{ github.event.pull_request.head.sha }}
🤖 Prompt for AI Agents
In .github/workflows/run-tests.yml around lines 68 to 70, the
`working-directory` key is incorrectly used as an input for the
`codecov/codecov-action@v4` action, but it is not a recognized input and will be
ignored. To fix this, remove `working-directory` from the `with:` section and
either use the supported `directory` input to scope the search or move
`working-directory` to be a step-level key outside of `with:`.

@Devasy Devasy self-assigned this Aug 2, 2025
@Devasy Devasy added this to Splitwiser Aug 2, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Splitwiser Aug 2, 2025
@Devasy Devasy moved this from Backlog to In review in Splitwiser Aug 2, 2025
@Devasy Devasy merged commit ddea2b5 into main Aug 2, 2025
19 of 34 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Splitwiser Aug 2, 2025
@Devasy Devasy deleted the fix/codecov-pytest branch August 2, 2025 08:34
@coderabbitai coderabbitai bot mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants