-
Notifications
You must be signed in to change notification settings - Fork 3
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
Max retry for exports #662
Conversation
WalkthroughThe recent changes to the QuickBooks Online application introduce a new function, Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
|
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: 0
Outside diff range, codebase verification and nitpick comments (2)
apps/workspaces/actions.py (1)
Update Function Calls to Include
interval_hours
ParameterThe
export_to_qbo
function is used in several places, but the newinterval_hours
parameter is not included in these calls. Ensure that all instances ofexport_to_qbo
are updated to match the new function signature.
- Files to update:
apps/workspaces/views.py
apps/workspaces/tasks.py
apps/fyle/tasks.py
Analysis chain
Line range hint
289-359
: LGTM! But verify the function usage in the codebase.The addition of the
interval_hours
parameter is consistent and correctly integrated into the scheduling function calls.However, ensure that all calls to
export_to_qbo
in the codebase correctly handle the newinterval_hours
parameter.Run the following script to verify the function usage:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `export_to_qbo` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python -A 5 $'export_to_qbo'Length of output: 68
Script:
#!/bin/bash # Description: Verify all function calls to `export_to_qbo` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type py -A 5 $'export_to_qbo'Length of output: 4565
apps/quickbooks_online/queue.py (1)
22-30
: Inconsistent timezone usage withdatetime.now()
.The use of
datetime.now()
is inconsistent across the codebase, with some instances usingtimezone.utc
and others not. This inconsistency could lead to timezone-related issues. It is recommended to review and standardize the usage ofdatetime.now()
withtimezone.utc
where appropriate.
- Consider reviewing the following files for timezone consistency:
tests/test_workspaces/test_views.py
tests/test_quickbooks_online/conftest.py
apps/workspaces/actions.py
apps/quickbooks_online/queue.py
Analysis chain
Verify timezone consistency.
The use of
datetime.now()
withtimezone.utc
should be consistent across the codebase to avoid timezone-related issues.Run the following script to verify timezone usage:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of timezone usage with `datetime.now()`. # Test: Search for `datetime.now()` usage. Expect: Consistent use of `timezone.utc`. rg --type python $'datetime.now()'Length of output: 66
Script:
#!/bin/bash # Description: Verify the consistency of timezone usage with `datetime.now()`. # Test: Search for `datetime.now()` usage. Expect: Consistent use of `timezone.utc`. rg 'datetime.now()'Length of output: 10286
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- apps/quickbooks_online/queue.py (10 hunks)
- apps/workspaces/actions.py (2 hunks)
- tests/test_quickbooks_online/test_tasks.py (5 hunks)
Additional comments not posted (10)
apps/quickbooks_online/queue.py (5)
Line range hint
33-54
: LGTM!The integration of
interval_hours
and error validation inschedule_bills_creation
is consistent and correctly implemented.
Line range hint
105-126
: LGTM!The integration of
interval_hours
and error validation inschedule_cheques_creation
is consistent and correctly implemented.
Line range hint
154-175
: LGTM!The integration of
interval_hours
and error validation inschedule_journal_entry_creation
is consistent and correctly implemented.
Line range hint
202-225
: LGTM!The integration of
interval_hours
and error validation inschedule_credit_card_purchase_creation
is consistent and correctly implemented.
Line range hint
254-275
: LGTM!The integration of
interval_hours
and error validation inschedule_qbo_expense_creation
is consistent and correctly implemented.tests/test_quickbooks_online/test_tasks.py (5)
1029-1029
: LGTM!The addition of the parameter in
test_schedule_credit_card_purchase_creation
aligns with the updated function signature.
1046-1046
: LGTM!The addition of the parameter in
test_schedule_bills_creation
aligns with the updated function signature.
1063-1063
: LGTM!The addition of the parameter in
test_schedule_cheques_creation
aligns with the updated function signature.
1080-1080
: LGTM!The addition of the parameter in
test_schedule_qbo_expense_creation
aligns with the updated function signature.
1097-1097
: LGTM!The addition of the parameter in
test_schedule_journal_entry_creation
aligns with the updated function signature.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #662 +/- ##
==========================================
- Coverage 94.99% 94.48% -0.51%
==========================================
Files 61 61
Lines 4716 4790 +74
==========================================
+ Hits 4480 4526 +46
- Misses 236 264 +28
|
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/quickbooks_online/queue.py (10 hunks)
- tests/test_quickbooks_online/test_tasks.py (6 hunks)
Files skipped from review as they are similar to previous changes (1)
- tests/test_quickbooks_online/test_tasks.py
Additional comments not posted (5)
apps/quickbooks_online/queue.py (5)
Line range hint
33-54
: LGTM!The function is correctly implemented with the new parameter and function call integrated properly.
The code changes are approved.
Line range hint
105-126
: LGTM!The function is correctly implemented with the new parameter and function call integrated properly.
The code changes are approved.
Line range hint
154-175
: LGTM!The function is correctly implemented with the new parameter and function call integrated properly.
The code changes are approved.
Line range hint
202-225
: LGTM!The function is correctly implemented with the new parameter and function call integrated properly.
The code changes are approved.
Line range hint
254-274
: LGTM!The function is correctly implemented with the new parameter and function call integrated properly.
The code changes are approved.
def validate_failing_export(is_auto_export: bool, interval_hours: int, error: Error): | ||
""" | ||
Validate failing export | ||
:param is_auto_export: Is auto export | ||
:param interval_hours: Interval hours | ||
:param error: Error | ||
""" | ||
# If auto export is enabled and interval hours is set and error repetition count is greater than 100, export only once a day | ||
return is_auto_export and interval_hours and error and error.repetition_count > 100 and datetime.now().replace(tzinfo=timezone.utc) - error.updated_at <= timedelta(hours=24) |
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.
Reminder: Add unit tests for validate_failing_export
.
The function is correctly implemented but lacks unit tests. Ensure to add unit tests to validate its behavior.
Do you want me to generate the unit testing code or open a GitHub issue to track this task?
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- tests/test_quickbooks_online/test_tasks.py (6 hunks)
Additional comments not posted (10)
tests/test_quickbooks_online/test_tasks.py (10)
1031-1031
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_credit_card_purchase_creation
.The code changes are approved, but verification is needed to ensure correctness.
1048-1048
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_bills_creation
.The code changes are approved, but verification is needed to ensure correctness.
1065-1065
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_cheques_creation
.The code changes are approved, but verification is needed to ensure correctness.
1082-1082
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_qbo_expense_creation
.The code changes are approved, but verification is needed to ensure correctness.
1099-1099
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_journal_entry_creation
.The code changes are approved, but verification is needed to ensure correctness.
1136-1136
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_bills_creation
.The code changes are approved, but verification is needed to ensure correctness.
1173-1173
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_journal_entry_creation
.The code changes are approved, but verification is needed to ensure correctness.
1209-1209
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_qbo_expense_creation
.The code changes are approved, but verification is needed to ensure correctness.
1249-1249
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_credit_card_purchase_creation
.The code changes are approved, but verification is needed to ensure correctness.
1285-1285
: Verify the additional parameter in the function call.Ensure that the additional parameter
1
aligns with the expected function signature and behavior ofschedule_cheques_creation
.The code changes are approved, but verification is needed to ensure correctness.
|
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- tests/test_quickbooks_online/test_tasks.py (6 hunks)
Additional comments not posted (7)
tests/test_quickbooks_online/test_tasks.py (7)
1031-1031
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_credit_card_purchase_creation
.
1048-1048
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_bills_creation
.
1065-1065
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_cheques_creation
.
1082-1082
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_qbo_expense_creation
.
1099-1099
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_journal_entry_creation
.
1128-1128
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_bills_creation
.
1164-1164
: Verify the correctness of the additional parameter.Ensure that the additional parameter
1
is correctly used in the function call toschedule_journal_entry_creation
.
* Max retry for exports * proper tests * remove loggers * remove loggers * flake resolved
Summary by CodeRabbit
New Features
Bug Fixes
Tests