Skip to content
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

Added RetryException handler and bumped the sdk versions #306

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

Hrishabh17
Copy link
Contributor

@Hrishabh17 Hrishabh17 commented Feb 14, 2024

Please review.

Summary by CodeRabbit

  • New Features

    • Enhanced resilience of expense group creation and mapping processes by introducing retries on temporary failures.
  • Chores

    • Updated dependencies to improve performance and compatibility.

Copy link

Tests Skipped Failures Errors Time
144 0 💤 0 ❌ 0 🔥 59.835s ⏱️

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 94.53%. Comparing base (3d4d073) to head (3885c15).

Files Patch % Lines
apps/fyle/tasks.py 33.33% 4 Missing ⚠️
apps/mappings/exceptions.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #306      +/-   ##
==========================================
- Coverage   94.69%   94.53%   -0.16%     
==========================================
  Files          60       60              
  Lines        3618     3626       +8     
==========================================
+ Hits         3426     3428       +2     
- Misses        192      198       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

coderabbitai bot commented Feb 29, 2024

Walkthrough

This update introduces improved error handling by incorporating RetryException from the fyle.platform.exceptions in specific functions across two modules. Additionally, it updates the versions of fyle and fyle-integrations-platform-connector in the requirements.txt file, ensuring the application stays compatible with the latest changes in the Fyle platform.

Changes

File Path Change Summary
apps/fyle/tasks.py Added RetryException handling in async_create_expense_groups function.
apps/mappings/exceptions.py Added RetryException handling in new_fn function.
requirements.txt Updated fyle to 0.36.1 and fyle-integrations-platform-connector to 1.36.3.

🐇✨
In the realm of code, where exceptions fly,
A rabbit hopped in, with an eye so sly.
"Let's catch these errors," it said with a grin,
Updating and patching, from within.
With versions so new, and handling so fine,
Our code now resilient, like a sturdy pine.
🌟🐾

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?

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>.
    • Generate unit-tests for this file.
  • 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 generate unit tests for this file.
    • @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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3d4d073 and 3885c15.
Files selected for processing (3)
  • apps/fyle/tasks.py (2 hunks)
  • apps/mappings/exceptions.py (2 hunks)
  • requirements.txt (1 hunks)
Additional comments: 6
requirements.txt (2)
  • 20-20: The fyle SDK version has been updated from 0.35.0 to 0.36.1. Ensure that this version is compatible with the rest of the application and does not introduce any breaking changes.
  • 22-22: The fyle-integrations-platform-connector version has been updated from 1.36.1 to 1.36.3. Similar to the fyle SDK update, verify that this new version integrates smoothly with the application without causing any issues.
apps/mappings/exceptions.py (2)
  • 4-9: The import statement correctly includes RetryException from fyle.platform.exceptions. This is necessary for the new error handling logic introduced.
  • 46-49: The new except block for handling RetryException is a good addition for improving error resilience. Ensure that the handling logic, which logs the error and sets specific error details, aligns with the application's error management strategy.
apps/fyle/tasks.py (2)
  • 7-9: The import statement correctly includes RetryException from fyle.platform.exceptions, which is necessary for the new error handling logic introduced in async_create_expense_groups.
  • 153-157: The addition of RetryException handling in async_create_expense_groups is a positive step towards enhancing the application's resilience. Ensure that the handling logic, which logs the exception and updates the task log status to FATAL, is consistent with how the application should respond to retryable errors.

Copy link

Tests Skipped Failures Errors Time
160 0 💤 0 ❌ 0 🔥 1m 3s ⏱️

@Hrishabh17 Hrishabh17 merged commit 1554bf5 into master Feb 29, 2024
1 of 3 checks passed
Hrishabh17 added a commit that referenced this pull request Mar 5, 2024
* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Tax Group: refactored imports

* Resource Category: refactored imports

* Added RetryException handler and bumped the sdk versions (#306)

* Set tasks limit to 1L (#317)

* Set tasks limit to 1L

* set timeout

* Modified the import schedule creation condition

---------

Co-authored-by: ruuushhh <[email protected]>
Hrishabh17 added a commit that referenced this pull request Mar 8, 2024
* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Tax Group: refactored imports

* Resource Category: refactored imports

* Added RetryException handler and bumped the sdk versions (#306)

* Set tasks limit to 1L (#317)

* Set tasks limit to 1L

* set timeout

* Modified the import schedule creation condition

* Removed dead code, add few test cases, added script for adding new schedule for different workspaces

* Added post deploy sql script to dump old schedules and delete

---------

Co-authored-by: ruuushhh <[email protected]>
Hrishabh17 added a commit that referenced this pull request Mar 12, 2024
* Added integrations_imports submodule, made changes in settings (#310)

* Refactor imports for Project resource (#311)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Project: added cluster import, fixed minor typo, added new supplier field

* Refactor imports for project and cost_center (#314)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Project: added cluster import, fixed minor typo, added new supplier field

* Refactor imports costcenter (#312)

* Resource Cost_Center: refactored imports

* Refactor imports for Project resource (#311)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Project: added cluster import, fixed minor typo, added new supplier field

* Refactor imports custom expense (#313)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Project: added cluster import, fixed minor typo, added new supplier field

* Resource Tax Group: refactored imports (#315)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Project: added cluster import, fixed minor typo, added new supplier field

* Resource Tax Group: refactored imports

* Resource Tax Group: changed to is_auto_sync to False by default

* Resource Category: refactored imports (#316)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Tax Group: refactored imports

* Resource Category: refactored imports

* Resource Category: changed is_auto_sync_enabled to True by default

* Refactor imports supplier (#318)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Tax Group: refactored imports

* Resource Category: refactored imports

* Added RetryException handler and bumped the sdk versions (#306)

* Set tasks limit to 1L (#317)

* Set tasks limit to 1L

* set timeout

* Modified the import schedule creation condition

---------

Co-authored-by: ruuushhh <[email protected]>

* Refactor old flow (#321)

* Added integrations_imports submodule, made changes in settings

* Resource Project: Added new flow for the Project Import

* Typo Fix

* Resource Project: removed old import logic for Project

* Resource Cost_Center: refactored imports

* Resource Custom Expense Field: refactored imports

* Resource Tax Group: refactored imports

* Resource Category: refactored imports

* Added RetryException handler and bumped the sdk versions (#306)

* Set tasks limit to 1L (#317)

* Set tasks limit to 1L

* set timeout

* Modified the import schedule creation condition

* Removed dead code, add few test cases, added script for adding new schedule for different workspaces

* Added post deploy sql script to dump old schedules and delete

---------

Co-authored-by: ruuushhh <[email protected]>

* Merged changes from master

* Update delete workspace func (#319)

* Update delete workspace func

* Fix comments

* upate workspace last synced fix (#320)

* Modified the workflow for submodule

* Decreased the coverage to 88%

---------

Co-authored-by: ruuushhh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants