Skip to content

Comments

[WEB-2123] chore: hard delete favorites#5282

Merged
pablohashescobar merged 1 commit intopreviewfrom
chore/soft-delete-favorite
Aug 1, 2024
Merged

[WEB-2123] chore: hard delete favorites#5282
pablohashescobar merged 1 commit intopreviewfrom
chore/soft-delete-favorite

Conversation

@NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Jul 31, 2024

chore:

  • projects, views, and cycle module pages that are marked as favorites are hard deleted instead of being soft deleted.

Issue Link: WEB-2123

Summary by CodeRabbit

  • New Features

    • Enhanced deletion process for favorites across various entities (Cycles, Modules, Pages, Projects, and Views) to ensure permanent removal (hard delete) instead of soft deletion.
  • Bug Fixes

    • Resolved inconsistency in deletion logic for favorite entities, improving data integrity and user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2024

Walkthrough

The recent changes across various modules involve modifications to the destroy method, specifically altering the deletion logic for favorite entities. All updates transition from a default soft delete to a hard delete by specifying soft=False in the delete method calls. This adjustment ensures that deleted favorites are permanently removed from the database, enhancing data integrity and retrieval processes.

Changes

Files and Directories Change Summary
apiserver/plane/app/views/cycle/base.py Updated destroy method to call cycle_favorite.delete(soft=False) for hard deletion.
apiserver/plane/app/views/module/base.py Changed destroy to invoke module_favorite.delete(soft=False), enforcing hard deletion of module favorites.
apiserver/plane/app/views/page/base.py Modified destroy to use page_favorite.delete(soft=False), resulting in permanent deletion of page favorites.
apiserver/plane/app/views/project/base.py Altered destroy to call project_favorite.delete(soft=False), ensuring hard deletion of project favorites.
apiserver/plane/app/views/view/base.py Changed destroy to specify view_favorite.delete(soft=False), making deletion permanent for view favorites.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant API
    participant Database

    User->>API: Request to delete favorite
    API->>Database: Call delete(favorite_id, soft=False)
    Database-->>API: Confirm deletion
    API-->>User: Respond with success message
Loading

Poem

🐰 In the world of code, swift and bright,
Favorites once hidden, now take flight!
With a hop and a skip, they’re gone for good,
No more soft shadows, just like we should.
Hard deletions dance in the night,
Data stays tidy, all feels just right! 🌟


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 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 show all the console.log statements in this repository.
    • @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 as 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.

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

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
Contributor

@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 daaa04c and 049b96e.

Files selected for processing (5)
  • apiserver/plane/app/views/cycle/base.py (1 hunks)
  • apiserver/plane/app/views/module/base.py (1 hunks)
  • apiserver/plane/app/views/page/base.py (1 hunks)
  • apiserver/plane/app/views/project/base.py (1 hunks)
  • apiserver/plane/app/views/view/base.py (1 hunks)
Additional comments not posted (5)
apiserver/plane/app/views/view/base.py (1)

477-477: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to view_favorite.delete match the new behavior.

Verification successful

Verified: All function calls to view_favorite.delete match the new behavior.

The code changes are approved, and the function usage is consistent with the new behavior.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `view_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg --type python -A 5 $'view_favorite.delete'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `view_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg -t py -A 5 'view_favorite.delete'

Length of output: 214

apiserver/plane/app/views/page/base.py (1)

404-404: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to page_favorite.delete match the new behavior.

Verification successful

Verified: The function page_favorite.delete is used only once in the codebase, and it correctly matches the new behavior with soft=False.

  • apiserver/plane/app/views/page/base.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `page_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg --type python -A 5 $'page_favorite.delete'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `page_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg -A 5 'page_favorite.delete'

Length of output: 429

apiserver/plane/app/views/project/base.py (1)

602-602: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to project_favorite.delete match the new behavior.

apiserver/plane/app/views/module/base.py (1)

843-843: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to module_favorite.delete match the new behavior.

Verification successful

Function usage verified

The module_favorite.delete function usage in the codebase matches the new behavior with soft=False.

  • apiserver/plane/app/views/module/base.py:843
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `module_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg --type python -A 5 $'module_favorite.delete'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `module_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg -A 5 $'module_favorite.delete'

Length of output: 458

apiserver/plane/app/views/cycle/base.py (1)

1157-1157: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to cycle_favorite.delete match the new behavior.

Verification successful

Function usage verified successfully.

The only instance of cycle_favorite.delete in the codebase correctly uses soft=False.

  • apiserver/plane/app/views/cycle/base.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `cycle_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg --type python -A 5 $'cycle_favorite.delete'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `cycle_favorite.delete` match the new behavior.

# Test: Search for the function usage. Expect: Only occurrences of the new behavior.
rg --type py -A 5 $'cycle_favorite.delete'

Length of output: 458

@pablohashescobar pablohashescobar merged commit b381331 into preview Aug 1, 2024
@pablohashescobar pablohashescobar deleted the chore/soft-delete-favorite branch August 1, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants