Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,37 @@
- "*"
push:
branches:
- master
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler: default
bundler-cache: true

- name: StandardRb check
run: bundle exec standardrb --format progress --format github --color

- name: RBS signatures
run: bundle exec rbs -r logger -r uri -r net-http -r json -I sig validate

tests:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0"]
env:
# standard requires Ruby >= 3.0, linting runs in its own job
BUNDLE_WITHOUT: lint

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -24,20 +45,19 @@
bundler: default
bundler-cache: true

- name: StandardRb check
run: bundle exec standardrb --format progress --format github --color

- name: Run tests
run: |
bundle exec rspec
docs:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: lint
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler: default
bundler-cache: true
- name: Build docs
Expand Down
1 change: 1 addition & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby_version: 2.7
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
- Fix `objects.exists?` raising on missing objects instead of returning `false`
- Fix `objects.batch_create(tenant:)` being ignored by Weaviate: the tenant is now set on each object
- Fix `query.aggs` failing with "groupBy must be a list, instead got: <nil>" when `group_by`/`object_limit` are not passed
- `live?`/`ready?` return `false` when Weaviate responds with an error (e.g. 503 while starting) or cannot be reached, instead of raising
- `collections.add_tenants` sends a JSON array and accepts hashes with `activityStatus`
- Query arguments (`where:`, `near_text:`, `sort:`, ...) can be Ruby hashes/arrays, serialized to GraphQL with strings escaped. Raw GraphQL strings still work
- Add API key headers for all model providers supported by Weaviate 1.38 (e.g. `:anthropic`, `:google_studio`, `:google_vertex`, `:mistral`, `:voyageai`, `:jinaai`, `:nvidia`)
- Add `headers:`, `open_timeout:`, `read_timeout:` and `write_timeout:` options to `Weaviate::Client.new`
- Add cross-references: `objects.add_reference`, `replace_references`, `delete_reference` and `batch_create_references`
- Add `group_by:` to `query.get`, and `limit:`/`with_hybrid:` to `query.aggs`
- Add `collections.update_tenants`, `get_tenant`, `tenant_exists?`, and `tenant:` to `collections.shards`
- Add `backups.list`, `cancel`, `cancel_restore`, `config:` on create/restore and `bucket:`/`path:` on status reads
- Add `client.nodes(output:, class_name:, shard_name:)`
- Add `client.aliases`, `client.users`, `client.roles` and `client.groups`
- Deprecate `query.explore`: Weaviate disables Explore when more than one vectorizer module is enabled
- Add RBS signatures for the public API
- Minimum Ruby version is now 2.7

### Breaking
- HTTP errors are raised as `Weaviate::HTTPError` subclasses (e.g. `Weaviate::ResourceNotFound`, `Weaviate::ServerError`) instead of `Faraday::Error` subclasses. Network failures raise `Weaviate::ConnectionFailed`/`Weaviate::TimeoutError`
Expand Down
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ gemspec
gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"
gem "standard", "~> 1.25.0"
gem "racc" # required by standard, previously pulled in through graphlient

gem "ostruct" # used in specs, no longer a default gem on Ruby >= 3.5

# Linting runs on the latest Ruby only (standard requires Ruby >= 3.0). Skip with BUNDLE_WITHOUT=lint.
group :lint do
gem "standard", "~> 1.57"
gem "rbs", "~> 3.8"
end
75 changes: 47 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
ast (2.4.3)
byebug (11.1.3)
coderay (1.1.3)
diff-lcs (1.5.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
json (3.1.0)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
logger (1.7.0)
method_source (1.0.0)
ostruct (0.6.3)
parallel (1.22.1)
parser (3.2.1.1)
parallel (2.3.0)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
prism (1.9.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -28,9 +31,11 @@ GEM
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
rbs (3.10.4)
logger
tsort
rdiscount (2.2.7.4)
regexp_parser (2.7.0)
rexml (3.4.2)
regexp_parser (2.13.1)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
Expand All @@ -44,28 +49,42 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.48.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rubocop (1.91.0)
json (>= 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.26.0, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
parser (>= 3.2.1.0)
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (1.13.0)
standard (1.25.3)
standard (1.57.0)
language_server-protocol (~> 3.17.0.2)
rubocop (~> 1.48.1)
rubocop-performance (~> 1.16.0)
unicode-display_width (2.4.2)
yard (0.9.37)
lint_roller (~> 1.0)
rubocop (~> 1.91.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.8)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.26.0)
tsort (0.2.0)
unicode-display_width (3.3.0)
unicode-emoji (~> 4.3)
unicode-emoji (4.3.0)
yard (0.9.45)

PLATFORMS
arm64-darwin-21
Expand All @@ -79,13 +98,13 @@ PLATFORMS
DEPENDENCIES
ostruct
pry-byebug (~> 3.9)
racc
rake (~> 13.0)
rbs (~> 3.8)
rdiscount
rspec (~> 3.0)
standard (~> 1.25.0)
standard (~> 1.57)
weaviate-ruby!
yard

BUNDLED WITH
2.4.0
2.6.9
Loading
Loading