Skip to content

feat: Ruby SDK update for version 24.0.0#61

Merged
abnegate merged 1 commit into
mainfrom
dev
May 19, 2026
Merged

feat: Ruby SDK update for version 24.0.0#61
abnegate merged 1 commit into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 18, 2026

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

What's Changed

  • Breaking: Renamed AuthMethod enum to ProjectAuthMethodId
  • Breaking: Renamed EmailTemplateType to ProjectEmailTemplateId and EmailTemplateLocale to ProjectEmailTemplateLocale
  • Breaking: Renamed ServiceId to ProjectServiceId, ProtocolId to ProjectProtocolId, Secure to ProjectSMTPSecure, ProjectPolicy to ProjectPolicyId
  • Breaking: Replaced Scopes enum with ProjectKeyScopes for project key endpoints
  • Breaking: Removed Project#update_deny_canonical_email_policy; replaced with update_deny_aliased_email_policy, update_deny_disposable_email_policy, and update_deny_free_email_policy
  • Breaking: Removed AuthProvider model; use new ProjectOAuthProviderId enum instead
  • Added: Project#get method to fetch current project details
  • Added: Advisor, Presences, and Usage services
  • Added: Insight, Presence, Report, UsageEvent, and UsageGauge models with list variants
  • Added: ProjectAuthMethod, ProjectProtocol, and ProjectService models
  • Added: ProjectOAuthProviderId and ProjectOAuth2GooglePrompt enums
  • Updated: Project, Database, and OAuth2Google model schemas
  • Updated: X-Appwrite-Response-Format header to 1.9.5

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR updates the Ruby SDK to version 24.0.0, introducing three new services (Advisor, Presences, Usage), several new models and enums, and a set of breaking renames across project-related enums and methods.

  • New services: Advisor (report/insight CRUD), Presences (presence log management), and Usage (event/gauge metrics queries) are added with corresponding models and list variants.
  • Breaking renames: AuthMethodProjectAuthMethodId, EmailTemplateTypeProjectEmailTemplateId, ServiceIdProjectServiceId, SecureProjectSMTPSecure, and ScopesProjectKeyScopes; update_deny_canonical_email_policy is replaced by three separate policy update methods.
  • Enum duplication: Enums::Scopes was not removed despite being "replaced" by Enums::ProjectKeyScopes, and two newly added files (o_auth2_google_prompt.rb and project_o_auth2_google_prompt.rb) define identical OAuth2GooglePrompt/ProjectOAuth2GooglePrompt modules — both pairs are loaded in appwrite.rb.

Confidence Score: 3/5

The new services and model additions are structurally sound, but two enum duplication issues in appwrite.rb and the post-gsub nil check ordering in the new services need to be resolved before release.

The duplicate enum pairs (Scopes/ProjectKeyScopes and OAuth2GooglePrompt/ProjectOAuth2GooglePrompt) expose contradictory API surface after the intended rename, and nil guards in the new Advisor and Presences service methods fire after the gsub call that would already raise a TypeError on nil input, hiding the intended error message.

lib/appwrite.rb (duplicate enum requires), lib/appwrite/services/advisor.rb and lib/appwrite/services/presences.rb (post-gsub nil checks)

Important Files Changed

Filename Overview
lib/appwrite.rb Registers new models, enums, and services; contains two pairs of duplicate enum modules (Scopes/ProjectKeyScopes and OAuth2GooglePrompt/ProjectOAuth2GooglePrompt) that both remain active after the rename
lib/appwrite/services/advisor.rb New Advisor service with list/get/delete report and list/get insight methods; all path-param nil checks occur after .gsub() call, making them unreachable when nil is passed
lib/appwrite/services/presences.rb New Presences service with CRUD operations; nil checks for path params follow the same post-gsub ordering issue as advisor.rb
lib/appwrite/services/usage.rb New Usage service with list_events and list_gauges endpoints; no path params, straightforward implementation
lib/appwrite/services/project.rb Extended Project service with get, update_deny_aliased/disposable/free_email_policy methods and new OAuth2 Google fields; overall shape follows existing SDK patterns
lib/appwrite/enums/project_key_scopes.rb New ProjectKeyScopes enum — identical content to existing Scopes enum which was not removed
lib/appwrite/enums/o_auth2_google_prompt.rb New OAuth2GooglePrompt enum — identical content to new ProjectOAuth2GooglePrompt enum, one is redundant
lib/appwrite/enums/project_o_auth2_google_prompt.rb New ProjectOAuth2GooglePrompt enum — identical content to OAuth2GooglePrompt; only one should be registered
lib/appwrite/client.rb Updated SDK version to 24.0.0 and X-Appwrite-Response-Format header to 1.9.5; no logic changes
lib/appwrite/models/project.rb Project model significantly trimmed and updated to reflect new v24 schema fields
lib/appwrite/enums/scopes.rb Old Scopes enum updated with new scope values; should be deprecated/removed since ProjectKeyScopes supersedes it per PR description

Comments Outside Diff (1)

  1. lib/appwrite.rb, line 260-270 (link)

    P1 Duplicate Scopes and ProjectKeyScopes enum modules

    Both Enums::Scopes (line 260) and the newly added Enums::ProjectKeyScopes (line 269) are required and have identical values. The PR description states Scopes was replaced by ProjectKeyScopes, but the old module is still present and loaded. Users calling Enums::Scopes::USERS_READ and Enums::ProjectKeyScopes::USERS_READ get the same value from two separate modules, and the deprecated Scopes name continues to appear as valid API surface.

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

Comment thread lib/appwrite.rb
Comment on lines 270 to +295
@@ -276,6 +292,7 @@
require_relative 'appwrite/enums/deployment_status'
require_relative 'appwrite/enums/execution_trigger'
require_relative 'appwrite/enums/execution_status'
require_relative 'appwrite/enums/o_auth2_google_prompt'
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 Duplicate OAuth2GooglePrompt and ProjectOAuth2GooglePrompt enum modules

Both Enums::ProjectOAuth2GooglePrompt (line 270, project_o_auth2_google_prompt.rb) and Enums::OAuth2GooglePrompt (line 295, o_auth2_google_prompt.rb) are new files introduced in this PR with identical values (NONE, CONSENT, SELECT_ACCOUNT). The PR description only mentions ProjectOAuth2GooglePrompt. One of these should be removed — having both registers two identical, ambiguously named constants in the Appwrite::Enums namespace.

Comment on lines +46 to +52
def get_report(report_id:)
api_path = '/reports/{reportId}'
.gsub('{reportId}', report_id)

if report_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "reportId"')
end
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 Nil check occurs after path interpolation

The guard if report_id.nil? on line 50 is unreachable when report_id is nil because Ruby's String#gsub raises a TypeError: no implicit conversion of nil into String during the .gsub('{reportId}', report_id) call on line 48. The caller therefore receives a cryptic TypeError instead of the intended Appwrite::Exception message. The nil check should precede the path-building step. The same ordering issue exists in delete_report, list_insights, and get_insight in this file, and in presences.rb for get, upsert, update_presence, and delete.

@abnegate abnegate merged commit 8ef1f02 into main May 19, 2026
2 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