8000 Fix deployment and executions deletion by vermakhushboo · Pull Request #9660 · appwrite/appwrite · GitHub
[go: up one dir, main page]

Skip to content

Fix deployment and executions deletion 8000 #9660

Merged
Meldiron merged 3 commits intofeat-sitesfrom
fix-deployment-deletion
Apr 17, 2025
Merged

Fix deployment and executions deletion #9660
Meldiron merged 3 commits intofeat-sitesfrom
fix-deployment-deletion

Conversation

@vermakhushboo
Copy link
Contributor
@vermakhushboo vermakhushboo commented Apr 17, 2025

What does this PR do?

  • On deleting site or function, deployments of other site or function with the same resourceInternalId were also getting deleted. This PR adds resourceType in the deployment deletion query.
  • Function executions or site logs weren't getting deleted

Test Plan

Tested manually

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

Summary by CodeRabbit

  • Bug Fixes
    • Improved accuracy when deleting deployments by ensuring only those matching the specific resource type (site or function) are affected and that deletions occur in a consistent order.
    • Enhanced deletion of execution logs related to sites and functions for more precise and orderly cleanup.

@vermakhushboo vermakhushboo requested a review from Meldiron April 17, 2025 06:48
8000
@coderabbitai
Copy link
Contributor
coderabbitai bot commented Apr 17, 2025

Walkthrough

The update refines the deletion logic in the Deletes.php worker by adding explicit filtering on resourceType and specifying ascending order in queries for both deleteSite and deleteFunction methods. It also introduces deletion of execution logs related to sites, filtered by resourceInternalId and resourceType. The queries for deployments and executions now consistently filter by resource type ("site" or "function") and order results ascending to standardize and improve deletion accuracy.

Changes

File(s) Change Summary
src/Appwrite/Platform/Workers/Deletes.php Added resourceType filtering and ascending order to deployment and execution deletion queries in deleteSite and deleteFunction. Added new logic to delete site execution logs filtered by resourceInternalId and resourceType.

Poem

A bunny hopped through lines of code,
Filtering types to lighten the load.
Sites and functions, sorted with care,
Only the right ones vanish in air.
Ascending order, a tidy sweep—
Now the deployments can safely sleep!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad85fc6 and 93db0c3.

📒 Files selected for processing (1)
  • src/Appwrite/Platform/Workers/Deletes.php (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Appwrite/Platform/Workers/Deletes.php
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan

🪧 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this 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.

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.

@github-actions
Copy link
github-actions bot commented Apr 17, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
binutils 2.42-r0 CVE-2025-0840 HIGH
libexpat 2.6.4-r0 CVE-2024-8176 HIGH
libxml2 2.12.7-r0 CVE-2024-56171 HIGH
libxml2 2.12.7-r0 CVE-2025-24928 HIGH
libxml2 2.12.7-r0 CVE-2025-27113 HIGH
xz 5.6.2-r0 CVE-2025-31115 HIGH
xz-libs 5.6.2-r0 CVE-2025-31115 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@github-actions
Copy link
github-actions bot commented Apr 17, 2025

✨ Benchmark results

  • Requests per second: 852
  • Requests with 200 status code: 153,391
  • P99 latency: 0.222763879

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 852 1,136
200 153,391 204,604
P99 0.222763879 0.161824987

@vermakhushboo vermakhushboo changed the title Add resourceType query to deployment deletion Fix deployment and executions deletion Apr 17, 2025
@Meldiron Meldiron merged commit f1ff8dd into feat-sites Apr 17, 2025
32 checks passed
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

0