chore: refactor the creation of workspace and application on signup#39935
chore: refactor the creation of workspace and application on signup#39935
Conversation
WalkthroughThis pull request refactors the default application creation process in the authentication success handler. It separates the concerns by extracting the workspace creation logic into a new method ( Changes
Sequence Diagram(s)sequenceDiagram
participant AuthHandler as AuthenticationSuccessHandlerCE
participant Workspace as createWorkspaceIfNotExistsAndGetId
participant AppCreator as createFirstApplication
participant AppService as applicationPageService
AuthHandler->>Workspace: Call with (defaultWorkspaceId, Authentication)
Workspace-->>AuthHandler: Return workspaceId
AuthHandler->>AppCreator: Call with workspaceId
AppCreator->>AppService: Invoke createApplication()
AppService-->>AppCreator: Return Application
AppCreator-->>AuthHandler: Return Application
Suggested labels
Suggested reviewers
Poem
✨ 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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java (2)
357-384: Clean extraction of workspace creation logicExtracting this logic into a dedicated method improves readability and maintainability. The method now has a clear purpose: to either retrieve an existing workspace ID or create a new one if needed.
Consider adding Javadoc documentation to this method explaining its purpose and return value.
386-392: Well-defined application creation methodThis extraction nicely encapsulates the logic for creating the first application. The method is focused on a single responsibility and has clear inputs and outputs.
Consider adding Javadoc documentation to this method explaining its purpose and parameters.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/ce/AuthenticationSuccessHandlerCE.java (1)
351-355: Good refactoring with improved separation of concernsThe method now delegates to two specialized methods, making the code more modular and easier to maintain. This follows the Single Responsibility Principle well.
…ppsmithorg#39935) ## 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 /ok-to-test tags="@tag.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/14102139310> > Commit: b9aa70c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14102139310&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Thu, 27 Mar 2025 09:11:23 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 - **Refactor** - Streamlined the default setup process for workspaces and applications, ensuring a more consistent and reliable initial configuration for users during authentication. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com>
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
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14102139310
Commit: b9aa70c
Cypress dashboard.
Tags:
@tag.SanitySpec:
Thu, 27 Mar 2025 09:11:23 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit