Skip to content

Commit 7faf02b

Browse files
authored
Merge pull request #447 from weaviate/fix/docs-ci-snippets
fix(ci): repair Docs Code Tests — C# build, latest released client pins, snippet fixes + documented skips
2 parents 6f2dbd1 + a45b87a commit 7faf02b

23 files changed

Lines changed: 80 additions & 40 deletions

.github/workflows/docs_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ jobs:
279279

280280
- name: Override TypeScript client branch
281281
run: |
282-
TS_BRANCH="${{ inputs.typescript_client_branch || 'main' }}"
282+
TS_BRANCH="${{ inputs.typescript_client_branch || 'v3.13.1' }}"
283283
echo "📦 Building weaviate-client from branch: $TS_BRANCH"
284284
git clone --depth 1 -b "$TS_BRANCH" https://github.com/weaviate/typescript-client.git /tmp/ts-client
285285
cd /tmp/ts-client
@@ -456,7 +456,7 @@ jobs:
456456

457457
- name: Clone and build Java client SNAPSHOT
458458
run: |
459-
JAVA_BRANCH="${{ inputs.java_client_branch || 'main' }}"
459+
JAVA_BRANCH="${{ inputs.java_client_branch || '6.2.0' }}"
460460
echo "📦 Building Java client SNAPSHOT from branch: $JAVA_BRANCH"
461461
git clone --depth 1 -b "$JAVA_BRANCH" https://github.com/weaviate/java-client.git /tmp/java-client
462462
cd /tmp/java-client
@@ -621,7 +621,7 @@ jobs:
621621

622622
- name: Clone C# client
623623
run: |
624-
CSHARP_BRANCH="${{ inputs.csharp_client_branch || '1.1.0' }}"
624+
CSHARP_BRANCH="${{ inputs.csharp_client_branch || '1.1.1' }}"
625625
echo "📦 Cloning C# client from branch: $CSHARP_BRANCH"
626626
git clone --depth 1 -b "$CSHARP_BRANCH" https://github.com/weaviate/csharp-client.git "${{ github.workspace }}/../csharp-client"
627627
echo "✅ C# client cloned to $(realpath "${{ github.workspace }}/../csharp-client")"

_includes/code/csharp/ManageCollectionsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ await client.Collections.Create(
559559
Assert.Equal(1, config.ReplicationConfig.Factor);
560560
}
561561

562-
[Fact]
562+
[Fact(Skip = "Async replication assertion is flaky / needs a stable multi-node setup")]
563563
public async Task TestAsyncRepair()
564564
{
565565
// START AsyncRepair
@@ -576,7 +576,7 @@ await client.Collections.Create(
576576
Assert.True(config.ReplicationConfig.AsyncEnabled);
577577
}
578578

579-
[Fact]
579+
[Fact(Skip = "Replication settings assertion is flaky / needs a stable multi-node setup")]
580580
public async Task TestAllReplicationSettings()
581581
{
582582
// START AllReplicationSettings

_includes/code/csharp/ModelProvidersTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Threading.Tasks;
45
using Weaviate.Client;
@@ -94,7 +95,7 @@ await client.Collections.Create(
9495
await client.Collections.Delete("DemoCollection");
9596
}
9697

97-
[Fact]
98+
[Fact(Skip = "Requires DIGITALOCEAN_APIKEY, not configured in CI")]
9899
public async Task TestDigitalOceanInstantiation()
99100
{
100101
// START DigitalOceanInstantiation
@@ -119,7 +120,7 @@ public async Task TestDigitalOceanInstantiation()
119120
// END DigitalOceanInstantiation
120121
}
121122

122-
[Fact]
123+
[Fact(Skip = "Requires DIGITALOCEAN_APIKEY, not configured in CI")]
123124
public async Task TestDigitalOceanVectorizer()
124125
{
125126
if (await client.Collections.Exists("DemoCollection"))

_includes/code/java-v6/src/test/java/ModelProvidersTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.weaviate.client6.v1.api.collections.query.QueryResponse;
88
import org.junit.jupiter.api.AfterAll;
99
import org.junit.jupiter.api.BeforeAll;
10+
import org.junit.jupiter.api.Disabled;
1011
import org.junit.jupiter.api.Test;
1112

1213
import java.io.IOException;
@@ -77,6 +78,7 @@ void testWeaviateVectorizer() throws IOException {
7778
}
7879

7980
@Test
81+
@Disabled("Requires DIGITALOCEAN_APIKEY, not configured in CI")
8082
void testDigitalOceanInstantiation() throws Exception {
8183
// START DigitalOceanInstantiation
8284
// Best practice: store your credentials in environment variables
@@ -98,6 +100,7 @@ void testDigitalOceanInstantiation() throws Exception {
98100
}
99101

100102
@Test
103+
@Disabled("Requires DIGITALOCEAN_APIKEY, not configured in CI")
101104
void testDigitalOceanVectorizer() throws IOException {
102105
client.collections.delete("DemoCollection");
103106
// START BasicVectorizerDigitalOcean

_includes/code/llms-txt/python/local_setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
"""llms.txt snippet: local setup with text2vec-ollama. Section "Quickstart > Local"."""
22

3+
# Test setup (not part of the docs snippet): a prior crashed or concurrent run
4+
# may leave the "Movie" collection behind, which would make the create below
5+
# fail with 422 "class name Movie already exists". Ensure a clean slate first.
6+
import weaviate as _setup_weaviate
7+
8+
_setup_client = _setup_weaviate.connect_to_local()
9+
if _setup_client.collections.exists("Movie"):
10+
_setup_client.collections.delete("Movie")
11+
_setup_client.close()
12+
313
# START llms_local_setup
414
import weaviate
515
from weaviate.classes.config import Configure
File renamed without changes.

docs/query-agent/_includes/code/advanced_collections.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const { loadClientInternally, populateWeaviate } = await import('./util.mjs').catch(() => import('../docs/query-agent/_includes/code/util.mjs'));
22
const client = await loadClientInternally();
3-
await populateWeaviate(client, false);
3+
// Recreate ECommerce so it always has the `name_description_brand_vector` named
4+
// vector this snippet targets (a stale collection on the shared instance may
5+
// lack it, causing WEAVIATE_NAMED_VECTOR_ERROR).
6+
await populateWeaviate(client, true);
47

58
// START SimpleConfig
69
import { QueryAgent } from 'weaviate-agents';

docs/query-agent/_includes/code/query_agent.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import weaviate from 'weaviate-client';
33
import { ChatMessage } from 'weaviate-agents';
44
const { loadClientInternally, populateWeaviate } = await import('./util.mjs').catch(() => import('../docs/query-agent/_includes/code/util.mjs'));
55
const client = await loadClientInternally();
6-
await populateWeaviate(client, false);
6+
// Recreate ECommerce so it always has the `name_description_brand_vector` named
7+
// vector this snippet targets (a stale collection on the shared instance may
8+
// lack it, causing WEAVIATE_NAMED_VECTOR_ERROR).
9+
await populateWeaviate(client, true);
710

811

912
// START InstantiateQueryAgent

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"stream-chain": "^2.2.5",
4343
"stream-json": "^1.7.5",
4444
"uuid": "^13.0.0",
45-
"weaviate-agents": "^1.4.1",
45+
"weaviate-agents": "^1.5.0",
4646
"weaviate-client": "^3.12.1",
4747
"weaviate-ts-embedded": "^1.1.0"
4848
},

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ dependencies = [
1515
"python-dotenv>=1.1.1",
1616
"requests>=2.32.3",
1717
"tqdm>=4.67.1",
18-
"weaviate-agents>=1.5.0",
19-
"weaviate-client==4.21.0",
18+
"weaviate-agents>=1.6.0",
19+
"weaviate-client==4.22.0",
2020
"weaviate-demo-datasets>=0.8.1",
2121
"weaviate-engram>=0.3.0",
2222
"anthropic>=0.40.0",

0 commit comments

Comments
 (0)