Skip to content

feat: Ruby SDK update for version 25.0.0#65

Merged
ArnabChatterjee20k merged 2 commits into
mainfrom
dev
Jun 1, 2026
Merged

feat: Ruby SDK update for version 25.0.0#65
ArnabChatterjee20k merged 2 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Jun 1, 2026

Copy link
Copy Markdown
Member

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

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Ruby SDK update for version 25.0.0 feat: ruby SDK update for version 25.0.0 Jun 1, 2026
@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Ruby SDK to version 25.0.0, introducing the new Organization service, several new enums and models, and breaking changes to Runtime, BuildRuntime, ProjectOAuthProviderId, and StatusCode.

  • New Organization service adds CRUD for organization API keys and projects, backed by ProjectList, Region, and OrganizationKeyScopes.
  • Model updates: ActivityEvent fields renamed from user_* to actor_*; Function, Site, and UsageGauge gain new attributes; new PolicyDeny* models and ProjectPolicyId entries added.
  • Breaking StatusCode rename: numeric suffixes were dropped, but MOVEDPERMANENTLY, TEMPORARYREDIRECT, and PERMANENTREDIRECT also lost their internal underscores, diverging from the PR description and the codebase's SCREAMING_SNAKE_CASE convention.

Confidence Score: 4/5

Safe to merge after fixing the StatusCode constant names — all other changes are additive or straightforward renames.

The StatusCode constants MOVEDPERMANENTLY, TEMPORARYREDIRECT, and PERMANENTREDIRECT lost their internal underscores instead of only the numeric suffix, making them non-idiomatic and inconsistent with every other multi-word constant in the SDK. Any consumer referencing these constants by name will need to use the awkward concatenated form, and the rename diverges from what the PR description advertised. Everything else looks correct.

lib/appwrite/enums/status_code.rb

Important Files Changed

Filename Overview
lib/appwrite/enums/status_code.rb Breaking rename of StatusCode constants dropped numeric suffixes but also accidentally removed internal underscores, leaving MOVEDPERMANENTLY/TEMPORARYREDIRECT/PERMANENTREDIRECT instead of MOVED_PERMANENTLY/TEMPORARY_REDIRECT/PERMANENT_REDIRECT.
lib/appwrite/services/organization.rb New Organization service with list/create/get/update/delete for keys and projects; nil-check ordering after gsub is consistent with the rest of the SDK.
lib/appwrite/models/activity_event.rb Renames user_type/user_id/user_email/user_name to actor_type/actor_id/actor_email/actor_name, consistently updated across attrs, constructor, from(), and to_map().
lib/appwrite/models/project_list.rb New ProjectList model correctly implementing total/projects with from() and to_map() following existing patterns.
lib/appwrite/models/function.rb Adds provider_branches and provider_paths attributes, consistently wired through constructor, from(), and to_map().
lib/appwrite/models/site.rb Adds provider_branches and provider_paths attributes mirroring the Function model changes.
lib/appwrite/models/usage_gauge.rb Adds resource_type and resource_id attributes; consistently applied across constructor, from(), and to_map().
lib/appwrite.rb Adds requires for new models, enums, and the Organization service; replaces theme/name/scopes with browser_theme/health_queue_name/project_key_scopes with no duplicates.
lib/appwrite/enums/region.rb New Region enum with six region codes (fra, nyc, syd, sfo, sgp, tor); missing trailing newline.
lib/appwrite/services/presences.rb Breaking rename of update_presence to update; straightforward method rename with no logic changes.

Reviews (2): Last reviewed commit: "chore: merge main and resolve version co..." | Re-trigger Greptile

Comment thread lib/appwrite/client.rb
Comment on lines +329 to 335
upload_complete = lambda do |chunk_result|
chunks_uploaded = chunk_result['chunksUploaded']
return false if chunks_uploaded.nil?

on_progress.call({
id: result['$id'],
progress: ([offset, size].min).to_f/size.to_f * 100.0,
size_uploaded: [offset, size].min,
chunks_total: result['chunksTotal'],
chunks_uploaded: result['chunksUploaded']
}) unless on_progress.nil?
chunks_total = chunk_result['chunksTotal'] || total_chunks
chunks_uploaded.to_i >= chunks_total.to_i
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.

P2 The upload_complete lambda assigns to chunks_uploaded, which is the same variable captured from the outer scope (Ruby lambdas close over variables by reference). This silently mutates the outer chunks_uploaded on every invocation — once from the main thread after the first chunk, then repeatedly from worker threads inside mutex.synchronize. While the outer variable isn't read again after the workers start, this is unintentional aliasing that makes the code fragile to future edits. Using a distinct local name keeps the intent clear.

Suggested change
upload_complete = lambda do |chunk_result|
chunks_uploaded = chunk_result['chunksUploaded']
return false if chunks_uploaded.nil?
on_progress.call({
id: result['$id'],
progress: ([offset, size].min).to_f/size.to_f * 100.0,
size_uploaded: [offset, size].min,
chunks_total: result['chunksTotal'],
chunks_uploaded: result['chunksUploaded']
}) unless on_progress.nil?
chunks_total = chunk_result['chunksTotal'] || total_chunks
chunks_uploaded.to_i >= chunks_total.to_i
end
upload_complete = lambda do |chunk_result|
uploaded = chunk_result['chunksUploaded']
return false if uploaded.nil?
chunks_total = chunk_result['chunksTotal'] || total_chunks
uploaded.to_i >= chunks_total.to_i
end

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +14 to +16
end
end
end No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 File is missing a trailing newline. The same issue exists in lib/appwrite/enums/region.rb and lib/appwrite/enums/project_policy_id.rb.

Suggested change
end
end
end
end
end
end

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: ruby SDK update for version 25.0.0 feat: Ruby SDK update for version 25.0.0 Jun 1, 2026
@ArnabChatterjee20k ArnabChatterjee20k merged commit 106dd3b into main Jun 1, 2026
1 check passed
@ChiragAgg5k ChiragAgg5k deleted the dev branch June 5, 2026 08:14
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.

3 participants