-
Notifications
You must be signed in to change notification settings - Fork 24
Fix: Adjust Codecov thresholds and paths for backend coverage; improve frontend test handling #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e frontend test handling
❌ Deploy Preview for splitwizer failed. Why did it fail? →
|
WalkthroughThis update revises the Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is ❌ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this 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 unuseddatetimeimport
datetimeisn’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 lintersThe 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 debtFrontend step uses
codecov-action@v5while 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
📒 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-junitwrites to./junit.xmlunlessJEST_JUNIT_OUTPUTis set.
The workflow tries to uploadfrontend/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.
| 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 |
There was a problem hiding this comment.
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.
| 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.
…nt and ignore frontend directory; add setup.cfg for Flake8 configuration
…rontend test steps
for more information, see https://pre-commit.ci
There was a problem hiding this 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 configurationThere 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 keyfile– upload will be skipped
Codecov v4 expects the plural inputfiles. 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 chainingWhile 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 eApply 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 importThe
datetimeimport is not used in the file and should be removed as flagged by static analysis.- from datetime import datetimebackend/app/expenses/service.py (1)
54-54: Consider improving exception chainingSimilar 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 NoneAlso 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
📒 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.pybackend/app/auth/routes.pybackend/tests/user/test_user_service.pybackend/tests/auth/test_auth_service.pybackend/tests/expenses/test_expense_service.pybackend/app/expenses/routes.pybackend/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.pybackend/tests/user/test_user_service.pybackend/tests/auth/test_auth_service.pybackend/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.pybackend/app/expenses/routes.pybackend/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.pybackend/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.pybackend/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.pybackend/app/expenses/routes.pybackend/app/expenses/service.pyui-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.pybackend/app/expenses/routes.pybackend/app/expenses/service.pyui-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.pybackend/app/expenses/routes.pybackend/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.pyui-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.pyui-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_passwordcall 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
timedeltacalls 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_withcalls 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 consistencyThe consolidation of multi-line
monkeypatch.setattrand 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 simplifiedThe consolidation of the file extension extraction logic improves readability without changing functionality.
ui-poc/Home.py (1)
163-163: LGTM: Improved formatting consistencyThe 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 improvementsThe 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 consolidationThe consolidation of the MongoDB query parameters improves readability without affecting functionality.
| working-directory: ./ | ||
| override_branch: ${{ github.head_ref }} | ||
| override_commit: ${{ github.event.pull_request.head.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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:`.
… PEP 8 compliance
Summary by CodeRabbit