8000 Update: specs by ItzNotABug · Pull Request #9663 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update: specs #9663

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 1 commit into from
Apr 17, 2025
Merged

Update: specs #9663

merged 1 commit into from
Apr 17, 2025

Conversation

ItzNotABug
Copy link
Member
@ItzNotABug ItzNotABug commented Apr 17, 2025

What does this PR do?

Regenerates the specs for Console SDK for CSV Imports on Console.

docker compose exec -T appwrite specs

Related - #9662

Test Plan

N/A.

Related PRs and Issues

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?

@ItzNotABug ItzNotABug self-assigned this Apr 17, 2025
Copy link
coderabbitai bot commented Apr 17, 2025

Walkthrough

The changes focus on updating OpenAPI and Swagger specification files for various Appwrite API variants. The primary modifications include adding or enhancing descriptive text for many API endpoint descriptions, clarifying their purpose and usage. Numerous endpoint "weight" metadata values are incremented, likely to adjust ordering or priority. Notably, a new POST endpoint /migrations/csv is introduced in the console specifications, enabling CSV-based document imports into the database. Additionally, usage metrics schemas for functions and sites are extended with new fields to track function build successes and failures, as well as related metrics. No changes are made to core API logic, parameters, or response structures.

Changes

File(s) Change Summary
app/config/specs/open-api3-latest-client.json, app/config/specs/swagger2-latest-client.json Enhanced descriptions and incremented weights for function execution and messaging subscriber endpoints. No structural or parameter changes.
app/config/specs/open-api3-latest-server.json, app/config/specs/swagger2-latest-server.json Added detailed descriptions to endpoints across functions, sites, and messaging; incremented weights for many endpoints. No changes to endpoint structure or parameters.
app/config/specs/open-api3-latest-console.json, app/config/specs/swagger2-latest-console.json Added a new POST endpoint /migrations/csv for importing documents from CSV files. Extended usage metrics schemas for functions and sites to include build success/failure and execution metrics. Added or improved descriptions for many endpoints and incremented their weights. Added resourceId property to migration schema. Corrected and clarified descriptions for metrics. No changes to endpoint parameters or response schemas outside of these additions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Appwrite Console API

    Client->>Appwrite Console API: POST /migrations/csv (bucketId, fileId, resourceId)
    Appwrite Console API-->>Client: 202 Accepted + Migration object
Loading

Poem

🐇
In the warren of endpoints, new tales unfold,
Descriptions now shimmer, their meanings retold.
A CSV migration hops in with glee,
Tracking builds and executions for all to see.
Weights shift gently, like carrots in a row—
Documentation grows, and metrics overflow!
Hop, hop, hooray—API clarity on display!

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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

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

@ItzNotABug ItzNotABug requested a review from Meldiron April 17, 2025 11:37
Copy link

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!

Copy link
pkg-pr-new bot commented Apr 17, 2025

Open in StackBlitz

npm i https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@9663

commit: b158c4d

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 (5)
app/config/specs/open-api3-latest-console.json (2)

18029-18107: Review new CSV migration endpoint
The /migrations/csv POST endpoint is a valuable addition. Two suggestions:

  1. The resourceId x‑example uses "[ID1:ID2]"; please remove the brackets and match the schema description (databaseId:collectionId).
  2. Consider adding an error response schema (e.g., 400/422) to document validation failures on malformed CSV or missing resources.

41898-41902: Refine: resourceId in migration schema
The resourceId description in the global migration schema is generic. To avoid confusion, unify this with the requestBody docs by clarifying it’s a composite ID in the format databaseId:collectionId.

Also applies to: 41928-41932

app/config/specs/swagger2-latest-console.json (3)

10201-10202: Grammar nitpick: missing article
In the description:

"Use this endpoint to switch the code deployment that should be used when visitor opens your function."

Insert “a” before “visitor”:

-"when visitor opens"
+"when a visitor opens"

This reads more naturally.


24718-24719: Grammar correction: remove extra “for”
Current text:

"Create a new proxy rule for to redirect from custom domain to another domain."

Should be:

-"for to redirect"
+"to redirect"

This fixes the redundant “for”.


24736-24737: Consistency: lowercase function naming
The phrase “Appwrite Function” may read better as “Appwrite function” or “an Appwrite Function”:

-"executing Appwrite Function"
+"executing an Appwrite Function"

Align casing with other docs.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a2c774d and b158c4d.

📒 Files selected for processing (6)
  • app/config/specs/open-api3-latest-client.json (8 hunks)
  • app/config/specs/open-api3-latest-console.json (185 hunks)
  • app/config/specs/open-api3-latest-server.json (138 hunks)
  • app/config/specs/swagger2-latest-client.json (8 hunks)
  • app/config/specs/swagger2-latest-console.json (196 hunks)
  • app/config/specs/swagger2-latest-server.json (140 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Console SDK
  • GitHub Check: scan
🔇 Additional comments (31)
app/config/specs/open-api3-latest-server.json (2)

8124-18809: Comprehensive documentation improvements
You’ve added or enhanced description fields for dozens of endpoints under the functions, sites, and messaging-related tags, providing clear guidance on each operation’s purpose, parameters, and usage. These additions greatly improve the readability and developer experience of the API spec.


8139-18817: Consistent weight adjustments across endpoints
All weight values have been uniformly incremented to rebalance endpoint ordering. Please verify that these changes align with the updates in the client and console spec files to maintain consistency across your documentation and ensure no unintended gaps or duplicates in ordering.

app/config/specs/swagger2-latest-server.json (2)

8274-19314: Approve added endpoint descriptions
The new description fields for functions, sites, and provider endpoints are well‑written, informative, and consistent with the existing documentation style. They clearly explain each operation’s purpose, parameters, and usage.


8285-19325: Verify weight metadata updates
Multiple x-appwrite.weight values have been incremented throughout the spec. Please ensure these adjustments maintain the intended ordering and priority across all endpoints. Consider running a quick script to audit the full sequence for gaps or duplicates.

app/config/specs/open-api3-latest-client.json (8)

4751-4751: Clear description improvement for function execution listing

The added description clearly explains the purpose of this endpoint, which is to get a list of function execution logs for the current user, and mentions the ability to filter results using query parameters.


4766-4766: Weight attribute update for function listing endpoint

The weight attribute for the functionsListExecutions endpoint has been incremented to 384. This likely adjusts the ordering or priority of this endpoint in the API documentation or client SDKs.


4825-4825: Enhanced description for function execution triggering

The added description provides clear information about how to trigger a function execution asynchronously, explaining that the returned object contains the execution status and that users can check the status through the Get Execution endpoint.


4840-4840: Weight attribute update for function creation endpoint

The weight attribute for the functionsCreateExecution endpoint has been incremented to 382. This metadata change adjusts the ordering or priority of this endpoint in generated documentation or SDKs.


4939-4939: Improved description for getting execution logs

The added description succinctly explains that this endpoint retrieves a function execution log by its unique ID, which clarifies the purpose and usage of the endpoint.


4954-4954: Weight attribute update for execution retrieval endpoint

The weight attribute for the functionsGetExecution endpoint has been incremented to 383. This adjusts the ordering or priority of this endpoint in the API documentation or client SDKs.


5537-5537: Weight attribute update for subscriber creation endpoint

The weight attribute for the messagingCreateSubscriber endpoint has been incremented to 349. This is a metadata change that likely affects the ordering of operations in the documentation or SDKs.


5619-5619: Weight attribute update for subscriber deletion endpoint

The weight attribute for the messagingDeleteSubscriber endpoint has been incremented to 353. This is a metadata change that adjusts the ordering or priority of this endpoint.

app/config/specs/swagger2-latest-client.json (8)

4921-4921: Improved function execution documentation

The description clarifies that this endpoint retrieves function execution logs, making it more intuitive for developers.


4932-4932: Updated weight value for proper endpoint ordering

The weight attribute has been increased to 384, which affects how this endpoint is ordered in documentation and UI. This is a metadata change with no functional impact.


4994-4994: Enhanced createExecution description for clarity

The updated description now better explains the asynchronous nature of function executions, highlighting that the execution process starts asynchronously after this endpoint is called and that users can check execution status through the Get Execution endpoint.


5005-5005: Updated weight value for consistent endpoint ordering

The weight attribute has been increased to 382, maintaining proper ordering in API documentation and generated clients.


5112-5112: Improved getExecution description for clarity

The description now explicitly states that this endpoint retrieves a function execution log by its unique ID, making the purpose of the endpoint more clear.


5123-5123: Updated weight value for proper endpoint ordering

The weight value has been increased to 383, ensuring correct placement in documentation and API clients.


5764-5764: Updated weight for messagingCreateSubscriber endpoint

The weight attribute for this messaging endpoint has been increased to 349, ensuring consistent ordering in API documentation.


5848-5848: Updated weight for messagingDeleteSubscriber endpoint

The weight attribute for this messaging endpoint has been increased to 353, ensuring consistent ordering in API documentation.

app/config/specs/open-api3-latest-console.json (6)

4349-4357: Approve: Added description and updated weight for getResource endpoint
The new description clearly explains the endpoint’s purpose. The weight increment is consistent with console ordering and aligns with adjacent endpoints.


9039-9055: Approve: Enhanced description and adjusted weight for listing functions
The description now guides users on how to filter results via query params, and the updated weight matches the expected ordering under the “functions” tag.


9108-9127: Approve: Clarified description and weight for function creation
The expanded description (including permissions link) is helpful for integrators, and the weight bump positions this endpoint correctly in the console UI.


39991-40104: Verify: UsageFunctions schema extensions
You’ve added buildsSuccessTotal, buildsFailedTotal, buildsSuccess, buildsFailed, and buildsTimeAverage with corresponding required entries. Please ensure:

  • Client and server specs mirror these additions.
  • Generated SDKs and validation layers include the new metrics.
  • Integration tests cover these new fields.

Also applies to: 40129-40301


40347-40518: Verify: UsageSites schema extensions
The console spec now tracks executionsTotal, executionsTimeTotal, executionsMbSecondsTotal, and function build metrics (buildsSuccessTotal, buildsFailedTotal, etc.). Confirm that downstream schemas (client, server) and codegen are updated accordingly, and that sample responses in docs reflect the new properties.

Also applies to: 40521-40800


4346-26799: Bulk approve: Description and weight updates across other endpoints
All other description enhancements and weight metadata increments under the “functions,” “sites,” “proxy,” “messages,” and related tags appear consistent, grammatically correct, and improve discoverability in the console UI.

app/config/specs/swagger2-latest-console.json (5)

4558-4558: Descriptions added or enhanced: ensure style consistency
The new "description" fields are clear and informative. Please verify that all endpoint descriptions:

  • Start with an imperative verb in present tense.
  • End with a period.
  • Avoid personal pronouns (we, you).
  • Use consistent terminology (e.g., “List”, “Get”, “Create”).
    This will keep the console spec aligned with Appwrite’s documentation guidelines.

Also applies to: 9192-9192, 9263-9263, 9513-9513, 9563-9563, 9614-9614, 9624-9624, 9709-9709, 9719-9719, 9768-9768, 9778-9778, 9839-9839, 9849-9849, 9897-9897, 9907-9907, 10144-10144, 10153-10153, 10201-10201, 10211-10211, 10279-10279, 10289-10289, 10358-10358, 10368-10368, 10449-10449, 10459-10459, 10533-10533, 10543-10543, 10638-10638, 10648-10648, 10735-10735, 10745-10745, 10799-10799, 10809-10809, 10864-10864, 10874-10874, 10949-10949, 10959-10959, 11017-11017, 11027-11027, 11090-11090, 11100-11100, 11208-11208, 11218-11218, 11275-11275, 11283-11283, 11340-11340, 11350-11350, 11419-11419, 11429-11429, 11477-11477, 11487-11487, 11568-11568, 11578-11578, 11634-11634, 11644-11644, 11728-11728, 11736-11736, 13718-13718, 13794-13794, 13949-13949, 14103-14103, 14297-14297, 14490-14490, 14607-14607, 14722-14722, 14776-14776, 14837-14837, 14910-14910, 14983-14983, 15057-15057, 15171-15171, 15283-15283, 15373-15373, 15461-15461, 15587-15587, 15711-15711, 15813-15813, 15913-15913, 16027-16027, 16139-16139, 16297-16297, 16452-16452, 16554-16554, 16654-16654, 16756-16756, 16856-16856, 16958-16958, 17058-17058, 17160-17160, 17260-17260, 17314-17314, 17375-17375, 17521-17521, 17593-17593, 17682-17682, 17819-17819, 17880-17880, 17953-17953, 18033-18033, 18122-18122, 18184-18184, 18256-18256, 18487-18487


18486-18569: New /migrations/csv endpoint: looks correct
Great job adding summary, operationId, payload schema, and full x-appwrite metadata (including demo/edit links, rate-limiting, auth). Confirm:

  • The #\/definitions\/migration schema matches other spec variants.
  • The example markdown files exist at the given paths.
  • Permissions (scope: migrations.write) are accurate.
    Otherwise, this endpoint is ready to ship.

40613-40734: New usage metrics fields: ensure cross‑spec consistency
You’ve introduced buildsSuccessTotal, buildsFailedTotal, buildsSuccess, buildsFailed, buildsTimeAverage, executionsMbSeconds, etc., in usageFunctions, usageFunction, usageSites, usageSite. Please verify:

  1. These fields are added in the OpenAPI 3 versions and client SDK specs.
  2. Field names and formats (int32, arrays of metric) match across all variants.
    A quick grep or ast-grep across app/config/specs can confirm alignment.

Also applies to: 40916-41117, 41337-41469


42585-42589: New resourceId in usageProject schema: correct inclusion
Adding resourceId to identify the migrated collection is a good enhancement. You’ve included it in the required array—please confirm that downstream code that unmarshals this schema expects this field. Otherwise, this change aligns well with the new CSV migration endpoint.

Also applies to: 42620-42621


4566-4566:

❓ Verification inconclusive

Weight metadata incremented: please verify uniqueness and ordering
It appears every endpoint’s x-appwrite.weight has been bumped up by one. Ensure:

  1. No two endpoints now share the same weight.
  2. The overall ordering (UI grouping) remains correct.
    You can run:

to detect any duplicate weights.

Also applies to: 9193-9193, 9263-9263, 9274-9274, 9513-9513, 9524-9524, 9563-9563, 9574-9574, 9614-9614, 9624-9624, 9709-9709, 9719-9719, 9768-9768, 9778-9778, 9839-9839, 9849-9849, 9897-9897, 9907-9907, 10144-10144, 10153-10153, 10201-10201, 10211-10211, 10279-10279, 10289-10289, 10358-10358, 10368-10368, 10449-10449, 10459-10459, 10533-10533, 10543-10543, 10638-10638, 10648-10648, 10735-10735, 10745-10745, 10799-10799, 10809-10809, 10864-10864, 10874-10874, 10949-10949, 10959-10959, 11017-11017, 11027-11027, 11090-11090, 11100-11100, 11208-11208, 11218-11218, 11275-11275, 11283-11283, 11340-11340, 11350-11350, 11419-11419, 11429-11429, 11477-11477, 11487-11487, 11568-11568, 11578-11578, 11634-11634, 11644-11644, 11728-11728, 11736-11736, 13718-13718, 13794-13794, 13949-13949, 14103-14103, 14297-14297, 14490-14490, 14607-14607, 14722-14722, 14776-14776, 14837-14837, 14910-14910, 14983-14983, 15057-15057, 15171-15171, 15283-15283, 15373-15373, 15461-15461, 15587-15587, 15711-15711, 15813-15813, 15913-15913, 16027-16027, 16139-16139, 16297-16297, 16452-16452, 16554-16554, 16654-16654, 16756-16756, 16856-16856, 16958-16958, 17058-17058, 17160-17160, 17260-17260, 17314-17314, 17375-17375, 17521-17521, 17593-17593, 17682-17682, 17819-17819, 17880-17880, 17953-17953, 18033-18033, 18122-18122, 18184-18184, 18256-18256, 18487-18487


🏁 Script executed:

jq -r '.paths | .. | .["x-appwrite"]?["weight"]' app/config/specs/swagger2-latest-console.json \
  | sort | uniq -d

Length of output: 118


#!/bin/bash
# Check for duplicate numeric weights only
jq -r '.paths | .. | .["x-appwrite"]?["weight"] | select(type=="number")' app/config/specs/swagger2-latest-console.json \
  | sort \
  | uniq -d

🏁 Script executed:

#!/usr/bin/env bash
# Detect duplicate numeric weights only
jq -r '.paths | .. | .["x-appwrite"]?["weight"] | select(type == "number")' app/config/specs/swagger2-latest-console.json \
  | sort \
  | uniq -d

Length of output: 140


No duplicate x-appwrite.weight values detected
A numeric‑only check across all endpoints returned no duplicates, confirming each weight is unique.
• Please manually verify that the UI grouping and ordering reflect the intended increments and remain correct.

@Meldiron Meldiron merged commit 61868a9 into 1.7.x Apr 17, 2025
36 checks passed
Copy link

✨ Benchmark results

  • Requests per second: 922
  • Requests with 200 status code: 166,010
  • P99 latency: 0.203618236

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 922 1,198
200 166,010 215,689
P99 0.203618236 0.155917301

@ItzNotABug ItzNotABug deleted the update-specs branch April 17, 2025 13:15
@coderabbitai coderabbitai bot mentioned this pull request May 14, 2025
2 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