Skip to content

Follow-up: address remaining default vector index review fixes#433

Open
mpartipilo wants to merge 12 commits into
mainfrom
followup/default-vector-index-review-fixes
Open

Follow-up: address remaining default vector index review fixes#433
mpartipilo wants to merge 12 commits into
mainfrom
followup/default-vector-index-review-fixes

Conversation

@mpartipilo
Copy link
Copy Markdown
Contributor

This follow-up PR contains changes that were committed after PR #432 was merged.

Included:

  • rename abbreviation-heavy identifiers in tests/code for clarity
  • move architecture-suffix version parsing into DbVersion.fromString
  • add regression coverage for architecture-suffixed versions
  • simplify integration test default expectation and related comments

Context:

@mpartipilo mpartipilo marked this pull request as ready for review May 22, 2026 11:22
Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

// Use a linux/amd64 platform pin only when the image tag carries the ".amd64"
// suffix — same narrowing the old test did, now applied to a single version.
// Use a linux/amd64 platform pin only when the image tag carries the ".amd64" suffix.
const platform = WEAVIATE_VERSION.includes('.amd64') ? 'linux/amd64' : undefined;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: iiuc, this is used as a parameter to startContainer. Could that function handle this piece of logic then? The benefit of it being that every caller of startContainer will not need to consider platform pin individually.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This may become unnecessary and I'll end up deleting it

Comment on lines -10 to -17
// ─────────────────────────────────────────────────────────────────────────────
const WEAVIATE_VERSION = process.env.WEAVIATE_VERSION;
if (!WEAVIATE_VERSION) {
throw new Error('WEAVIATE_VERSION env var is required for this integration test');
}
const expectedDefault = process.env.DEFAULT_VECTOR_INDEX ?? 'hfresh';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: could this test run against one of the containers spinned up by ./ci/run_containers.sh? My understanding is most integration tests run against those, so it'd be good to keep the harnessing consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is a leftover from when I used testcontainers to run before/after 1.37.5. I'll make it uniform with the rest of the tests.

@mpartipilo mpartipilo requested a review from a team as a code owner May 22, 2026 12:12
*/
function assertDefaultIndexType(actual: string) {
expect(actual).toEqual(serverAppliesDefault ? expectedDefault : 'hnsw');
expect(actual).toEqual(expectedDefaultIndexType(serverVersion));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: do we need a helper function for a ternary operator? (expectedDefaultIndexType)

Comment on lines +5 to +6
let client: WeaviateClient;
let serverVersion: DbVersion;
Copy link
Copy Markdown
Collaborator

@bevzzz bevzzz May 22, 2026

Choose a reason for hiding this comment

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

nit: imo these are better scoped to describe(), not the module, considering their lifecycle is managed by beforeAll and afterAll hooks

Comment thread src/collections/configure/unit.test.ts Outdated
Comment on lines +1261 to +1262
properties: undefined,
vectorIndex: undefined,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: do these need to be explicitly set to undefined? Do they default to something different if left unset?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am following the pattern of the other tests now.

- Add expectedDefaultIndexType helper that returns 'hfresh' for >= 1.37.5
- Update first two tests to check hfresh config when server defaults to hfresh
- Update named vectors test to use dynamic indexType expectation
- Update addVector test to use dynamic indexType expectation
- Explicitly set hnsw index for tests that reconfigure to hnsw with PQ
- Use vectorIndexType:'hnsw' in legacy vectors test
Aligns the openai test container configuration with the contextionary
container, ensuring Weaviate 1.37.5+ uses hfresh as the default vector
index type when no vectorIndexType is specified in the client request.
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.

2 participants