feat: Add initial Tenant traits and data structures #43

Merged
johnride merged 3 commits from feat/tenant into master 2025-05-29 15:51:37 +00:00
Owner

There is a bit of cleaning up to do but the general idea is advanced enough to be worth reviewing. Tell me what you think!

See https://git.nationtech.io/NationTech/harmony/src/branch/master/adr/011-multi-tenant-cluster.md for some background thoughts on this PR.

Also this for more of the thought process and the llm generated code directly https://poe.com/s/NG7MYgyqJiqiCsijyBnt

There is a bit of cleaning up to do but the general idea is advanced enough to be worth reviewing. Tell me what you think! See https://git.nationtech.io/NationTech/harmony/src/branch/master/adr/011-multi-tenant-cluster.md for some background thoughts on this PR. Also this for more of the thought process and the llm generated code directly https://poe.com/s/NG7MYgyqJiqiCsijyBnt
johnride added 1 commit 2025-05-29 02:36:43 +00:00
feat: Add initial Tenant traits and data structures
All checks were successful
Run Check Script / check (push) Successful in 1m46s
Run Check Script / check (pull_request) Successful in 1m45s
895fb02f4e
johnride force-pushed feat/tenant from dc43be99fe to bf16566b4e 2025-05-29 11:26:03 +00:00 Compare
johnride reviewed 2025-05-29 15:40:52 +00:00
johnride left a comment
Author
Owner

BAD

BAD
@@ -0,0 +60,4 @@
/// * `tenant_name`: The logical name of the tenant to deprovision.
async fn deprovision_tenant(&self, tenant_name: &str) -> Result<(), ExecutorError>;
/// Lists the logical names of all tenants currently managed by this `TenantManager` instance.
Author
Owner

YAGNI

YAGNI
johnride marked this conversation as resolved
@@ -0,0 +8,4 @@
pub struct TenantConfig {
/// A unique, human-readable name for the tenant (e.g., "client-alpha", "project-phoenix").
/// This will be used as the primary identifier for management operations.
pub name: String,
Author
Owner

Tenant name can change. Our business context for this is typically a client or project name. Clients can change names, be bought, etc.

So, let's use an ID and have the name in addition for human-readable interactions.

Tenant name can change. Our business context for this is typically a client or project name. Clients can change names, be bought, etc. So, let's use an ID and have the name in addition for human-readable interactions.
johnride marked this conversation as resolved
@@ -0,0 +11,4 @@
pub name: String,
/// An optional description for the tenant.
pub description: Option<String>,
Author
Owner

YAGNI

YAGNI
johnride marked this conversation as resolved
@@ -0,0 +22,4 @@
/// Key-value pairs for provider-specific tagging, labeling, or metadata.
/// Useful for billing, organization, or filtering within the provider's console.
pub labels_or_tags: HashMap<String, String>,
// Note: User/group management for the tenant is deferred to a future ADR.
Author
Owner

Useless comments

Useless comments
johnride marked this conversation as resolved
@@ -0,0 +28,4 @@
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TenantContext {
Author
Owner

YAGNI

YAGNI
johnride marked this conversation as resolved
@@ -0,0 +58,4 @@
/// Total persistent storage allocation in Gigabytes across all volumes.
pub storage_total_gb: Option<u64>,
/// Maximum number of distinct persistent volumes/claims.
Author
Owner

Delete from here

Delete from here
johnride marked this conversation as resolved
johnride added 1 commit 2025-05-29 15:47:36 +00:00
chore: Fix pr comments, remove many YAGNI things
All checks were successful
Run Check Script / check (push) Successful in 1m46s
Run Check Script / check (pull_request) Successful in 1m46s
7cd541bdd8
johnride changed title from WIP: feat: Add initial Tenant traits and data structures to feat: Add initial Tenant traits and data structures 2025-05-29 15:48:37 +00:00
johnride merged commit e7917843bc into master 2025-05-29 15:51:37 +00:00
johnride deleted branch feat/tenant 2025-05-29 15:51:38 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NationTech/harmony#43
No description provided.