Skip to content

Add .activate, .deactivate, .offload helpers to collection.tenants #311

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsmith023
Copy link
Collaborator

No description provided.

Copy link

@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

@tsmith023 tsmith023 requested a review from bevzzz June 24, 2025 10:52
@weaviate-git-bot
Copy link

Great to see you again! Thanks for the contribution.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

Comment on lines +86 to +102
activate: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'ACTIVE',
});
},
deactivate: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'INACTIVE',
});
},
offload: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'OFFLOADED',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it'll make sense to accept (string | TenantBC)[] to match update signature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By having it be TenantBase, any of the TenantX types are acceptable in this method since the activityStatus is ignored by the methods; all that is relevant is the name which is the only field of TenantBase

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should've made it clearer in the original comment: I think these helper methods can accept an array of tenant names, so as to make it possible to, e.g., activate multiple tenants at once.

Just like it's possible to batch-update them.

Comment on lines +86 to +102
activate: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'ACTIVE',
});
},
deactivate: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'INACTIVE',
});
},
offload: (tenant: string | TenantBase) => {
return update({
name: parseStringOrTenant(tenant),
activityStatus: 'OFFLOADED',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should've made it clearer in the original comment: I think these helper methods can accept an array of tenant names, so as to make it possible to, e.g., activate multiple tenants at once.

Just like it's possible to batch-update them.

Comment on lines +196 to +198
* @returns {Promise<Tenant[]>} The activated tenant as a list of Tenant.
*/
activate: (tenant: string | TenantBase) => Promise<Tenant[]>;
Copy link
Collaborator

@bevzzz bevzzz Jul 17, 2025

Choose a reason for hiding this comment

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

note: the activated tenant as a list of Tenant looks a tad contrived, since we already know there will only be 1 result in that list.

I'd have these methods accept a (string | TenantBase)[] as per the comment above (or below)

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.

3 participants