Skip to content

feat: Ruby SDK update for version 23.0.0#58

Merged
abnegate merged 2 commits intomainfrom
dev
Apr 16, 2026
Merged

feat: Ruby SDK update for version 23.0.0#58
abnegate merged 2 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Apr 15, 2026

This PR contains updates to the Ruby SDK for version 23.0.0.

What's Changed

  • [BREAKING] Renamed Webhook model fields: securitytls, httpUserauthUsername, httpPassauthPassword, signatureKeysecret
  • [BREAKING] Renamed Webhook service parameters to match: securitytls, httpUserauthUsername, httpPassauthPassword
  • [BREAKING] Renamed Webhooks#update_signature to Webhooks#update_secret with new optional secret parameter
  • Added Client#get_headers method to retrieve request headers
  • Added secret parameter to Webhook create and update methods
  • Added x OAuth provider to OAuthProvider enum
  • Added userType field to Log model
  • Added purge parameter to update_collection and update_table for cache invalidation
  • Added Project service: platform CRUD, key CRUD, protocol/service status management
  • Added new models: Key, KeyList, Project, DevKey, MockNumber, AuthProvider, PlatformAndroid, PlatformApple, PlatformLinux, PlatformList, PlatformWeb, PlatformWindows, BillingLimits, Block
  • Added new enums: PlatformType, ProtocolId, ServiceId
  • Updated BuildRuntime, Runtime enums with dart-3.11 and flutter-3.41
  • Updated Scopes enum with keys_read, keys_write, platforms_read, platforms_write
  • Updated X-Appwrite-Response-Format header to 1.9.1
  • Updated TTL description for list caching in Databases and TablesDB

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 15, 2026

Greptile Summary

This PR updates the Ruby SDK to version 23.0.0, adding a substantial new Project service with endpoints for managing API keys, platform registrations (Android, Apple, Linux, Web, Windows), labels, protocols, and services, along with corresponding model classes, enums, and webhook field renames (security/httpUser/httpPass/signatureKeytls/authUsername/authPassword/secret).

The previously flagged get_platform hard-coded-PlatformWeb issue has been fixed: the method now properly dispatches on response['type'] to the correct typed model. However, several other model-layer issues flagged in prior rounds remain unresolved: billing_limits and blocks nil crashes in Project.from/to_map, platforms stored as raw hashes in both Project.from and PlatformList.from, and the TypeError (not ArgumentError) thrown by validate_type when type is nil.

Confidence Score: 4/5

Safe to merge functionally but several model-layer P1 issues from prior review rounds remain unaddressed

The get_platform dispatch regression from the prior review has been properly fixed. However, the previously-flagged P1 issues in Project.from (billing_limits and blocks nil crashes, platforms stored as raw hashes) and PlatformList.from (platforms not deserialized to typed models) are still present in the merged code. These represent real NoMethodError crashes for callers who receive API responses that omit billingLimits or blocks.

lib/appwrite/models/project.rb and lib/appwrite/models/platform_list.rb require the nil guards and typed platform deserialization that were discussed in prior review threads

Important Files Changed

Filename Overview
lib/appwrite/services/project.rb Large new service adding keys, platforms, labels, protocol and service status endpoints; get_platform dispatch is now correct; nil-check-after-gsub pattern matches pre-existing SDK style
lib/appwrite/models/project.rb New model with open P1 issues from prior review: billing_limits/blocks nil crashes in from/to_map, platforms stored as raw Array
lib/appwrite/models/platform_list.rb New model; platforms stored as raw Array (unfixed from prior review) rather than being dispatched to typed platform models
lib/appwrite/models/platform_android.rb New platform model; validate_type raises TypeError (not ArgumentError) when type is nil — unfixed from prior review
lib/appwrite/models/billing_limits.rb New model mapping billing limit fields; looks correct in isolation
lib/appwrite/models/block.rb New Block model with created_at, resource_type, resource_id, reason, expired_at; looks correct
lib/appwrite/models/webhook.rb Field renames (security->tls, httpUser->authUsername, httpPass->authPassword, signatureKey->secret) consistently applied across attr_readers, initialize, from, and to_map
lib/appwrite/services/webhooks.rb Parameter renames for create/update, update_signature renamed to update_secret with new /secret path; changes look correct
lib/appwrite/models/key.rb New Key model with id, name, scopes, expire, secret, accessed_at, sdks; correct deserialization
lib/appwrite/models/key_list.rb New KeyList model; keys properly deserialized to typed Key instances
lib/appwrite/client.rb Version bump to 23.0.0, response format header updated to 1.9.1, get_headers accessor added
lib/appwrite/enums/platform_type.rb New enum with WINDOWS, APPLE, ANDROID, LINUX, WEB values; missing trailing newline (flagged in prior review)

Reviews (7): Last reviewed commit: "chore: update Ruby SDK to 23.0.0" | Re-trigger Greptile

Comment thread lib/appwrite/services/project.rb
Comment thread lib/appwrite/enums/platform_type.rb
Comment thread lib/appwrite/models/project.rb
@ChiragAgg5k ChiragAgg5k changed the title feat: Ruby SDK update for version 22.1.0 feat: Ruby SDK update for version 23.0.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Ruby SDK update for version 23.0.0 feat: SDK update for version 23.0.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 23.0.0 feat: Ruby SDK update for version 23.0.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Ruby SDK update for version 23.0.0 feat: SDK update for version 23.0.0 Apr 15, 2026
Comment thread lib/appwrite/models/platform_android.rb
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 23.0.0 feat: Ruby SDK update for version 23.0.0 Apr 15, 2026
Comment thread lib/appwrite/models/platform_list.rb
Comment thread lib/appwrite/models/project.rb
Comment thread lib/appwrite/models/project.rb
Comment on lines +221 to +222
@service_status_for_databases = service_status_for_databases
@service_status_for_tablesdb = service_status_for_tablesdb
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 to_map nil crash for billing_limits and blocks

to_map calls @billing_limits.to_map and @blocks.map { |it| it.to_map } directly. Once the nil guards recommended for from are applied (so @billing_limits and @blocks can be nil), calling to_map on a project deserialized from a response that omits those fields will raise NoMethodError. The guards need to be symmetric.

Suggested change
@service_status_for_databases = service_status_for_databases
@service_status_for_tablesdb = service_status_for_tablesdb
"billingLimits": @billing_limits&.to_map,
"blocks": @blocks&.map { |it| it.to_map },

@abnegate abnegate merged commit b3157c8 into main Apr 16, 2026
1 check 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