8000 Feat: Active deployment details - status, creation date by Meldiron · Pull Request #9534 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat: Active deployment details - status, creation date #9534

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

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

Meldiron
Copy link
Contributor
@Meldiron Meldiron commented Mar 18, 2025

What does this PR do?

Adds site attributes about active deploymed nessessray for new iteration of sites screens

Test Plan

Tests updated

Related PRs and Issues

x

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

  • New Features
    • Enhanced deployment tracking: Deployment-related responses now include an additional field for the creation timestamp (deploymentCreatedAt). This update provides clearer insights into deployment activities across the platform, offering users more detailed information on the state and timing of their deployments.

8000
Copy link
coderabbitai bot commented Mar 18, 2025

Walkthrough

This update introduces a new attribute, deploymentCreatedAt, to various components of the codebase, including project configurations, deployment handling classes, response models, and end-to-end tests. The deploymentCreatedAt attribute captures the creation timestamp of deployments and is integrated into document update and delete operations. Additionally, tests have been enhanced to validate the presence and correctness of this new attribute in deployment responses.

Changes

File(s) Change Summary
app/config/collections/projects.php Added deploymentCreatedAt (datetime, default null, with datetime filter) attribute to the deployments configuration.
src/Appwrite/Platform/Modules/Functions/Http/{Deployments/Delete.php, Functions/Deployment/Update.php}
src/Appwrite/Platform/Modules/Functions/Workers/Builds.php
Updated function deployment processes to include deploymentCreatedAt in document update operations.
src/Appwrite/Platform/Modules/Sites/Http/{Deployments/Delete.php, Sites/Deployment/Update.php} Enhanced site deployment update operations by including deploymentCreatedAt in the data merged into site documents.
src/Appwrite/Utopia/Response/Model/{Func.php, Site.php} Added new validation rules for deploymentCreatedAt in the function and site response models.
tests/e2e/Services/{Functions/FunctionsCustomServerTest.php, Sites/SitesCustomServerTest.php} Introduced additional assertions to verify that the deploymentCreatedAt attribute is correctly set and matches between responses and deployment operations.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant DeploymentService
    participant Database

    Client->>+Controller: Request deployment update
    Controller->>+DeploymentService: Retrieve deployment attributes
    DeploymentService-->>-Controller: Return deploymentCreatedAt
    Controller->>+Database: Update document with new attribute
    Database-->>-Controller: Confirm update
    Controller-->>-Client: Send response with updated deployment info
Loading

Possibly related PRs

Suggested reviewers

  • vermakhushboo

Poem

I hopped through code with nimble feet,
Adding fields to make our systems complete.
Deployment dates now shine so bright,
With timestamps dancing in the light.
A joyful trot—a coder’s treat,
From CodeRabbit’s burrow, oh so sweet! 🥕
Celebrate these changes, crisp and neat!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 7cade1a and 362520f.

📒 Files selected for processing (10)
  • app/config/collections/projects.php (2 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (2 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Func.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Site.php (1 hunks)
  • tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1 hunks)
  • tests/e2e/Services/Sites/SitesCustomServerTest.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/Appwrite/Utopia/Response/Model/Site.php
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php
  • src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php
  • app/config/collections/projects.php
  • src/Appwrite/Utopia/Response/Model/Func.php
  • src/Appwrite/Platform/Modules/Functions/Workers/Builds.php
  • tests/e2e/Services/Sites/SitesCustomServerTest.php
🧰 Additional context used
🧬 Code Definitions (1)
tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1)
tests/e2e/Services/Functions/FunctionsBase.php (1) (1)
  • getFunction (150:158)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan
🔇 Additional comments (1)
tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1)

496-501: Well-structured assertions for the deploymentCreatedAt field

These assertions properly validate the newly added deploymentCreatedAt field, ensuring it exists and matches the deployment's creation timestamp. The code is clean, follows the project's testing pattern, and verifies both the presence and correctness of the field.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

Copy link
github-actions bot commented Mar 18, 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

Source Code Scan Results

🎉 No vulnerabilities found!

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

🧹 Nitpick comments (1)
src/Appwrite/Utopia/Response/Model/Site.php (1)

67-72: Fix duplicate value in deploymentStatus description

The description for deploymentStatus has a duplicate "waiting" value in the list of possible values.

-                'description' => 'Active deployment status. Possible values are "waiting", "processing", "building", "waiting", "ready", and "failed".',
+                'description' => 'Active deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed".',
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 20d90e0 and 7cade1a.

📒 Files selected for processing (10)
  • app/config/collections/projects.php (2 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (2 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Func.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Site.php (1 hunks)
  • tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1 hunks)
  • tests/e2e/Services/Sites/SitesCustomServerTest.php (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
tests/e2e/Services/Sites/SitesCustomServerTest.php (1)
tests/e2e/Services/Sites/SitesBase.php (1) (1)
  • getSite (161:169)
tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1)
tests/e2e/Services/Functions/FunctionsBase.php (1) (1)
  • getFunction (150:158)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Setup & Build Appwrite Image
🔇 Additional comments (14)
src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php (1)

105-106: Added new deployment tracking fields in site reset.

These new fields deploymentStatus and deploymentCreatedAt are properly reset to empty strings when a deployment is deleted, consistent with how other deployment attributes are handled.

src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php (1)

95-96: Added deployment status and creation date tracking to site documents.

The new fields properly capture the deployment's status and creation timestamp when updating a site's active deployment. This enhances the site document with important metadata about the active deployment.

src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php (1)

96-97: Added deployment status and creation date tracking to function documents.

The implementation mirrors the changes in the Sites module, ensuring consistency across the codebase. The status and creation date fields enhance the function document with valuable metadata about the active deployment.

tests/e2e/Services/Functions/FunctionsCustomServerTest.php (1)

496-503: Added test assertions for new deployment fields.

Great test coverage for the new deployment attributes! The assertions properly verify both the presence of the new fields (deploymentStatus and deploymentCreatedAt) and ensure their values match the expected data from the deployment response.

src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php (1)

103-104: Adds deployment status tracking to function reset operations

The addition of deploymentStatus and deploymentCreatedAt attributes completes the deployment information reset when a function's active deployment is removed, ensuring consistency with other deployment metadata.

tests/e2e/Services/Sites/SitesCustomServerTest.php (1)

370-377: Enhances test coverage for new deployment attributes

Good additions to validate that the site correctly reflects the deployment's status and creation time. These assertions ensure the new attributes are properly propagated from deployments to sites.

src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (2)

871-872: Propagates deployment status and creation date to function object

These additions properly update the function with the active deployment's status and creation timestamp when activating a deployment, providing valuable metadata for API consumers.


905-906: Propagates deployment status and creation date to site object

Similar to the function implementation, these lines ensure site objects maintain the same information about their active deployments. The consistent implementation across both functions and sites is a good pattern.

src/Appwrite/Utopia/Response/Model/Func.php (1)

74-85: Adds model definitions for new deployment attributes

Well-documented rule definitions for the new attributes. The description for deploymentStatus clearly lists all possible values, which is helpful for API consumers. The types, defaults, and examples are appropriate for these fields.

src/Appwrite/Utopia/Response/Model/Site.php (1)

61-66: Looks good: deploymentCreatedAt field added

The new deploymentCreatedAt field is properly implemented with the correct type, description, and default values, following the established pattern in the codebase.

app/config/collections/projects.php (4)

582-592: Looks good: deploymentStatus attribute for functions collection

The deploymentStatus attribute has been properly added to the functions collection schema with appropriate type, size, and default value.


593-603: Looks good: deploymentCreatedAt attribute for functions collection

The deploymentCreatedAt attribute has been properly added to the functions collection schema with the datetime type and filter.


1028-1038: Looks good: deploymentStatus attribute for sites collection

The deploymentStatus attribute has been properly added to the sites collection schema with consistent structure matching the functions collection definition.


1039-1049: Looks good: deploymentCreatedAt attribute for sites collection

The deploymentCreatedAt attribute has been properly added to the sites collection schema with the datetime type and filter, consistent with the functions collection.

Copy link

✨ Benchmark results

  • Requests per second: 963
  • Requests with 200 status code: 173,408
  • P99 latency: 0.191116453

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 963 1,259
200 173,408 226,704
P99 0.191116453 0.146947183

'$id' => ID::custom('deploymentCreatedAt'),
'type' => Database::VAR_DATETIME,
'format' => '',
'size' => 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the size 0?

@Meldiron Meldiron merged commit 9637606 into feat-sites Mar 18, 2025
81 of 83 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Mar 20, 2025
3 tasks
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