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

fix categories disable p0 bug #666

Merged
merged 5 commits into from
Sep 18, 2024
Merged

fix categories disable p0 bug #666

merged 5 commits into from
Sep 18, 2024

Conversation

Hrishabh17
Copy link
Contributor

@Hrishabh17 Hrishabh17 commented Sep 5, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced account synchronization to conditionally support category imports based on workspace settings.
  • Bug Fixes

    • Updated dependencies for improved stability and functionality.
  • Tests

    • Expanded test coverage for category disabling functionality to include new configuration options.

Copy link

coderabbitai bot commented Sep 5, 2024

Walkthrough

The changes involve modifications to the sync_accounts method in the utils.py file of the quickbooks_online application, introducing a boolean parameter to manage category import functionality based on workspace settings. Additionally, the requirements.txt file has been updated to newer versions of the fyle-accounting-mappings and fyle-integrations-platform-connector packages. The subproject commit identifier has also been updated, indicating a change in the version or state of that subproject. The test cases have been adjusted to accommodate the new parameter in the disable_categories function.

Changes

File Change Summary
apps/quickbooks_online/utils.py Modified sync_accounts method to include a new parameter is_import_to_fyle_enabled, which determines category import functionality based on settings.
fyle_integrations_imports Updated subproject commit identifier from 576dfd4678d4b9c0d261543c8b64a926c4e3ff83 to e4c2de5f794ad34382a1c53631443b7439c6d73f.
requirements.txt Updated fyle-accounting-mappings package version from 1.34.2 to 1.34.4 and fyle-integrations-platform-connector from 1.38.4 to 1.39.1.
tests/test_fyle_integrations_imports/test_modules/test_categories.py Modified test_disable_categories to include a new parameter is_import_to_fyle_enabled in the disable_categories function calls.

Possibly related PRs

  • add support for prepending code to COA #655: The changes in this PR also involve the apps/quickbooks_online/utils.py file, specifically enhancing the sync_accounts method, which is directly related to the modifications made in the main PR regarding account synchronization logic.
  • fix: improve response times of sync/refresh dimensions requests #661: This PR includes changes to the apps/quickbooks_online/views.py file, which may interact with the sync_accounts method in the main PR, as both are part of the synchronization process within the QuickBooks Online integration.

Poem

🐰 In the glade where the bunnies play,
New changes hop in, brightening the day.
With categories dancing, in sync they align,
Fyle's magic grows, oh how divine!
Let’s celebrate this leap, with a joyful cheer,
For every small change brings us near! 🌼✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between eae86c2 and e8fc760.

Files selected for processing (1)
  • fyle_integrations_imports (1 hunks)
Files skipped from review due to trivial changes (1)
  • fyle_integrations_imports

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>, please review it.
    -- Generate unit testing code for this file.
    • 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 generate unit testing code 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 and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @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.

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

Copy link

github-actions bot commented Sep 5, 2024

Tests Skipped Failures Errors Time
259 0 💤 4 ❌ 0 🔥 58.588s ⏱️

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e07a88b and ba563c1.

Files selected for processing (2)
  • apps/quickbooks_online/utils.py (2 hunks)
  • fyle_integrations_imports (1 hunks)
Files skipped from review due to trivial changes (1)
  • fyle_integrations_imports
Additional comments not posted (1)
apps/quickbooks_online/utils.py (1)

189-193: Review the handling of the new boolean parameter in sync_accounts.

The addition of is_category_import_to_fyle_enabled based on workspace settings and its usage in function calls within sync_accounts is a significant change. Here are a few points to consider:

  • Correctness: Ensure that the logic for setting is_category_import_to_fyle_enabled correctly reflects the intended functionality. The current implementation sets it based on general_settings.import_categories, which should be verified against the business logic.
  • Impact: This change impacts how accounts are synchronized based on category imports. It's crucial to verify that all dependent functionalities are updated to handle this new parameter.
  • Testing: Adding unit tests to cover these new scenarios is recommended to ensure that the changes do not break existing functionalities and meet the new requirements.

Consider adding the following tests:

  • Test with general_settings.import_categories set to True and False.
  • Test the function call that uses is_import_to_fyle_enabled to ensure it behaves as expected with both True and False values.

Also applies to: 260-261

Verification successful

The usage of is_category_import_to_fyle_enabled is correctly scoped.

The variable is_category_import_to_fyle_enabled is used exclusively within the sync_accounts method. It is initialized and set based on general_settings.import_categories, and then used as an argument in a function call. There are no other usages in the codebase, confirming that the impact is limited to this method and aligns with the intended functionality.

  • The logic for setting is_category_import_to_fyle_enabled is straightforward and correct.
  • The impact is confined to the sync_accounts method, with no external dependencies.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the usage of `is_category_import_to_fyle_enabled` in other parts of the codebase.
rg --type python -A 5 $'is_category_import_to_fyle_enabled'

Length of output: 89


Script:

#!/bin/bash
# Verify the usage of `is_category_import_to_fyle_enabled` in other parts of the codebase with the correct file type.
rg --type py -A 5 $'is_category_import_to_fyle_enabled'

Length of output: 1380

Copy link

github-actions bot commented Sep 5, 2024

Tests Skipped Failures Errors Time
259 0 💤 0 ❌ 0 🔥 48.525s ⏱️

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ba563c1 and 0ab619d.

Files selected for processing (3)
  • fyle_integrations_imports (1 hunks)
  • requirements.txt (1 hunks)
  • tests/test_fyle_integrations_imports/test_modules/test_categories.py (3 hunks)
Files skipped from review due to trivial changes (1)
  • requirements.txt
Files skipped from review as they are similar to previous changes (1)
  • fyle_integrations_imports
Additional comments not posted (1)
tests/test_fyle_integrations_imports/test_modules/test_categories.py (1)

507-507: Review the addition of the new parameter in disable_categories function calls.

The new parameter is_import_to_fyle_enabled=True has been added to the disable_categories function calls. This change is consistent across the calls at lines 507, 520, and 553. Ensure that the disable_categories function definition is updated to handle this new parameter correctly.

Also applies to: 520-520, 553-553

Copy link

github-actions bot commented Sep 9, 2024

Tests Skipped Failures Errors Time
259 0 💤 0 ❌ 0 🔥 43.031s ⏱️

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0ab619d and 533e623.

Files selected for processing (1)
  • requirements.txt (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • requirements.txt

@Hrishabh17 Hrishabh17 added the deploy Triggers deployment of active branch to Staging label Sep 17, 2024
@Hrishabh17 Hrishabh17 added deploy Triggers deployment of active branch to Staging and removed deploy Triggers deployment of active branch to Staging labels Sep 17, 2024
Copy link

Tests Skipped Failures Errors Time
259 0 💤 0 ❌ 0 🔥 52.475s ⏱️

@Hrishabh17 Hrishabh17 removed the deploy Triggers deployment of active branch to Staging label Sep 17, 2024
@Hrishabh17 Hrishabh17 added the deploy Triggers deployment of active branch to Staging label Sep 17, 2024
Copy link

Tests Skipped Failures Errors Time
259 0 💤 0 ❌ 0 🔥 58.918s ⏱️

@Hrishabh17 Hrishabh17 merged commit dd49956 into master Sep 18, 2024
4 checks passed
Hrishabh17 added a commit that referenced this pull request Sep 18, 2024
* fix categories disable p0 bug

* bump accounting_mapping version

* update accounting mapping version

* bump platform connector version

* update submodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy Triggers deployment of active branch to Staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants