-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: Add code-split for widget refactoring in UI module #40226
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
chore: Add code-split for widget refactoring in UI module #40226
Conversation
WalkthroughSeveral refactorings have been made across layout and refactoring services. A new Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant U as UpdateLayoutServiceImpl
participant R as ContextLayoutRefactorResolver
participant D as LayoutUpdateHelper
C->>U: updateLayout(pageId, applicationId, layoutId, layout, contextType)
activate U
U->>R: getContextLayoutRefactorHelper(contextType)
activate R
R-->>U: returns ContextLayoutRefactoringService
alt Page/Module Context
U->>D: updateLayoutDsl(...)
else Default Processing
U->>U: process layout update normally
end
U-->>C: LayoutDTO response
deactivate U
sequenceDiagram
participant Cl as Caller
participant O as OnLoadExecutablesUtilCEImpl
participant S as ExecutableOnLoadService
Cl->>O: findAllOnLoadExecutables(..., creatorType)
activate O
O->>O: getExecutableOnLoadService(creatorType)
O->>S: Forward request with creatorType
S-->>O: Executable list response
O-->>Cl: Return updated executables
deactivate O
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (18)
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCE.java (1)
17-19
: Consider providing JavaDoc for the new overloaded method.
This method overload is helpful for context-aware layouts. Adding documentation about howCreatorContextType
affects the update process would benefit maintainability.app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceCEImpl.java (6)
4-4
: Streamline Unused Imports.
Double-check ifBaseDomain
import is essential here. If it’s only referenced in the generic signature, that’s fine; otherwise, consider removing.
30-30
: Check for additional context types.
The static import forisModuleContext
complements the existingisPageContext
. Confirm whether new context types may emerge, and handle them gracefully.
48-49
: Consider fallback handling.
Returning empty for non-page non-module contexts is safe, but ensure no other context type is missed or incorrectly handled.
58-59
: Efficient pattern usage.
StoringupdatedBindingPaths
andoldNamePattern
is sensible. Confirm that no concurrency requires thread-safe data structures here.
120-123
: Flux-based approach for entity names.
Returning a flux from a context-based mono ensures correct handling of multiple names if needed. Watch out for blocking calls or large name sets.
124-133
: Casting context objects.
Casting toLayoutContainer
is safe if guaranteed by design. Consider aninstanceof
check with fallback to prevent unforeseen cast exceptions.app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java (1)
94-95
: Resolver test coverage.
Having a spy oncontextLayoutRefactorResolver
is useful for verifying correct context-based refactoring calls. Ensure coverage extends to edge contexts.app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/ContextLayoutRefactoringService.java (2)
22-46
: Update and retrieval methods.
MethodsupdateContext
andgetContextDTOMono
comprehensively handle context updates and retrieval in both published and unpublished modes.
67-83
: Layout extraction and updates.
getLayouts
andupdateLayoutByContextId
methods offer a straightforward approach. Confirm concurrency handling if multiple updates happen at once.app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (1)
251-252
: TODO comment added.Don’t forget to replace the overloaded
updateLayout
usage as noted.Shall I open a new ticket to address this TODO?
app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/refactors/PageLayoutRefactoringServiceImpl.java (5)
37-39
: Check for null context
IngetContextDTOMono(String contextId, boolean viewMode)
, you callfindPageById
directly. IfcontextId
is empty or null,findPageById
might return an error immediately. Ensure upstream callers always supply a validcontextId
, or add an early null check.
41-44
: Consider early validation
getContextDTOMono(RefactoringMetaDTO refactoringMetaDTO)
simply returnspageDTOMono
fromrefactoringMetaDTO
. IfpageDTOMono
is null or out of date (e.g., never set), it could lead to an unexpected empty result. Consider adding an assertion or fallback for better error messages.
46-59
: Validatepage.getApplicationId()
WithingetEvaluationVersionMono(...)
, ifpage.getApplicationId()
is null or invalid,applicationService.findById
may fail. You might include a null guard or a more descriptive error for diagnosing issues quickly.
77-83
: Potential null return
getLayouts(...)
can return null ifupdatedPage
is absent. Returning an empty List instead of null often simplifies calling code by removing the need for null checks.- return null; + return Collections.emptyList();
86-90
: Plan future implementation
updateLayoutByContextId
is not implemented yet. Prepare a TODO or implement to avoid accidental usage. If this is intentional, clarify in the documentation.Do you want help creating a stubbed-out implementation or opening a tracking issue?
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (2)
424-424
: Check null layout
findAndUpdateLayout(...)
directly delegates tofindAndUpdateLayout(creatorId, layoutId, layout)
. Iflayout
can be null, the delegating method might fail. Consider a pre-check or graceful handling.
1480-1481
: Unused parameter
getExecutableOnLoadService(CreatorContextType contextType)
unconditionally returnspageExecutableOnLoadService
. If you plan to support multiple services, implement the logic to select them here. Otherwise, consider removing the unused parameter.-protected ExecutableOnLoadService<?> getExecutableOnLoadService(CreatorContextType contextType) { +protected ExecutableOnLoadService<?> getExecutableOnLoadService() { return pageExecutableOnLoadService; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ce/LayoutContainer.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageDTO.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCE.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java
(5 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceImpl.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/refactors/PageLayoutRefactoringServiceImpl.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java
(13 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/ContextLayoutRefactoringService.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java
(4 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceImpl.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolver.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolverCE.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceCEImpl.java
(4 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceImpl.java
(1 hunks)app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java
(5 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolver.java (4)
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceImpl.java (1)
Service
(14-37)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceImpl.java (1)
Service
(16-42)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolverCE.java (1)
Service
(9-21)app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceImpl.java (1)
Service
(9-18)
app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceCEImpl.java (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java (1)
Slf4j
(40-299)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (1)
Slf4j
(65-668)
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceImpl.java (5)
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java (1)
Slf4j
(40-299)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceImpl.java (1)
Service
(14-37)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolver.java (1)
Service
(8-13)app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolverCE.java (1)
Service
(9-21)app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceImpl.java (1)
Service
(9-18)
app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/refactors/PageLayoutRefactoringServiceImpl.java (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java (1)
Slf4j
(40-299)app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (1)
Slf4j
(65-668)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / rts-build / build
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (53)
app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PageDTO.java (1)
8-8
: Appropriate interface implementationThe PageDTO class now correctly implements the LayoutContainer interface. This implementation makes the relationship between PageDTO and layouts explicit, enabling better type safety in the refactoring services.
Also applies to: 30-30
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolver.java (1)
1-13
: Clean class implementationThis implementation extends ContextLayoutRefactorResolverCE, following the standard pattern for service implementation. The constructor correctly passes the pageLayoutRefactorService to the superclass.
app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ce/LayoutContainer.java (1)
1-13
: Well-designed interfaceThe LayoutContainer interface is cohesive and follows the Interface Segregation Principle, containing only methods related to layout management. This abstraction will enable more flexible refactoring operations across different layout-containing entities.
app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/resolver/ContextLayoutRefactorResolverCE.java (2)
1-17
: Clean resolver base classThe ContextLayoutRefactorResolverCE class is well-structured with appropriate dependency injection. It follows the Spring service pattern correctly.
18-20
:✅ Verification successful
Prepared for future context types
The method parameter contextType is currently unused since it always returns pageLayoutRefactorService regardless of the context type. This suggests the method is designed for future extensibility when more context types might be supported.
🏁 Script executed:
#!/bin/bash # Check if there are other implementations of ContextLayoutRefactoringService besides the one for PageDTO echo "Checking for potential future implementations of ContextLayoutRefactoringService..." rg -B 1 -A 1 "class .* implements ContextLayoutRefactoringService" --type javaLength of output: 776
Future-Proofing Verified
- The
contextType
parameter ingetContextLayoutRefactorHelper
remains unused, consistent with the current implementation.- The repository search confirms that
PageLayoutRefactoringServiceImpl
is the only implementation ofContextLayoutRefactoringService
, aligning with the design for future extensibility.- No immediate changes are necessary as the method is correctly prepared for adding support for additional context types later.
app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceImpl.java (1)
14-16
: Constructor refactoring looks good.
Removing unused services and introducingContextLayoutRefactorResolver
aligns with the context-based approach. Make sure there are no dangling references to the old services.app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java (7)
17-19
: Imports align with context-based refactoring.
These imports forContextLayoutRefactoringService
andContextLayoutRefactorResolver
appear correct and consistent with the new workflow.
53-53
: Added dependency for context layout solver.
DeclaringContextLayoutRefactorResolver
ensures a clean, centralized approach for context-aware layout handling.
73-73
: Naming clarity.
Renaming tocontextId
is a good step toward distinguishing page-bound logic from generic context-based logic.
83-85
: Dynamic evaluation version retrieval.
Injecting the correct evaluation version viacontextLayoutRefactorResolver
centralizes context logic, improving maintainability.
91-94
: Refactored layout retrieval.
Fetching layouts throughContextLayoutRefactoringService
fosters consistency and modular design.
99-99
: Check for potential null artifactId.
Handle cases where no artifact exists, particularly if the refactoring context is incomplete or missing references.
101-106
: Context-based layout update logic.
PassingcontextId
andCreatorContextType
ensures the update flow remains adaptive to different contexts. No issues spotted in error handling, but confirm that all callers handle potential failures.app/server/appsmith-server/src/main/java/com/appsmith/server/widgets/refactors/WidgetRefactoringServiceCEImpl.java (10)
8-8
: ValidateLayoutContainer
usage.
Ensure that all references and downcasts toLayoutContainer
are safe and thoroughly tested, especially for contexts that might not produce a layout container.
14-14
: Context-based refactoring utility.
The newContextLayoutRefactoringService
dependency appears to correctly modularize context-based layout refactoring. This separation enhances maintainability.
16-16
: Resolver integration.
UsingContextLayoutRefactorResolver
to conditionally fetch the correct helper promotes better extensibility for additional context types in the future.
35-38
: Dependency injection.
The newly added resolver and utilities make the service more flexible. Verify that all are properly mocked or injected in tests.
45-45
: Method override.
Refactoring references appears consistent with theEntityRefactoringServiceCE
interface. Good alignment with the contract.
53-53
: Context type assignment.
Ensure that this localCreatorContextType contextType
is used consistently within the method to avoid confusion or overshadowing.
61-63
: Improved modular approach.
Retrieving the correct refactoring helper for the given context promotes clean, decoupled logic.
65-68
: Asynchronous context retrieval.
Fetching the context DTO with reactive semantics is aligned with upstream code style. Validate the presence of fallback values if context is unexpected.
135-136
: Empty results for missing rules.
Returning an empty flux allows the calling code to handle no-results scenarios gracefully. This is a good pattern for reactive flows.
139-140
: Proper error signaling.
Raising a specific error if no layout matches is clear and explicit, which aids debugging.app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java (4)
23-23
: SpyBean usage.
Spying onContextLayoutRefactorResolver
helps verify interactions. Good approach for ensuring logic is triggered as expected.
114-115
: Constructor consistency.
AddingcontextLayoutRefactorResolver
aligns the test with the new service injection. Ensure any other test coverage is updated accordingly.
173-173
: Updated method signature.
TheupdateLayout
call signature changed to accept extra parameters. Confirm all test references match these new arguments.
311-311
: Method invocation with five params.
All references toupdateLayout
have been updated to reflect the new signature. Double-check that inputs for the new parameter are correct.app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/ContextLayoutRefactoringService.java (3)
1-19
: Well-defined interface structure.
This interface cleanly defines a contract for context-based layout refactoring, enhancing maintainability by segregating responsibilities.
48-65
: Evaluation version retrieval.
Providing two separate methods to retrieve evaluation versions is clear. Ensure consistency with how the artifact ID is used in the rest of the codebase.
84-107
: Metadata-based context ID and artifact retrieval.
Encapsulating ID extraction logic in the service is neat and ensures a single source of truth. The in-memory updates to metadata are also well structured.app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceImpl.java (3)
6-6
: New import introduced.The addition of the
ContextLayoutRefactorResolver
import aligns with the wider context-based refactoring approach.
24-25
: New constructor parameters added.Injecting
observationHelper
andcontextLayoutRefactorResolver
is consistent with the refactoring strategy.
34-35
: Passing new dependencies to superclass.Forwarding the new parameters in the super call is properly handled and maintains the updated signature.
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (6)
23-23
: ImportedContextLayoutRefactorResolver
.Importing the resolver indicates the service will handle context-based refactoring.
62-62
: ImportedisPageContext()
.This helper method import suggests you’re branching logic based on context type.
78-78
: Added field forcontextLayoutRefactorResolver
.Declaring
contextLayoutRefactorResolver
as a final field ensures consistent usage throughout the service.
121-121
: Visibility changed forupdateLayoutDsl()
.Using
protected
broadens its accessibility for potential subclass overrides.
264-272
: New overloadedupdateLayout
withCreatorContextType
.Introducing an explicit context parameter promotes context-based branching for page vs. non-page scenarios.
255-258
:❓ Verification inconclusive
Passing
null
to the context refactor helper.Verify that providing
null
as theCreatorContextType
won’t cause unexpected fallback or logic issues.
🏁 Script executed:
#!/bin/bash # Searching for calls to getContextLayoutRefactorHelper(null) to ensure there's a fallback rg "getContextLayoutRefactorHelper\(null\)"Length of output: 199
Verify that passing null to getContextLayoutRefactorHelper is safe
The grep search confirmed that the only instance of passing a null argument to
getContextLayoutRefactorHelper
is in theUpdateLayoutServiceCEImpl.java
file (lines 255-258). Please double-check that the implementation ofgetContextLayoutRefactorHelper
gracefully handles a nullCreatorContextType
without triggering unexpected fallback behavior or logic issues. It would also be beneficial to add or review unit tests to ensure that this behavior remains stable in the future.app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceImpl.java (3)
9-9
: ImportedContextLayoutRefactorResolver
.This aligns with the overall shift toward context-aware layout refactoring.
28-29
: Constructor parameters updated.Injecting
widgetEntityRefactoringService
andcontextLayoutRefactorResolver
paves the way for comprehensive refactoring flows.
39-40
: Super call updated to accept new parameters.Ensures the parent constructor receives the additional services for context-based refactoring without breaking existing flows.
app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/refactors/PageLayoutRefactoringServiceImpl.java (3)
31-34
: Ensure DTO Casting Safety
InupdateContext(String contextId, LayoutContainer dto)
, you're castingdto
toPageDTO
before callingsaveUnpublishedPage()
. If a differentLayoutContainer
implementation is ever passed, this cast could fail at runtime. Consider validating the type and handling mismatches gracefully.Can you confirm there are no external calls passing a non-
PageDTO
object to this method?
61-74
: Graceful error handling
WhenfindById(artifactId)
returns an empty Mono, you raise an ACL error. Confirm this covers other potential causes, such as a missing or invalid artifact. If you expect different error scenarios, you could differentiate them for clarity.
105-108
: Maintain symmetry between getters & setters
setUpdatedContext(...)
updatesupdatedPage
inrefactoringMetaDTO
. Verify that the rest of the codebase consistently uses this new updated context, and that no existing logic setsupdatedPage
in other ways, to prevent overwriting or confusion.app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (8)
170-171
: No immediate concerns
AddingcreatorType
alongsideevaluatedVersion
ensures context-aware handling. This looks consistent with the rest of the parameter additions.
198-199
: Consistent parameter usage
Similar to lines 170–171, addingcreatorType
here maintains consistency. Good job ensuring uniform handling across methods.
427-428
: Type safety
updateUnpublishedExecutable(...)
checksexecutable instanceof ActionDTO
but not other potential subtypes. If newExecutable
types are introduced, consider broadening the condition or throwing a meaningful error.
431-431
: Delegation is straightforward
Forwarding the call togetExecutableOnLoadService(contextType).updateUnpublishedExecutable(...)
simplifies code. No issues noticed.
445-445
: Context-based retrieval
getAllExecutablesByCreatorIdFlux(...)
usesgetExecutableOnLoadService(creatorType)
. Ensure the chosen service matches thecreatorType
. No further concerns here.
716-716
: No issues with widget creation
InstantiatingEntityDependencyNode
with identicalvalidEntityName
andreferenceString
for widgets is acceptable if the code downstream does not differentiate them. Looks good.
750-760
: Asynchronous chaining
Chaining multiple async calls insideaddDirectlyReferencedExecutablesToGraph
can be error-prone if one fails. Ensure each step is handled properly with error logs or fallback if needed. Otherwise, no immediate issues.
1018-1019
: Creator context extension
Adding extra parameters ensures the code can resolve context-based logic more accurately. This expansion looks consistent.
return contextDTOMono | ||
.flatMap(contextDTO -> { | ||
String contextId = contextDTO.getId(); | ||
Mono<Integer> evalVersionMono = contextLayoutRefactorHelper.getEvaluationVersionMono( | ||
contextId, refactorEntityNameDTO, refactoringMetaDTO); | ||
|
||
return pageDTOMono.then(); | ||
return evalVersionMono.flatMap(evalVersion -> { | ||
List<Layout> layouts = contextDTO.getLayouts(); | ||
if (layouts == null) { | ||
return Mono.just(contextDTO); | ||
} | ||
for (Layout layout : layouts) { | ||
if (layoutId.equals(layout.getId()) && layout.getDsl() != null) { | ||
// DSL has removed all the old names and replaced it with new name. If the change of | ||
// name | ||
// was one of the mongoEscaped widgets, then update the names in the set as well | ||
Set<String> mongoEscapedWidgetNames = layout.getMongoEscapedWidgetNames(); | ||
if (mongoEscapedWidgetNames != null && mongoEscapedWidgetNames.contains(oldName)) { | ||
mongoEscapedWidgetNames.remove(oldName); | ||
mongoEscapedWidgetNames.add(newName); | ||
} | ||
|
||
final JsonNode dslNode = objectMapper.convertValue(layout.getDsl(), JsonNode.class); | ||
return widgetRefactorUtil | ||
.refactorNameInDsl(dslNode, oldName, newName, evalVersion, oldNamePattern) | ||
.flatMap(dslBindingPaths -> { | ||
updatedBindingPaths.addAll(dslBindingPaths); | ||
layout.setDsl(objectMapper.convertValue(dslNode, JSONObject.class)); | ||
contextDTO.setLayouts(layouts); | ||
contextLayoutRefactorHelper.setUpdatedContext( | ||
refactoringMetaDTO, contextDTO); | ||
|
||
return contextLayoutRefactorHelper.updateContext(contextId, contextDTO); | ||
}); | ||
} | ||
} | ||
return Mono.just(contextDTO); | ||
}); | ||
}) | ||
.then(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Chained Mono operations.
This chain gracefully handles DSL name refactoring and updates the context. Make sure error cases are tested and that partial updates do not leave the context in an inconsistent state.
Failed server tests
|
Description
EE Counterpart: https://github.com/appsmithorg/appsmith-ee/pull/7143
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14404193022
Commit: 5585f90
Cypress dashboard.
Tags:
@tag.All
Spec:
Fri, 11 Apr 2025 14:44:36 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Refactor