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

Update delete workspace func #319

Merged
merged 2 commits into from
Mar 5, 2024
Merged

Conversation

ruuushhh
Copy link
Contributor

@ruuushhh ruuushhh commented Mar 5, 2024

Summary by CodeRabbit

  • Refactor
    • Improved the process for deleting workspaces, including better handling of related subscriptions and integrations.

@ruuushhh ruuushhh requested a review from ashwin1111 March 5, 2024 10:02
@ruuushhh ruuushhh self-assigned this Mar 5, 2024
@ruuushhh ruuushhh temporarily deployed to CI Environment March 5, 2024 10:02 — with GitHub Actions Inactive
@ruuushhh ruuushhh temporarily deployed to CI Environment March 5, 2024 10:02 — with GitHub Actions Inactive
Copy link

coderabbitai bot commented Mar 5, 2024

Warning

Rate Limit Exceeded

@ruuushhh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 32 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 1af4ec7 and 2e2d5a6.

Walkthrough

The recent update introduces an enhancement to the delete_workspace_v2 function, focusing on organizational ID management and notification processes. This revision incorporates the initialization of an _org_id variable, extraction of the _org_id from the workspaces table, and the implementation of notices for updates related to integrations and subscriptions.

Changes

File Path Change Summary
.../delete-workspace-v2.sql Added _org_id variable declaration, retrieval of _org_id, and notices for integration and subscription updates.

🐰✨
In the realm of code, where logic intertwines,
A rabbit hopped through, enhancing the lines.
With a flick and a hop, _org_id takes its place,
Notices flutter around, in a digital embrace.
"To improve is to change," the rabbit did cheer,
Leaving a trail of code, ever so clear. 🌟🐾

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.
    • 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 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 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 d73e3c3 and 1af4ec7.
Files selected for processing (1)
  • sql/functions/delete-workspace-v2.sql (2 hunks)
Additional comments: 3
sql/functions/delete-workspace-v2.sql (3)
  • 6-6: The declaration of _org_id as a new variable is a crucial addition for tracking the organization ID throughout the deletion process. This change aligns with the PR's objective to enhance the deletion functionality by ensuring accurate identification and utilization of the organization ID.
  • 202-202: Retrieving the _org_id from the workspaces table is a necessary step for the subsequent operations that depend on the organization ID. This retrieval is correctly placed before the deletion of workspace-related data, ensuring that the _org_id is available for use in notices and potentially other operations that require this information.
  • 210-215: The addition of notices for integration and subscription updates significantly enhances the transparency and traceability of the workspace deletion process. However, it's important to ensure that these notices are part of a controlled and secure operation, especially since they suggest manual intervention in different database contexts (integration_settings and prod databases). It's recommended to verify that the execution of these notices and the suggested queries do not expose sensitive information or introduce security vulnerabilities.

Copy link

github-actions bot commented Mar 5, 2024

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

1 similar comment
Copy link

github-actions bot commented Mar 5, 2024

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

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.53%. Comparing base (d73e3c3) to head (2e2d5a6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #319   +/-   ##
=======================================
  Coverage   94.53%   94.53%           
=======================================
  Files          60       60           
  Lines        3626     3626           
=======================================
  Hits         3428     3428           
  Misses        198      198           

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

sql/functions/delete-workspace-v2.sql Outdated Show resolved Hide resolved
sql/functions/delete-workspace-v2.sql Show resolved Hide resolved
@ruuushhh ruuushhh temporarily deployed to CI Environment March 5, 2024 17:14 — with GitHub Actions Inactive
Copy link

github-actions bot commented Mar 5, 2024

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

@ruuushhh ruuushhh merged commit 386b917 into master Mar 5, 2024
3 checks passed
Hrishabh17 pushed a commit that referenced this pull request Mar 8, 2024
* Update delete workspace func

* Fix comments
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