Skip to content

chore(frontend): Rename tenant to workspace#816

Merged
knutties merged 1 commit into
mainfrom
chore/tenant-rename
Jan 4, 2026
Merged

chore(frontend): Rename tenant to workspace#816
knutties merged 1 commit into
mainfrom
chore/tenant-rename

Conversation

@ayushjain17

@ayushjain17 ayushjain17 commented Jan 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Updated internal terminology and API naming conventions from "tenant" to "workspace" across the application architecture for improved consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@ayushjain17 ayushjain17 requested a review from a team as a code owner January 3, 2026 13:05
@semanticdiff-com

semanticdiff-com Bot commented Jan 3, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/frontend/src/components/experiment_action_form.rs  92% smaller
  crates/frontend/src/components/experiment_ramp_form.rs  89% smaller
  crates/frontend/src/pages/compare_overrides.rs  79% smaller
  crates/frontend/src/pages/experiment_groups.rs  72% smaller
  crates/frontend/src/api.rs  60% smaller
  crates/frontend/src/components/context_form.rs  56% smaller
  crates/frontend/src/pages/context_override.rs  56% smaller
  crates/frontend/src/components/function_form/utils.rs  49% smaller
  crates/frontend/src/components/type_template_form/utils.rs  49% smaller
  crates/frontend/src/pages/experiment_list.rs  48% smaller
  crates/frontend/src/pages/context_override/utils.rs  44% smaller
  crates/frontend/src/components/function_form.rs  31% smaller
  crates/frontend/src/components/experiment_form/utils.rs  29% smaller
  crates/frontend/src/components/experiment_conclude_form/utils.rs  28% smaller
  crates/frontend/src/components/type_template_form.rs  21% smaller
  crates/frontend/src/components/dimension_form.rs  16% smaller
  crates/frontend/src/components/default_config_form/utils.rs  7% smaller
  crates/frontend/src/components/variant_form.rs  6% smaller
  crates/frontend/src/components/override_form.rs  4% smaller
  crates/frontend/src/components/side_nav.rs  3% smaller
  crates/frontend/src/components/experiment_ramp_form/utils.rs  2% smaller
  crates/frontend/src/pages/function/utils.rs  2% smaller
  crates/frontend/src/components/experiment_form.rs  1% smaller
  crates/frontend/src/hoc/layout.rs  1% smaller
  crates/frontend/src/pages/dimension.rs  1% smaller
  crates/frontend/src/app.rs  0% smaller
  crates/frontend/src/components/cohort_schema.rs  0% smaller
  crates/frontend/src/components/default_config_form.rs  0% smaller
  crates/frontend/src/components/experiment_conclude_form.rs  0% smaller
  crates/frontend/src/components/experiment_group_form.rs  0% smaller
  crates/frontend/src/components/variable_form.rs  0% smaller
  crates/frontend/src/components/webhook_form.rs  0% smaller
  crates/frontend/src/pages/audit_log.rs  0% smaller
  crates/frontend/src/pages/config_version.rs  0% smaller
  crates/frontend/src/pages/config_version_list.rs  0% smaller
  crates/frontend/src/pages/default_config.rs  0% smaller
  crates/frontend/src/pages/default_config_list.rs  0% smaller
  crates/frontend/src/pages/dimensions.rs  0% smaller
  crates/frontend/src/pages/experiment.rs  0% smaller
  crates/frontend/src/pages/experiment_group_listing.rs  0% smaller
  crates/frontend/src/pages/function.rs  0% smaller
  crates/frontend/src/pages/function/function_create.rs  0% smaller
  crates/frontend/src/pages/function/function_list.rs  0% smaller
  crates/frontend/src/pages/function/publish_form.rs  0% smaller
  crates/frontend/src/pages/home.rs  0% smaller
  crates/frontend/src/pages/type_template.rs  0% smaller
  crates/frontend/src/pages/type_templates.rs  0% smaller
  crates/frontend/src/pages/variable.rs  0% smaller
  crates/frontend/src/pages/variables_list.rs  0% smaller
  crates/frontend/src/pages/webhook.rs  0% smaller
  crates/frontend/src/pages/webhooks.rs  0% smaller
  crates/frontend/src/types.rs  0% smaller
  crates/frontend/src/utils.rs  0% smaller

@coderabbitai

coderabbitai Bot commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR systematically renames "tenant" to "workspace" throughout the frontend codebase. Changes include parameter renaming in public API functions, HTTP header updates from x-tenant to x-workspace, type definition changes (Tenant → Workspace), and context retrieval updates across components and pages.

Changes

Cohort / File(s) Summary
Type Definitions and Core Exports
crates/frontend/src/types.rs
Public type Tenant(pub String) renamed to Workspace(pub String). Core type definition change affecting all downstream imports and usages.
Public API Layer
crates/frontend/src/api.rs
Updated 40+ function signatures across multiple modules (config, dimensions, experiments, functions, contexts, webhooks, variables, experiment groups, audit logs). All parameters changed from tenant: &str or tenant: String to workspace: &str. HTTP headers updated from x-tenant to x-workspace in all request construction calls.
Layout and Context Provision
crates/frontend/src/hoc/layout.rs
Public function use_tenant() renamed to use_workspace(), returning Signal<Workspace>. Context key changed from "tenant" to "workspace" with default "no-workspace".
Routing
crates/frontend/src/app.rs
Admin route dynamic segment changed from :tenant to :workspace in path /admin/:org_id/:workspace.
Components - Form Handlers
crates/frontend/src/components/cohort_schema.rs, context_form.rs, default_config_form.rs, dimension_form.rs, experiment_action_form.rs, experiment_conclude_form.rs, experiment_form.rs, experiment_group_form.rs, experiment_ramp_form.rs, function_form.rs, override_form.rs, type_template_form.rs, variable_form.rs, variant_form.rs, webhook_form.rs
Updated context retrieval from Signal<Tenant> to Signal<Workspace>. Updated imports and internal variable usage to reference new Workspace type. Function calls adjusted to pass workspace references instead of tenant values.
Component Utilities
crates/frontend/src/components/default_config_form/utils.rs, experiment_conclude_form/utils.rs, experiment_form/utils.rs, experiment_ramp_form/utils.rs, function_form/utils.rs, type_template_form/utils.rs
Function signatures updated: parameters changed from tenant: String to workspace: &str. HTTP header construction updated from ("x-tenant", ...) to ("x-workspace", ...). Parameter types adjusted from String to &str for both workspace and org_id.
Navigation
crates/frontend/src/components/side_nav.rs
Private function create_routes updated to accept workspace: &str instead of tenant: &str. Route keys and path templates updated from using {tenant} to {workspace}. Context retrieval updated to Signal<Workspace>.
Pages - List Views
crates/frontend/src/pages/audit_log.rs, config_version_list.rs, default_config_list.rs, dimensions.rs, experiment_group_listing.rs, experiment_list.rs, function/function_list.rs, variables_list.rs, webhooks.rs
Import and context usage updated from Tenant to Workspace. Changed use_context::<Signal<Tenant>>() to use_context::<Signal<Workspace>>(). Structural logic remains unchanged.
Pages - Detail Views
crates/frontend/src/pages/compare_overrides.rs, config_version.rs, context_override.rs, default_config.rs, dimension.rs, experiment.rs, experiment_groups.rs, function.rs, function/function_create.rs, function/publish_form.rs, home.rs, type_template.rs, type_templates.rs, variable.rs, webhook.rs
Context type updated from Signal<Tenant> to Signal<Workspace>. Import paths updated to use Workspace instead of Tenant. API calls adjusted to pass workspace references. URL construction and parameter passing updated to use workspace identifiers.
Page Utilities
crates/frontend/src/pages/context_override/utils.rs, function/utils.rs
Function signatures updated: create_context and update_context parameters changed from tenant: String to workspace: &str. Header construction updated from "x-tenant" to "x-workspace". publish_function parameter renamed from tenant: &str to workspace: &str.
Utility Functions
crates/frontend/src/utils.rs
Function value_compute_fn_generator parameter renamed from tenant: String to workspace: String. Internal binding updated to use workspace.clone().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • feat: AuthZ setup #543 — Workspace/authorization work that modifies the same frontend API layer and context types, making coordinate verification necessary.

Suggested reviewers

  • knutties

Poem

🐰 A workspace by any other name,
Still holds the same config game,
With headers renamed, types refined,
The tenant's gone—new workspace aligned!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.17% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the primary change: a comprehensive refactoring that renames all occurrences of 'tenant' to 'workspace' throughout the frontend codebase.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08b03e0 and 55930b2.

📒 Files selected for processing (53)
  • crates/frontend/src/api.rs
  • crates/frontend/src/app.rs
  • crates/frontend/src/components/cohort_schema.rs
  • crates/frontend/src/components/context_form.rs
  • crates/frontend/src/components/default_config_form.rs
  • crates/frontend/src/components/default_config_form/utils.rs
  • crates/frontend/src/components/dimension_form.rs
  • crates/frontend/src/components/experiment_action_form.rs
  • crates/frontend/src/components/experiment_conclude_form.rs
  • crates/frontend/src/components/experiment_conclude_form/utils.rs
  • crates/frontend/src/components/experiment_form.rs
  • crates/frontend/src/components/experiment_form/utils.rs
  • crates/frontend/src/components/experiment_group_form.rs
  • crates/frontend/src/components/experiment_ramp_form.rs
  • crates/frontend/src/components/experiment_ramp_form/utils.rs
  • crates/frontend/src/components/function_form.rs
  • crates/frontend/src/components/function_form/utils.rs
  • crates/frontend/src/components/override_form.rs
  • crates/frontend/src/components/side_nav.rs
  • crates/frontend/src/components/type_template_form.rs
  • crates/frontend/src/components/type_template_form/utils.rs
  • crates/frontend/src/components/variable_form.rs
  • crates/frontend/src/components/variant_form.rs
  • crates/frontend/src/components/webhook_form.rs
  • crates/frontend/src/hoc/layout.rs
  • crates/frontend/src/pages/audit_log.rs
  • crates/frontend/src/pages/compare_overrides.rs
  • crates/frontend/src/pages/config_version.rs
  • crates/frontend/src/pages/config_version_list.rs
  • crates/frontend/src/pages/context_override.rs
  • crates/frontend/src/pages/context_override/utils.rs
  • crates/frontend/src/pages/default_config.rs
  • crates/frontend/src/pages/default_config_list.rs
  • crates/frontend/src/pages/dimension.rs
  • crates/frontend/src/pages/dimensions.rs
  • crates/frontend/src/pages/experiment.rs
  • crates/frontend/src/pages/experiment_group_listing.rs
  • crates/frontend/src/pages/experiment_groups.rs
  • crates/frontend/src/pages/experiment_list.rs
  • crates/frontend/src/pages/function.rs
  • crates/frontend/src/pages/function/function_create.rs
  • crates/frontend/src/pages/function/function_list.rs
  • crates/frontend/src/pages/function/publish_form.rs
  • crates/frontend/src/pages/function/utils.rs
  • crates/frontend/src/pages/home.rs
  • crates/frontend/src/pages/type_template.rs
  • crates/frontend/src/pages/type_templates.rs
  • crates/frontend/src/pages/variable.rs
  • crates/frontend/src/pages/variables_list.rs
  • crates/frontend/src/pages/webhook.rs
  • crates/frontend/src/pages/webhooks.rs
  • crates/frontend/src/types.rs
  • crates/frontend/src/utils.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-03T10:25:34.298Z
Learnt from: ayushjain17
Repo: juspay/superposition PR: 814
File: crates/superposition_types/src/api/workspace.rs:70-77
Timestamp: 2026-01-03T10:25:34.298Z
Learning: The `auto_populate_control` field in `CreateWorkspaceRequest` (`crates/superposition_types/src/api/workspace.rs`) is expected to default to `true`, not `false`. This is implemented using `#[serde(default = "default_true")]`.

Applied to files:

  • crates/frontend/src/pages/default_config_list.rs
  • crates/frontend/src/pages/default_config.rs
  • crates/frontend/src/components/default_config_form/utils.rs
  • crates/frontend/src/components/variant_form.rs
  • crates/frontend/src/components/default_config_form.rs
🧬 Code graph analysis (28)
crates/frontend/src/pages/config_version_list.rs (1)
crates/frontend/src/api.rs (3)
  • fetch_all (72-92)
  • fetch_all (469-485)
  • fetch_all (1025-1051)
crates/frontend/src/pages/variables_list.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/experiment_ramp_form/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/components/experiment_conclude_form/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/pages/function/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/components/default_config_form/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/pages/experiment_group_listing.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/dimension_form.rs (2)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/pages/dimensions.rs (1)
  • dimensions (25-145)
crates/frontend/src/pages/audit_log.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/experiment_form.rs (3)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/api.rs (3)
  • fetch_all (72-92)
  • fetch_all (469-485)
  • fetch_all (1025-1051)
crates/frontend/src/components/experiment_form/utils.rs (1)
  • update_experiment (90-108)
crates/frontend/src/components/type_template_form/utils.rs (1)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/frontend/src/components/experiment_action_form.rs (2)
crates/frontend/src/api.rs (3)
  • pause_experiment (674-696)
  • resume_experiment (698-720)
  • discard_experiment (722-744)
crates/frontend/src/components/experiment_ramp_form/utils.rs (1)
  • ramp_experiment (10-36)
crates/frontend/src/components/experiment_form/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/pages/context_override.rs (2)
crates/frontend/src/pages/context_override/utils.rs (1)
  • update_context (69-85)
crates/frontend/src/api.rs (1)
  • get_context (746-763)
crates/frontend/src/components/experiment_ramp_form.rs (1)
crates/frontend/src/components/experiment_ramp_form/utils.rs (1)
  • ramp_experiment (10-36)
crates/frontend/src/pages/webhook.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/pages/webhooks.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/pages/experiment_list.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/function_form/utils.rs (2)
crates/frontend/src/utils.rs (1)
  • construct_request_headers (202-217)
crates/service_utils/src/helpers.rs (1)
  • construct_request_headers (315-330)
crates/frontend/src/pages/variable.rs (2)
crates/context_aware_config/src/api/variables/handlers.rs (1)
  • variables (139-142)
crates/frontend/src/api.rs (2)
  • get (148-168)
  • get (948-968)
crates/frontend/src/pages/experiment_groups.rs (2)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/api.rs (22)
  • None (57-57)
  • None (83-83)
  • None (105-105)
  • None (137-137)
  • None (159-159)
  • None (245-245)
  • None (268-268)
  • None (295-295)
  • None (320-320)
  • None (339-339)
  • None (364-364)
  • None (390-390)
  • None (410-410)
  • None (429-429)
  • None (442-442)
  • None (623-623)
  • fetch (94-114)
  • fetch (126-146)
  • fetch (889-914)
  • fetch (1053-1069)
  • fetch (1219-1245)
  • fetch_experiments (276-301)
crates/frontend/src/pages/dimension.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/webhook_form.rs (3)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/superposition_sdk/src/operation/list_experiment/_list_experiment_input.rs (2)
  • org_id (57-59)
  • org_id (201-204)
crates/superposition_sdk/src/operation/list_experiment/builders.rs (1)
  • org_id (156-159)
crates/frontend/src/pages/compare_overrides.rs (2)
crates/frontend/src/pages/compare_overrides/types.rs (2)
  • from (59-61)
  • from (65-74)
crates/frontend/src/api.rs (1)
  • resolve_config (650-672)
crates/frontend/src/pages/type_templates.rs (1)
crates/frontend/src/pages/workspace.rs (1)
  • workspace (28-285)
crates/frontend/src/components/function_form.rs (1)
crates/frontend/src/components/function_form/utils.rs (1)
  • test_function (79-98)
crates/frontend/src/pages/context_override/utils.rs (2)
crates/frontend/src/utils.rs (3)
  • construct_request_headers (202-217)
  • use_host_server (60-69)
  • request (295-305)
crates/frontend/src/api.rs (3)
  • request (455-455)
  • request (476-476)
  • request (1039-1039)
crates/frontend/src/api.rs (2)
crates/frontend/src/utils.rs (6)
  • construct_request_headers (202-217)
  • parse_json_response (219-228)
  • response (223-223)
  • response (266-267)
  • response (282-283)
  • use_host_server (60-69)
crates/service_utils/src/helpers.rs (2)
  • construct_request_headers (315-330)
  • response (351-351)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Provider Tests (js)
  • GitHub Check: Provider Tests (rust)
  • GitHub Check: Provider Tests (py)
  • GitHub Check: Provider Tests (kotlin)
  • GitHub Check: Check formatting
🔇 Additional comments (100)
crates/frontend/src/components/cohort_schema.rs (2)

17-17: LGTM: Import updated correctly.

The import statement has been correctly updated from Tenant to Workspace, aligning with the systematic rename across the frontend.


419-419: Context migration to Signal is consistent and complete.

The change has been applied correctly across the codebase. Signal is properly defined as a newtype tuple struct wrapping String, and the usage pattern workspace.get().0 on line 549 correctly accesses the inner String value, consistent with how org_id is accessed on line 550. No remaining Signal references were found, and the context provider in crates/frontend/src/hoc/layout.rs properly supplies Signal to all consuming components.

crates/frontend/src/components/experiment_group_form.rs (6)

30-30: Import updated correctly.

The import has been correctly updated from Tenant to Workspace, aligning with the PR's renaming objective.


38-39: Context retrieval updated correctly.

The context type has been properly updated to Signal<Workspace>, maintaining consistency with the rename.


181-206: Context and variable handling updated correctly.

The context type and variable extraction have been properly updated. The use of get_untracked() is appropriate in this closure context to avoid unnecessary reactivity tracking.


216-253: API calls updated consistently.

The update and create API calls have been updated to pass the workspace reference, maintaining consistency with the add_members call pattern.


440-446: Context and resource creation updated correctly.

The context retrieval and resource creation have been properly updated. The workspace is correctly included in the resource's dependency tracking, ensuring the resource re-fetches when the workspace changes.


49-76: Variable rename and API call updated correctly.

The variable has been renamed from tenant to workspace, and the API call to add_members has been updated to pass the workspace reference. The Workspace type is a tuple struct wrapping a String, so extracting with .0 yields a String that can be passed as &str to the add_members function. The code is consistent and correct.

crates/frontend/src/pages/default_config_list.rs (1)

33-44: LGTM! Type migration from Tenant to Workspace is consistent.

The import and context usage have been correctly updated to use Workspace instead of Tenant. The access pattern (workspace.get().0) continues to work correctly since Workspace maintains the same Deref structure.

crates/frontend/src/types.rs (1)

177-177: LGTM! Clean type rename with preserved functionality.

The type definition change from Tenant to Workspace is straightforward and maintains the same structure and derives. The Deref and DerefMut traits ensure existing access patterns continue to work correctly.

crates/frontend/src/components/variable_form.rs (2)

23-52: LGTM! Workspace context integration is correct.

The import and context usage in variable_form have been properly updated to use Workspace. Both functions in this file consistently retrieve and use the workspace context.


219-219: LGTM! Second function also correctly updated.

The change_log_summary component properly uses the Workspace context type, maintaining consistency with the first function in this file.

crates/frontend/src/pages/variables_list.rs (1)

32-139: LGTM! Variables list correctly migrated to Workspace.

The import and context usage have been properly updated. The variable naming (workspace_id at line 159) also aligns well with the new workspace terminology.

crates/frontend/src/pages/type_templates.rs (1)

21-32: No review comment provided. Please provide the review comment within <review_comment> tags to proceed with the rewriting task.

crates/frontend/src/components/experiment_ramp_form/utils.rs (1)

10-35: LGTM!

The parameter rename from tenant to workspace and the corresponding header change from x-tenant to x-workspace are correctly implemented. The function signature and header construction are consistent with the broader workspace migration.

crates/frontend/src/components/experiment_ramp_form.rs (1)

13-46: LGTM!

The migration from Tenant to Workspace is consistently applied:

  • Import updated correctly
  • Context retrieval uses Signal<Workspace>
  • Variable naming and function call arguments properly updated
crates/frontend/src/components/default_config_form/utils.rs (2)

14-47: LGTM!

The create_default_config function correctly migrates to workspace-based parameters and headers. The signature change to accept &str references instead of owned String for org_id is a nice improvement for avoiding unnecessary allocations at call sites.


67-85: LGTM!

The update_default_config function is consistently updated with the workspace parameter and x-workspace header, matching the pattern established in create_default_config.

crates/frontend/src/hoc/layout.rs (2)

18-25: LGTM!

The use_workspace() function correctly derives the workspace signal from the URL params. The param key change to "workspace" and default value "no-workspace" are appropriately updated to match the new naming convention.


53-58: LGTM!

The layout component correctly uses use_workspace() and provides the Workspace signal to the context for downstream components.

crates/frontend/src/components/experiment_conclude_form/utils.rs (1)

17-40: LGTM!

The conclude_experiment function is correctly updated with the workspace parameter and x-workspace header, following the same pattern as other API utility functions in this PR.

crates/frontend/src/components/experiment_conclude_form.rs (2)

13-40: LGTM!

The component correctly migrates to use Workspace context and passes the workspace value to conclude_experiment. The pattern is consistent with other components in this PR.


65-76: LGTM!

The handle_discard_experiment handler correctly extracts the workspace value and passes it to discard_experiment, maintaining consistency with the conclude handler above.

crates/frontend/src/components/experiment_form/utils.rs (2)

30-68: LGTM!

The create_experiment function is correctly updated with workspace-based parameters and the x-workspace header. The signature change to accept &str references is consistent with other utility functions in this PR.


90-108: LGTM!

The update_experiment function follows the same workspace migration pattern, with consistent parameter types and header construction.

crates/frontend/src/components/function_form/utils.rs (3)

17-47: LGTM! Clean refactor with efficiency improvement.

The function signature and header changes are consistent with the workspace rename. The parameter type change from owned String to borrowed &str is an improvement that avoids unnecessary allocations.


50-77: LGTM! Consistent changes applied.

The update_function signature and headers are properly updated to match the workspace rename pattern.


79-98: LGTM! All function headers updated consistently.

The test_function properly uses the new workspace parameter and x-workspace header.

crates/frontend/src/components/variant_form.rs (3)

25-25: LGTM! Import updated correctly.

The import properly reflects the Workspace type rename.


59-114: LGTM! Context and resource properly updated.

The workspace context signal and the resolved_config_resource are correctly updated to use Workspace instead of Tenant. The workspace parameter is properly passed to resolve_config.


627-686: LGTM! Consistent workspace usage in delete_variant_form.

The delete_variant_form component properly retrieves and uses the workspace context, passing it correctly to get_context_from_condition and resolve_config.

crates/frontend/src/components/type_template_form/utils.rs (3)

12-38: LGTM! Workspace parameter and header properly updated.

The create_type function signature and headers are correctly updated to use workspace instead of tenant.


51-68: LGTM! Update function properly refactored.

The update_type function is consistently updated with the workspace parameter and x-workspace header.


70-88: LGTM! Delete function updated with explicit payload type.

The explicit let payload: Option<()> = None; annotation (line 78) helps the compiler with type inference for the generic request function. This is a clean pattern for DELETE requests with no body.

crates/frontend/src/pages/config_version_list.rs (2)

17-17: LGTM! Import updated to Workspace.

The import correctly reflects the type rename from Tenant to Workspace.


24-44: LGTM! Context signal properly updated.

The workspace context signal is correctly retrieved and used in the resource dependency tuple, maintaining the same behavior with the new Workspace type.

crates/frontend/src/pages/function.rs (2)

32-32: LGTM! Import updated to Workspace.

The import properly reflects the type rename.


91-115: LGTM! Function page context properly updated.

The function_page component correctly retrieves and uses the workspace context signal, passing it to fetch_function consistently with the refactor.

crates/frontend/src/pages/config_version.rs (1)

9-9: LGTM! Workspace type migration is correct.

The import and context type updates are consistent with the PR-wide migration from Tenant to Workspace.

Also applies to: 13-13

crates/frontend/src/pages/experiment_list.rs (1)

38-38: LGTM! Context type update is correct.

The Workspace type usage is consistent with the broader PR migration from Tenant to Workspace.

Also applies to: 51-51

crates/frontend/src/components/context_form.rs (1)

16-16: LGTM! Workspace context usage is correct.

The type updates from Tenant to Workspace are consistent with the systematic rename across the frontend codebase.

Also applies to: 255-256

crates/frontend/src/pages/function/utils.rs (1)

38-43: Function signature update is correct.

The parameter rename from tenant to workspace aligns with the PR objective and is consistent across the codebase. All callers have been properly updated: the invocation in publish_form.rs (line 32) correctly passes the workspace parameter, and no remaining tenant references exist in the function context.

crates/frontend/src/app.rs (1)

132-132: Route parameter rename is complete but maintains backward compatibility.

The route path update from :tenant to :workspace in app.rs line 132 is properly applied. However, this is not a breaking change—the codebase maintains backward compatibility through fallback chains in crates/service_utils/src/extensions.rs (lines 47-51), which still accept the old {tenant} path parameter, x-tenant header, and tenant query parameter. Old URLs will continue to work via these fallbacks.

crates/frontend/src/pages/function/function_create.rs (1)

8-8: LGTM! Clean type substitution.

The import and context retrieval have been correctly updated from Tenant to Workspace, and the usage at line 30 correctly accesses the workspace value via .get().0.

Also applies to: 18-18, 30-30

crates/frontend/src/pages/experiment_group_listing.rs (1)

48-48: LGTM! Consistent type updates.

The import and context retrieval have been correctly updated from Tenant to Workspace. All downstream usages throughout the file (lines 244, 251-252, 256, 287) correctly reference the renamed workspace signal.

Also applies to: 222-222

crates/frontend/src/pages/experiment.rs (1)

26-26: LGTM! Correct context type update.

The import and context retrieval have been properly updated to use Workspace. The value extraction pattern at line 55 correctly accesses the workspace identifier via .get().0.

Also applies to: 52-55

crates/frontend/src/pages/dimensions.rs (1)

22-22: LGTM! Straightforward type substitution.

The import and context retrieval have been correctly updated to use Workspace, and all subsequent usages are consistent with the new type.

Also applies to: 26-27, 35-37

crates/frontend/src/utils.rs (1)

335-376: Parameter rename verified across all call sites.

The workspace parameter is correctly used in the function signature and all three call sites have been properly updated to pass the workspace value: context_form.rs:285, cohort_schema.rs:544, and override_form.rs:199.

crates/frontend/src/pages/function/function_list.rs (1)

17-17: LGTM! Workspace context usage is correct.

The changes consistently update from Tenant to Workspace throughout the file. The workspace value is correctly extracted using .0 (line 47) before being passed to fetch_functions.

Also applies to: 29-29, 47-47, 55-55

crates/frontend/src/pages/variable.rs (1)

17-17: LGTM! Workspace rename is consistent.

The context type, parameter names, and API call have been correctly updated from Tenant to Workspace. The blocking resource properly extracts the workspace value and passes it to the API.

Also applies to: 47-47, 58-60

crates/frontend/src/components/experiment_action_form.rs (1)

12-12: LGTM! Workspace context correctly extracted and used.

The changes properly update from Tenant to Workspace. Line 79 correctly uses .0 to extract the inner string value, which is then consistently passed to all experiment action APIs (pause, resume, discard, ramp).

Also applies to: 30-30, 79-79, 84-119

crates/frontend/src/pages/function/publish_form.rs (1)

8-8: LGTM! Workspace extraction and usage is correct.

The file correctly updates from Tenant to Workspace and properly extracts the inner string value using .0 on line 29 before passing it to the publish function API.

Also applies to: 17-17, 29-36

crates/frontend/src/pages/audit_log.rs (1)

27-27: LGTM!

The import and context type changes from Tenant to Workspace are consistent with the PR's renaming objective. The variable naming (workspace) and usage throughout the component align well with the updated type.

Also applies to: 156-156

crates/frontend/src/pages/webhooks.rs (1)

28-28: LGTM!

The Tenant to Workspace migration is correctly applied. The context retrieval, variable naming, and API call patterns are consistent with the rest of the PR.

Also applies to: 39-39

crates/frontend/src/pages/compare_overrides.rs (1)

38-38: LGTM!

The migration from Tenant to Workspace is correctly implemented throughout this file. The source closure, resource creation, and resolve_config API call all properly use the renamed workspace variable and type.

Also applies to: 109-109, 139-147, 155-155

crates/frontend/src/components/dimension_form.rs (2)

621-621: LGTM!

The Workspace context type change in change_log_summary is correct, and the usage pattern (extracting .0 before passing to API) at line 625 is consistent with other files in this PR.


158-159: No issue found. The code is correct as written.

The dimensions::update and dimensions::create functions expect &str for workspace and org_id parameters. Both Workspace and OrganisationId are newtype structs with #[derive(Deref, DerefMut)], which implements automatic deref coercion. When you pass &workspace where &str is expected, Rust's deref coercion automatically converts &Workspace&String&str. This is idiomatic Rust and requires no changes to the code.

Likely an incorrect or invalid review comment.

crates/frontend/src/pages/webhook.rs (1)

22-22: LGTM!

The import, context type, and resource usage correctly implement the Tenant to Workspace migration. The resource correctly extracts .0 for the API call.

Also applies to: 115-115, 125-125

crates/frontend/src/pages/default_config.rs (2)

20-20: LGTM!

The import, context type, and resource usage correctly implement the Tenant to Workspace migration.

Also applies to: 127-127, 136-136


149-150: The review comment contains an incorrect premise.

The delete_default_config function signature (crates/frontend/src/api.rs:418-422) actually accepts &str for both workspace and org_id parameters, not wrapper types. The code at lines 149-150 is correct—it calls .get_untracked() on the wrapper types to extract the &str values, which is the appropriate pattern. No changes needed.

Likely an incorrect or invalid review comment.

crates/frontend/src/components/override_form.rs (1)

16-16: LGTM!

The migration from Tenant to Workspace is correctly implemented. Notably, this file properly extracts the inner string values (.0) when passing to value_compute_fn_generator, which is the correct pattern.

Also applies to: 192-193, 204-205

crates/frontend/src/components/function_form.rs (1)

263-306: LGTM!

The context extraction and API call updates in edit_form correctly migrate from Tenant to Workspace. The pattern of extracting workspace.get_untracked().0 and passing it by reference to create_function and update_function is consistent with the PR's approach.

crates/frontend/src/components/webhook_form.rs (2)

74-75: LGTM!

The webhook_form component correctly migrates to Workspace context. The extraction pattern (workspace.get_untracked().0) and reference passing (&workspace, &org_id) to update_webhook and create_webhook are consistent.

Also applies to: 111-112, 121-123, 156-158


372-380: LGTM!

The change_log_summary component correctly uses Signal<Workspace> and passes workspace/org values to get_webhook.

crates/frontend/src/components/default_config_form.rs (2)

542-550: LGTM!

The change_log_summary component correctly extracts workspace.get().0 and org.get().0 for the resource creation, which is consistent with passing string values.


140-141: This review comment is incorrect. Both Workspace and OrganisationId derive the Deref trait, which enables automatic deref coercion. Passing &workspace and &org to functions expecting &str is valid Rust and requires no changes. The suggested .0 extraction is unnecessary.

Likely an incorrect or invalid review comment.

crates/frontend/src/pages/type_template.rs (1)

62-77: LGTM!

The context extraction and resource creation correctly use workspace.get().0 for string extraction. The URL construction on line 94 also correctly uses .0 to get the string values.

Also applies to: 90-95

crates/frontend/src/components/side_nav.rs (2)

10-86: LGTM!

The create_routes function parameter correctly renamed from tenant to workspace, and all route path templates consistently use {workspace} placeholder. The migration is complete and consistent.


93-93: LGTM!

The workspace selector and side nav components correctly:

  • Extract Signal<Workspace> context
  • Use :workspace as the route template token
  • Replace :workspace in redirect URLs
  • Pass &workspace.get().0 to create_routes

Also applies to: 112-112, 183-184, 317-320

crates/frontend/src/components/experiment_form.rs (2)

98-99: LGTM!

The experiment_form component correctly migrates to Workspace:

  • Context extraction uses Signal<Workspace>
  • Resource closure correctly destructures (workspace, org) and passes references to API calls
  • The on_submit handler correctly extracts workspace.get_untracked().0 before passing &workspace to API functions

Also applies to: 115-127, 156-157, 172-172, 201-202


386-394: LGTM!

The change_log_summary component correctly uses Signal<Workspace> and extracts workspace.get().0 for the resource creation.

crates/frontend/src/pages/experiment_groups.rs (2)

160-161: LGTM!

The experiment_groups page correctly migrates to Workspace:

  • Context extraction uses Signal<Workspace>
  • The source closure extracts workspace.get().0 and returns it in the tuple
  • Resource closure correctly passes &workspace and &org_id to fetch and fetch_experiments

Also applies to: 167-172, 178-200


202-240: LGTM!

The confirm_delete callback correctly extracts workspace.get().0 and passes &workspace to remove_members.

crates/frontend/src/pages/dimension.rs (4)

24-24: LGTM - Import updated correctly.

The import is correctly updated from Tenant to Workspace to align with the type rename.


274-275: LGTM - Context type updated correctly.

The context retrieval is correctly updated to use Signal<Workspace> instead of Signal<Tenant>.


385-386: LGTM - Context type updated correctly in edit_dimension.

The context retrieval is correctly updated to use Signal<Workspace>.


295-300: The type compatibility is actually correct as written. Both Workspace and OrganisationId derive the Deref trait, which enables automatic deref coercion. This means &Workspace automatically dereferences to &String, and then coerces to &str to match the dimensions::delete function signature. The suggested .0 extraction is unnecessary.

Likely an incorrect or invalid review comment.

crates/frontend/src/pages/home.rs (2)

22-22: LGTM - Import updated correctly.

The import is correctly updated to use Workspace from the types module.


154-168: LGTM - Context and resource creation updated correctly.

The workspace context retrieval and the fetch_config call are correctly updated. The pattern of extracting the inner String via .0 and passing it to the API is consistent and correct.

crates/frontend/src/pages/context_override/utils.rs (2)

32-53: LGTM - create_context signature and headers updated correctly.

The function signature is correctly updated to accept workspace: &str and the header construction now uses "x-workspace" instead of "x-tenant". This aligns with the broader tenant-to-workspace migration.


69-85: LGTM - update_context signature and headers updated correctly.

The function signature and header construction are consistently updated to use workspace terminology.

crates/frontend/src/pages/context_override.rs (6)

57-57: LGTM - Import updated correctly.

The import is correctly updated to include Workspace from the types module.


99-99: LGTM - Context type updated correctly.

The form component correctly retrieves the workspace context as Signal<Workspace>.


116-153: Verify type compatibility for API calls.

At lines 120-121, workspace and org are assigned the Workspace and OrganisationId tuple struct values. However, update_context (line 124) and create_context (lines 148-149) expect &str parameters.

Unless Workspace and OrganisationId implement Deref<Target=str> or AsRef<str>, this would be a type mismatch. Consider extracting the inner String:

🔎 Suggested fix
-let workspace = workspace.get_untracked();
-let org = org.get_untracked();
+let workspace = workspace.get_untracked().0;
+let org = org.get_untracked().0;
 let result = match (edit_id.get_value(), update_request_rws.get_untracked()) {
     (Some(_), Some((_, payload))) => {
-        let future = update_context(payload, &workspace, &org);
+        let future = update_context(payload, &workspace, &org);

242-260: LGTM - use_context_data updated correctly.

The function correctly uses Signal<Workspace> and extracts the inner strings via .0 for the API call at line 251.


383-386: LGTM - Context type updated correctly.

The context_override component correctly retrieves the workspace context.


484-489: LGTM - Redirect URL construction updated correctly.

The URL construction correctly extracts the workspace string via .0 for building the redirect path.

crates/frontend/src/api.rs (13)

40-63: LGTM - fetch_default_config updated correctly.

The function signature and header construction are correctly updated to use workspace parameter and "x-workspace" header.


72-115: LGTM - snapshots module updated correctly.

Both fetch_all and fetch functions are correctly updated with the workspace parameter and header changes.


126-254: LGTM - dimensions module updated correctly.

All dimension-related functions (fetch, get, create, update, delete) are consistently updated with the workspace parameter and "x-workspace" header.


257-274: LGTM - delete_context updated correctly.

The function signature and header are correctly updated.


276-301: LGTM - fetch_experiments updated correctly.

The function signature and header are correctly updated.


303-370: LGTM - fetch_functions, fetch_function, and fetch_config updated correctly.

All three functions are consistently updated with the workspace parameter changes.


372-464: LGTM - Context and config functions updated correctly.

The fetch_context, fetch_experiment, delete_default_config, and fetch_types functions are all correctly updated.


553-648: LGTM - Webhook functions updated correctly.

The create_webhook, update_webhook, fetch_webhooks, and delete_webhooks functions are consistently updated with workspace parameter and header changes.


650-744: LGTM - Config resolution and experiment state functions updated correctly.

The resolve_config, pause_experiment, resume_experiment, and discard_experiment functions are all correctly updated.


746-881: LGTM - Context and utility functions updated correctly.

The get_context, get_context_from_condition, execute_value_compute_function, get_default_config, get_type_template, and get_webhook functions are all consistently updated.


883-1014: LGTM - variables module updated correctly.

All variable-related functions (fetch, create, get, update, delete) are consistently updated with the workspace parameter and header changes.


1016-1210: LGTM - experiment_groups module updated correctly.

All experiment group functions (fetch_all, fetch, create, update, delete, add_members, remove_members) are consistently updated.


1212-1246: LGTM - audit_log module updated correctly.

The fetch function is correctly updated with the workspace parameter and header changes.

Comment thread crates/frontend/src/components/function_form.rs Outdated
Comment thread crates/frontend/src/components/type_template_form.rs
Comment thread crates/frontend/src/pages/function/utils.rs
Comment thread crates/frontend/src/pages/type_template.rs
Comment thread crates/frontend/src/pages/webhook.rs

@knutties knutties left a comment

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.

Nice comprehensive work !!

Only thing we could have done better is to call out the x-workspace param as x-workspace-id for consistency in naming all the id parameters.

@knutties knutties merged commit e7a0eda into main Jan 4, 2026
19 checks passed
@knutties knutties deleted the chore/tenant-rename branch January 4, 2026 14:28
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