chore(frontend): Rename tenant to workspace#816
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR systematically renames "tenant" to "workspace" throughout the frontend codebase. Changes include parameter renaming in public API functions, HTTP header updates from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (53)
crates/frontend/src/api.rscrates/frontend/src/app.rscrates/frontend/src/components/cohort_schema.rscrates/frontend/src/components/context_form.rscrates/frontend/src/components/default_config_form.rscrates/frontend/src/components/default_config_form/utils.rscrates/frontend/src/components/dimension_form.rscrates/frontend/src/components/experiment_action_form.rscrates/frontend/src/components/experiment_conclude_form.rscrates/frontend/src/components/experiment_conclude_form/utils.rscrates/frontend/src/components/experiment_form.rscrates/frontend/src/components/experiment_form/utils.rscrates/frontend/src/components/experiment_group_form.rscrates/frontend/src/components/experiment_ramp_form.rscrates/frontend/src/components/experiment_ramp_form/utils.rscrates/frontend/src/components/function_form.rscrates/frontend/src/components/function_form/utils.rscrates/frontend/src/components/override_form.rscrates/frontend/src/components/side_nav.rscrates/frontend/src/components/type_template_form.rscrates/frontend/src/components/type_template_form/utils.rscrates/frontend/src/components/variable_form.rscrates/frontend/src/components/variant_form.rscrates/frontend/src/components/webhook_form.rscrates/frontend/src/hoc/layout.rscrates/frontend/src/pages/audit_log.rscrates/frontend/src/pages/compare_overrides.rscrates/frontend/src/pages/config_version.rscrates/frontend/src/pages/config_version_list.rscrates/frontend/src/pages/context_override.rscrates/frontend/src/pages/context_override/utils.rscrates/frontend/src/pages/default_config.rscrates/frontend/src/pages/default_config_list.rscrates/frontend/src/pages/dimension.rscrates/frontend/src/pages/dimensions.rscrates/frontend/src/pages/experiment.rscrates/frontend/src/pages/experiment_group_listing.rscrates/frontend/src/pages/experiment_groups.rscrates/frontend/src/pages/experiment_list.rscrates/frontend/src/pages/function.rscrates/frontend/src/pages/function/function_create.rscrates/frontend/src/pages/function/function_list.rscrates/frontend/src/pages/function/publish_form.rscrates/frontend/src/pages/function/utils.rscrates/frontend/src/pages/home.rscrates/frontend/src/pages/type_template.rscrates/frontend/src/pages/type_templates.rscrates/frontend/src/pages/variable.rscrates/frontend/src/pages/variables_list.rscrates/frontend/src/pages/webhook.rscrates/frontend/src/pages/webhooks.rscrates/frontend/src/types.rscrates/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.rscrates/frontend/src/pages/default_config.rscrates/frontend/src/components/default_config_form/utils.rscrates/frontend/src/components/variant_form.rscrates/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
TenanttoWorkspace, 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().0on line 549 correctly accesses the inner String value, consistent with howorg_idis accessed on line 550. No remaining Signal references were found, and the context provider incrates/frontend/src/hoc/layout.rsproperly 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
TenanttoWorkspace, 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
updateandcreateAPI calls have been updated to pass the workspace reference, maintaining consistency with theadd_memberscall 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
tenanttoworkspace, and the API call toadd_membershas been updated to pass the workspace reference. TheWorkspacetype is a tuple struct wrapping aString, so extracting with.0yields aStringthat can be passed as&strto theadd_membersfunction. 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
Workspaceinstead ofTenant. The access pattern (workspace.get().0) continues to work correctly sinceWorkspacemaintains the sameDerefstructure.crates/frontend/src/types.rs (1)
177-177: LGTM! Clean type rename with preserved functionality.The type definition change from
TenanttoWorkspaceis straightforward and maintains the same structure and derives. TheDerefandDerefMuttraits 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_formhave been properly updated to useWorkspace. Both functions in this file consistently retrieve and use the workspace context.
219-219: LGTM! Second function also correctly updated.The
change_log_summarycomponent properly uses theWorkspacecontext 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_idat 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
tenanttoworkspaceand the corresponding header change fromx-tenanttox-workspaceare 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
TenanttoWorkspaceis 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_configfunction correctly migrates to workspace-based parameters and headers. The signature change to accept&strreferences instead of ownedStringfororg_idis a nice improvement for avoiding unnecessary allocations at call sites.
67-85: LGTM!The
update_default_configfunction is consistently updated with the workspace parameter andx-workspaceheader, matching the pattern established increate_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 theWorkspacesignal to the context for downstream components.crates/frontend/src/components/experiment_conclude_form/utils.rs (1)
17-40: LGTM!The
conclude_experimentfunction is correctly updated with the workspace parameter andx-workspaceheader, 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
Workspacecontext and passes the workspace value toconclude_experiment. The pattern is consistent with other components in this PR.
65-76: LGTM!The
handle_discard_experimenthandler correctly extracts the workspace value and passes it todiscard_experiment, maintaining consistency with the conclude handler above.crates/frontend/src/components/experiment_form/utils.rs (2)
30-68: LGTM!The
create_experimentfunction is correctly updated with workspace-based parameters and thex-workspaceheader. The signature change to accept&strreferences is consistent with other utility functions in this PR.
90-108: LGTM!The
update_experimentfunction 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
Stringto borrowed&stris an improvement that avoids unnecessary allocations.
50-77: LGTM! Consistent changes applied.The
update_functionsignature and headers are properly updated to match the workspace rename pattern.
79-98: LGTM! All function headers updated consistently.The
test_functionproperly 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_resourceare correctly updated to useWorkspaceinstead ofTenant. The workspace parameter is properly passed toresolve_config.
627-686: LGTM! Consistent workspace usage in delete_variant_form.The
delete_variant_formcomponent properly retrieves and uses the workspace context, passing it correctly toget_context_from_conditionandresolve_config.crates/frontend/src/components/type_template_form/utils.rs (3)
12-38: LGTM! Workspace parameter and header properly updated.The
create_typefunction signature and headers are correctly updated to use workspace instead of tenant.
51-68: LGTM! Update function properly refactored.The
update_typefunction 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 genericrequestfunction. 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_pagecomponent correctly retrieves and uses the workspace context signal, passing it tofetch_functionconsistently 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
tenanttoworkspacealigns with the PR objective and is consistent across the codebase. All callers have been properly updated: the invocation inpublish_form.rs(line 32) correctly passes theworkspaceparameter, and no remainingtenantreferences 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
:tenantto:workspacein app.rs line 132 is properly applied. However, this is not a breaking change—the codebase maintains backward compatibility through fallback chains incrates/service_utils/src/extensions.rs(lines 47-51), which still accept the old{tenant}path parameter,x-tenantheader, andtenantquery 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
TenanttoWorkspace, 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
TenanttoWorkspace. 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
workspaceparameter 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, andoverride_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
TenanttoWorkspacethroughout the file. The workspace value is correctly extracted using.0(line 47) before being passed tofetch_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
TenanttoWorkspace. 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
TenanttoWorkspace. Line 79 correctly uses.0to 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
TenanttoWorkspaceand properly extracts the inner string value using.0on 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
TenanttoWorkspaceare 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
TenanttoWorkspacemigration 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
TenanttoWorkspaceis correctly implemented throughout this file. The source closure, resource creation, andresolve_configAPI call all properly use the renamedworkspacevariable and type.Also applies to: 109-109, 139-147, 155-155
crates/frontend/src/components/dimension_form.rs (2)
621-621: LGTM!The
Workspacecontext type change inchange_log_summaryis correct, and the usage pattern (extracting.0before 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::updateanddimensions::createfunctions expect&strfor workspace and org_id parameters. BothWorkspaceandOrganisationIdare newtype structs with#[derive(Deref, DerefMut)], which implements automatic deref coercion. When you pass&workspacewhere&stris 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
TenanttoWorkspacemigration. The resource correctly extracts.0for 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
TenanttoWorkspacemigration.Also applies to: 127-127, 136-136
149-150: The review comment contains an incorrect premise.The
delete_default_configfunction signature (crates/frontend/src/api.rs:418-422) actually accepts&strfor bothworkspaceandorg_idparameters, not wrapper types. The code at lines 149-150 is correct—it calls.get_untracked()on the wrapper types to extract the&strvalues, 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
TenanttoWorkspaceis correctly implemented. Notably, this file properly extracts the inner string values (.0) when passing tovalue_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_formcorrectly migrate fromTenanttoWorkspace. The pattern of extractingworkspace.get_untracked().0and passing it by reference tocreate_functionandupdate_functionis consistent with the PR's approach.crates/frontend/src/components/webhook_form.rs (2)
74-75: LGTM!The
webhook_formcomponent correctly migrates toWorkspacecontext. The extraction pattern (workspace.get_untracked().0) and reference passing (&workspace,&org_id) toupdate_webhookandcreate_webhookare consistent.Also applies to: 111-112, 121-123, 156-158
372-380: LGTM!The
change_log_summarycomponent correctly usesSignal<Workspace>and passes workspace/org values toget_webhook.crates/frontend/src/components/default_config_form.rs (2)
542-550: LGTM!The
change_log_summarycomponent correctly extractsworkspace.get().0andorg.get().0for the resource creation, which is consistent with passing string values.
140-141: This review comment is incorrect. BothWorkspaceandOrganisationIdderive theDereftrait, which enables automatic deref coercion. Passing&workspaceand&orgto functions expecting&stris valid Rust and requires no changes. The suggested.0extraction 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().0for string extraction. The URL construction on line 94 also correctly uses.0to get the string values.Also applies to: 90-95
crates/frontend/src/components/side_nav.rs (2)
10-86: LGTM!The
create_routesfunction parameter correctly renamed fromtenanttoworkspace, 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
:workspaceas the route template token- Replace
:workspacein redirect URLs- Pass
&workspace.get().0tocreate_routesAlso applies to: 112-112, 183-184, 317-320
crates/frontend/src/components/experiment_form.rs (2)
98-99: LGTM!The
experiment_formcomponent correctly migrates toWorkspace:
- Context extraction uses
Signal<Workspace>- Resource closure correctly destructures
(workspace, org)and passes references to API calls- The
on_submithandler correctly extractsworkspace.get_untracked().0before passing&workspaceto API functionsAlso applies to: 115-127, 156-157, 172-172, 201-202
386-394: LGTM!The
change_log_summarycomponent correctly usesSignal<Workspace>and extractsworkspace.get().0for the resource creation.crates/frontend/src/pages/experiment_groups.rs (2)
160-161: LGTM!The
experiment_groupspage correctly migrates toWorkspace:
- Context extraction uses
Signal<Workspace>- The
sourceclosure extractsworkspace.get().0and returns it in the tuple- Resource closure correctly passes
&workspaceand&org_idtofetchandfetch_experimentsAlso applies to: 167-172, 178-200
202-240: LGTM!The
confirm_deletecallback correctly extractsworkspace.get().0and passes&workspacetoremove_members.crates/frontend/src/pages/dimension.rs (4)
24-24: LGTM - Import updated correctly.The import is correctly updated from
TenanttoWorkspaceto align with the type rename.
274-275: LGTM - Context type updated correctly.The context retrieval is correctly updated to use
Signal<Workspace>instead ofSignal<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. BothWorkspaceandOrganisationIdderive theDereftrait, which enables automatic deref coercion. This means&Workspaceautomatically dereferences to&String, and then coerces to&strto match thedimensions::deletefunction signature. The suggested.0extraction 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
Workspacefrom the types module.
154-168: LGTM - Context and resource creation updated correctly.The workspace context retrieval and the
fetch_configcall are correctly updated. The pattern of extracting the innerStringvia.0and 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: &strand 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
Workspacefrom 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,
workspaceandorgare assigned theWorkspaceandOrganisationIdtuple struct values. However,update_context(line 124) andcreate_context(lines 148-149) expect&strparameters.Unless
WorkspaceandOrganisationIdimplementDeref<Target=str>orAsRef<str>, this would be a type mismatch. Consider extracting the innerString:🔎 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.0for 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
.0for 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
workspaceparameter and"x-workspace"header.
72-115: LGTM - snapshots module updated correctly.Both
fetch_allandfetchfunctions 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, andfetch_typesfunctions are all correctly updated.
553-648: LGTM - Webhook functions updated correctly.The
create_webhook,update_webhook,fetch_webhooks, anddelete_webhooksfunctions 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, anddiscard_experimentfunctions 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, andget_webhookfunctions 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
fetchfunction is correctly updated with the workspace parameter and header changes.
55930b2 to
88c3e5b
Compare
knutties
left a comment
There was a problem hiding this comment.
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.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.