chore: Minor refactor for sign up workspace create flow.#40046
chore: Minor refactor for sign up workspace create flow.#40046trishaanand merged 2 commits intoreleasefrom
Conversation
WalkthroughThis PR refactors authentication-related handlers by updating their dependency injection. In both Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Auth as AuthHandler/CE
participant Signup as UserSignupHelper
participant SignupCE as UserSignupHelperCE
participant WS as WorkspaceService
participant AP as ApplicationPageService
User ->> Auth: Successful Authentication
Auth ->> Signup: Invoke signup logic
Signup ->> SignupCE: Delegate workspace/app creation
SignupCE ->> WS: Create default workspace
WS -->> SignupCE: Workspace Created
SignupCE ->> AP: Create default application
AP -->> SignupCE: Application Created
SignupCE -->> Signup: Return success
Signup -->> Auth: Complete processing
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (2)
🪧 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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java (1)
192-192: Consider documenting why this method is now publicChanged method visibility from private to public. While this allows reuse from other classes, the reason for this change isn't self-evident. Consider adding a comment explaining the rationale.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/AuthenticationSuccessHandler.java(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java(4 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/UserSignupHelper.java(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/UserSignupHelperCE.java(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/UserSignupHelperCE.java (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/AuthenticationSuccessHandler.java (1)
Slf4j(19-50)app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java (1)
Slf4j(50-394)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (11)
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/UserSignupHelper.java (1)
1-30: Well-structured component for handling signup-related workspace logicThis new class follows a clean inheritance pattern by extending
UserSignupHelperCEand properly propagating dependencies to the parent class. The@Componentannotation ensures Spring manages this bean in the application context.app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java (3)
13-13: Good dependency addition for signup flow refactoringAdding the
UserSignupHelperimport supports the new flow where workspace creation is handled by a dedicated helper.
66-66: Proper dependency injection for the new helperAdding the UserSignupHelper as a dependency enables better separation of concerns by moving workspace creation logic outside of the authentication handler.
347-350: Good refactoring to delegate workspace/application creationThe implementation now properly delegates to the specialized helper class rather than handling this logic directly. This improves separation of concerns and makes the code more maintainable.
app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/UserSignupHelperCE.java (5)
1-39: Well-structured helper class with appropriate dependenciesThe class definition, imports, and constructor are well-organized. The class properly initializes all necessary dependencies for workspace and application creation.
40-60: Good implementation with appropriate error handlingThe
createDefaultWorkspaceAndApplicationmethod includes proper logging and error handling withdoOnError. The method follows reactive programming patterns correctly.
62-74: Clean implementation for default application creationThe method is concise, well-documented, and follows reactive patterns. The name of the default application "My first application" is clear and user-friendly.
76-107: Well-implemented workspace retrieval/creation logicThe method handles different cases appropriately: using an existing workspace ID if provided, finding the first accessible workspace, or creating a new one if needed. The embedded comments explain the logic clearly.
109-121: Good extensibility pattern for EE customizationThe method is designed to be overridden in the Enterprise Edition version, following a good pattern for code extensibility across different product tiers.
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/AuthenticationSuccessHandler.java (2)
5-5: Appropriate import for the new helperAdding the import for UserSignupHelper is necessary for the constructor parameter change.
34-48: Good dependency injection updateThe constructor now properly includes the UserSignupHelper and passes it to the parent class. This aligns with the refactoring to move workspace creation logic to a dedicated helper.
…#40046) ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ 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 /test sanity ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14237818849> > Commit: c173b04 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14237818849&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Thu, 03 Apr 2025 08:32:21 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the sign-up process with a new `UserSignupHelper` for automated default workspace and application provisioning. - Improved the email verification redirection for a smoother onboarding experience. - **Refactor** - Streamlined backend workflows by consolidating workspace and application creation logic, enhancing modularity and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/test sanity
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14237818849
Commit: c173b04
Cypress dashboard.
Tags:
@tag.SanitySpec:
Thu, 03 Apr 2025 08:32:21 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
UserSignupHelperfor automated default workspace and application provisioning.Refactor