-
Notifications
You must be signed in to change notification settings - Fork 17
v1.37 client library coverage + CI improvements #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
g-despot
wants to merge
20
commits into
main
Choose a base branch
from
testing-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e3e10d3
Missing Java and TS snippets
g-despot b2a0c78
Refactoring + C# snippets
g-despot 9e2df53
Merge branch 'main' into 1-37/ramining
g-despot 607e701
Add C# changes
g-despot 99b69d1
Add more C# examples
g-despot 9dae75f
Trigger workflow
g-despot d913933
Merge pull request #416 from weaviate/1-37/ramining
g-despot 0574cf9
Fix failing tests
g-despot 32bc4fc
Update dependencies
g-despot 5bcf153
Retrigger workflow
g-despot ff66e75
Fix TS dependency
g-despot 14dc81a
Debug: temporary workflow to inspect secret values
g-despot 06da07c
Remove debug workflow
g-despot b873d4a
Re-apply tar CVE resolution (^7.5.8)
g-despot 608ad59
Update yarn.lock for weaviate-agents 1.4.0
g-despot f0d96f7
Fix OIDC tests
g-despot 79b3449
Fix failing
g-despot ffab90a
Use legacy vectorizer for Weather agent collection
g-despot 1ed8f50
Fix WCD env-var overwrite + bundle koala image locally
g-despot 56a7bd2
Resolve keycloak hostname on runner + fix agent test data refs
g-despot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Debug Secrets | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| print: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Print masked-bypass values | ||
| env: | ||
| WEAVIATE_URL: ${{ secrets.WEAVIATE_URL }} | ||
| WEAVIATE_HOST: ${{ secrets.WEAVIATE_HOST }} | ||
| WEAVIATE_HOSTNAME: ${{ secrets.WEAVIATE_HOSTNAME }} | ||
| WEAVIATE_HTTP_HOST: ${{ secrets.WEAVIATE_HTTP_HOST }} | ||
| WEAVIATE_GRPC_HOST: ${{ secrets.WEAVIATE_GRPC_HOST }} | ||
| # GitHub auto-masks anything matching a secret in logs. | ||
| # base64 transforms the value so it slips through, then we decode locally. | ||
| run: | | ||
| for k in WEAVIATE_URL WEAVIATE_HOST WEAVIATE_HOSTNAME WEAVIATE_HTTP_HOST WEAVIATE_GRPC_HOST; do | ||
| v="${!k}" | ||
| len="${#v}" | ||
| b64="$(printf '%s' "$v" | base64)" | ||
| echo "::notice::$k len=$len b64=$b64" | ||
| done | ||
Check warningCode 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: {}
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| using System; | ||
| using System.Linq; | ||
| using System.Threading.Tasks; | ||
| using Weaviate.Client; | ||
| using Weaviate.Client.Models; | ||
| using Xunit; | ||
|
|
||
| namespace WeaviateProject.Tests; | ||
|
|
||
| public class ManageDataExportTest : IAsyncLifetime | ||
| { | ||
| private static readonly string[] COLLECTIONS = ["Articles", "Products", "TempData"]; | ||
| private WeaviateClient client = null!; | ||
|
|
||
| public async Task InitializeAsync() | ||
| { | ||
| client = await Connect.Local(); | ||
|
|
||
| foreach (var name in COLLECTIONS) | ||
| { | ||
| if (await client.Collections.Exists(name)) | ||
| await client.Collections.Delete(name); | ||
|
|
||
| await client.Collections.Create( | ||
| new CollectionCreateParams | ||
| { | ||
| Name = name, | ||
| Properties = [Property.Text("title")], | ||
| } | ||
| ); | ||
| var collection = client.Collections.Use(name); | ||
| await collection.Data.Insert(new { title = $"Test {name} object" }); | ||
| } | ||
| } | ||
|
|
||
| public async Task DisposeAsync() | ||
| { | ||
| if (client != null) | ||
| { | ||
| foreach (var name in COLLECTIONS) | ||
| { | ||
| if (await client.Collections.Exists(name)) | ||
| await client.Collections.Delete(name); | ||
| } | ||
| client.Dispose(); | ||
| } | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task TestCreateExport() | ||
| { | ||
| // START CreateExport | ||
| // Export specific collections | ||
| var includeResult = await client.Export.CreateSync( | ||
| new ExportCreateRequest( | ||
| Id: "my-export-include", | ||
| Backend: ExportBackend.Filesystem(), | ||
| FileFormat: ExportFileFormat.Parquet, | ||
| IncludeCollections: ["Articles", "Products"] | ||
| ), | ||
| timeout: TimeSpan.FromMinutes(2) | ||
| ); | ||
|
|
||
| Console.WriteLine(includeResult.Status); // ExportStatus.Success | ||
| Console.WriteLine(string.Join(", ", includeResult.Collections ?? [])); // Articles, Products | ||
|
|
||
| // Or exclude specific collections (exports everything else) | ||
| var excludeResult = await client.Export.CreateSync( | ||
| new ExportCreateRequest( | ||
| Id: "my-export-exclude", | ||
| Backend: ExportBackend.Filesystem(), | ||
| FileFormat: ExportFileFormat.Parquet, | ||
| ExcludeCollections: ["TempData"] | ||
| ), | ||
| timeout: TimeSpan.FromMinutes(2) | ||
| ); | ||
| // END CreateExport | ||
|
|
||
| Assert.Equal(ExportStatus.Success, includeResult.Status); | ||
| Assert.Contains("Articles", includeResult.Collections!); | ||
| Assert.Contains("Products", includeResult.Collections!); | ||
|
|
||
| Assert.Equal(ExportStatus.Success, excludeResult.Status); | ||
| Assert.DoesNotContain("TempData", excludeResult.Collections!); | ||
| Assert.Contains("Articles", excludeResult.Collections!); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task TestCreateExportAsyncAndStatus() | ||
| { | ||
| var asyncId = $"my-async-export-{Guid.NewGuid():N}".Substring(0, 28); | ||
|
|
||
| // START CreateExportAsync | ||
| await using var operation = await client.Export.Create( | ||
| new ExportCreateRequest( | ||
| Id: asyncId, | ||
| Backend: ExportBackend.Filesystem(), | ||
| FileFormat: ExportFileFormat.Parquet, | ||
| IncludeCollections: ["Articles"] | ||
| ) | ||
| ); | ||
|
|
||
| Console.WriteLine(operation.Current.Status); // Started or Transferring | ||
| // END CreateExportAsync | ||
|
|
||
| Assert.Contains( | ||
| operation.Current.Status, | ||
| new[] { ExportStatus.Started, ExportStatus.Transferring, ExportStatus.Success } | ||
| ); | ||
|
|
||
| // START GetExportStatus | ||
| var status = await client.Export.GetStatus( | ||
| backend: ExportBackend.Filesystem(), | ||
| id: asyncId | ||
| ); | ||
|
|
||
| Console.WriteLine(status.Status); // e.g. Transferring | ||
| Console.WriteLine(string.Join(", ", status.Collections ?? [])); // Articles | ||
| // status.ShardStatus has per-shard progress details (collection -> shard -> ShardProgress) | ||
| // END GetExportStatus | ||
|
|
||
| Assert.Equal(asyncId, status.Id); | ||
| Assert.Contains( | ||
| status.Status, | ||
| new[] { ExportStatus.Started, ExportStatus.Transferring, ExportStatus.Success } | ||
| ); | ||
|
|
||
| // Wait for completion before the test ends so cleanup works. | ||
| await operation.WaitForCompletion(TimeSpan.FromMinutes(2)); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task TestCancelExport() | ||
| { | ||
| var cancelId = $"my-cancel-export-{Guid.NewGuid():N}".Substring(0, 28); | ||
|
|
||
| await using var operation = await client.Export.Create( | ||
| new ExportCreateRequest( | ||
| Id: cancelId, | ||
| Backend: ExportBackend.Filesystem(), | ||
| FileFormat: ExportFileFormat.Parquet, | ||
| IncludeCollections: ["Articles"] | ||
| ) | ||
| ); | ||
|
|
||
| // START CancelExport | ||
| await client.Export.Cancel( | ||
| backend: ExportBackend.Filesystem(), | ||
| id: cancelId | ||
| ); | ||
| // END CancelExport | ||
|
|
||
| // Cancel may return false if the export already reached a terminal state on a small dataset. | ||
| var status = await client.Export.GetStatus(ExportBackend.Filesystem(), cancelId); | ||
| Assert.Contains( | ||
| status.Status, | ||
| new[] { ExportStatus.Canceled, ExportStatus.Success } | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.