Repository navigation
Follow-ups: CI fixes, bug fixes, GraphQL hashes, missing endpoints - #73
Merged
Merged
Conversation
… metadata - ci.yml triggered pushes on master, the default branch is main - Test on Ruby 2.7 through 4.0, lint in its own job on the latest Ruby (standard >= 1.38 requires Ruby >= 3.0, so it moves to a lint group) - Upgrade standard 1.25 -> 1.57, which runs on Ruby 3.4+, targeting Ruby 2.7 - Pin actions/checkout to v5 instead of master - Bump yard to 0.9.45 (fixes two path traversal advisories in yard server) - Raise required_ruby_version to 2.7, the oldest tested version - Point gemspec metadata and README links at patterns-ai-core/weaviate-ruby
- live?/ready? return false on error responses (e.g. 503 while starting) and when Weaviate cannot be reached, instead of raising - add_tenants sends a JSON array instead of interpolating names into a string, and accepts hashes with activityStatus - Add API key headers for the providers Weaviate 1.38 supports, plus a headers: option for multi-key providers (AWS) and base URL overrides - Add open_timeout:, read_timeout: and write_timeout: options - Filter token, secret and access key headers from the logs - Send a weaviate-ruby User-Agent - Remove response.success? branches that can no longer run
where:, near_text:, sort: and the other query arguments can now be Ruby hashes/arrays. They are serialized to GraphQL with strings quoted and escaped, so values from user input can't break out of the query. Symbols and the operator/order/fusionType keys are sent as enums. Raw GraphQL strings are still passed through unchanged. Also require json where it is used instead of relying on load order.
Wrap the Weaviate 1.38 endpoints the gem was missing, verified against a live server with RBAC enabled: - objects: add/replace/delete references, batch_create_references - query.get group_by:, query.aggs limit: and with_hybrid: - collections: update_tenants, get_tenant, tenant_exists?, shards tenant: - backups: list, cancel, cancel_restore, config:, bucket:/path: - nodes: output:, class_name:, shard_name: - client.aliases, client.users, client.roles, client.groups - Deprecate query.explore, which Weaviate disables on default installs - RBS signatures for the public API, validated in CI
yard 0.9.45 also parses sig/*.rbs and fails on multi-line signatures, which --fail-on-warning turns into a failed docs build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #72. Everything here goes into the unreleased 0.10.0.
CI and tooling
ci.ymlwas triggered by pushes to amasterbranch, but the default branch ismain, so pushes tomainnever ran CI.lintGemfile group that the test jobs skip withBUNDLE_WITHOUT=lint..standard.ymltargets Ruby 2.7.actions/checkout@v5instead of@master.yard server, and replaces Bump yard from 0.9.37 to 0.9.42 in the bundler group across 1 directory #71.required_ruby_versionis now>= 2.7, the oldest version CI tests.patterns-ai-core/weaviate-ruby.changelog_uriwas also missing/blob/main/.Bug fixes
live?/ready?returnfalseon error responses (Weaviate returns 503 while starting up) and when it can't be reached, instead of raising.add_tenantssent JSON built by interpolating strings. It now sends an array and accepts{ name:, activityStatus: }hashes.query.rbandcollections.rbcalledto_json/JSONwithout requiringjson. This only worked because of load order.response.success?branches that can't run now that non-2xx responses raise.Client options
headers:for extra headers, e.g. AWS access/secret keys or base URL overrides.open_timeout:,read_timeout:andwrite_timeout:.weaviate-ruby/<version>User-Agent.GraphQL arguments as Ruby hashes
where:,near_text:,sort:and the other query arguments can now be hashes or arrays. Strings are quoted and escaped, so values from user input can't break out of the query. Symbols, and string values underoperator/order/fusionType, are sent as enums. Raw GraphQL strings still pass through unchanged.New endpoints and options
add_reference,replace_references,delete_reference,batch_create_references.get(group_by:),aggs(limit:, with_hybrid:).exploreis deprecated and warns once, because Weaviate disables it when more than one vectorizer module is loaded.update_tenants,get_tenant,tenant_exists?,shards(tenant:).list,cancel,cancel_restore,config:on create/restore,bucket:/path:on status reads.client.nodes(output:, class_name:, shard_name:).client.aliases,client.users(database users and role assignment),client.roles(RBAC roles and permissions),client.groups(OIDC group roles).Not included
gRPC. It would add the
grpcgem, a large native dependency, which works against #56's goal of keeping dependencies minimal.Testing
Net::HTTPlevel, checking method, path, query and body.rbs/test/setup, with 0 type errors.ForbiddenErroron deleteCANCELEDvalueTextis escapedweaviate-ruby ~> 0.9.2, so it will need a bump to use 0.10.0.