Skip to content
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: Remove unused param branchName on partial import method #39328

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

sharat87
Copy link
Member

@sharat87 sharat87 commented Feb 18, 2025

Description

This method argument isn't used and is mostly set to null everywhere we're calling this. So we're removing it to cleanup.

Automation

/test sanity

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13440028538
Commit: 20b0791
Cypress dashboard.
Tags: @tag.Sanity
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Thu, 20 Feb 2025 16:31:50 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Improved the application import workflow by ensuring provided file data is fully utilized during the import process.
    • Updated the success feedback to indicate that new resources are being created.
    • Streamlined the import process by removing redundant parameters, resulting in a cleaner and more efficient import experience.

Copy link
Contributor

coderabbitai bot commented Feb 18, 2025

Walkthrough

This update modifies the resource import process by changing the parameters and response codes in the import methods. The importApplicationPartially method now passes fileData instead of a null value and returns an HTTP status of CREATED after a successful import. Additionally, the PartialImportServiceCE and related classes have been simplified by removing the unused branchName parameter and eliminating the ActionCollectionService dependency. Corresponding test methods have been updated to match the new method signatures.

Changes

Files Change Summary
app/server/appsmith-server/.../controllers/ce/ApplicationControllerCE.java Modified importApplicationPartially: passes fileData instead of null and updates HTTP response status from OK to CREATED.
app/server/appsmith-server/.../imports/internal/partial/PartialImportServiceCE.java,
app/server/appsmith-server/.../imports/internal/partial/PartialImportServiceCEImpl.java,
app/server/appsmith-server/.../imports/internal/partial/PartialImportServiceImpl.java,
app/server/appsmith-server/.../solutions/PartialImportServiceTest.java
Updated importResourceInPage signature by removing the branchName parameter; removed ActionCollectionService dependency; updated test calls to align with the new method signature.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AppController as ApplicationControllerCE
    participant PartialService as PartialImportService

    Client->>AppController: importApplicationPartially(fileData)
    AppController->>PartialService: importResourceInPage(workspaceId, appId, pageId, fileData)
    PartialService-->>AppController: Application object
    AppController-->>Client: Response with HttpStatus.CREATED
Loading

Possibly related PRs

Suggested labels

Task

Suggested reviewers

  • nidhi-nair
  • sondermanish

Poem

Refactored lines in Java code,
Changing calls on the import road. 🚀
Parameters trimmed with thoughtful care,
New status codes now proudly declare.
Simplified paths, a cleaner scene—
A code symphony, crisp and keen!
Happy coding in the realm of green!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f30ef2e and c2e8deb.

📒 Files selected for processing (5)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceImpl.java (0 hunks)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/PartialImportServiceTest.java (3 hunks)
💤 Files with no reviewable changes (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceImpl.java
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
🔇 Additional comments (4)
app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceCE.java (1)

11-11: LGTM!

The interface method signature has been simplified by removing the unused branchName parameter.

app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java (1)

332-333: LGTM! HTTP status code change aligns with REST semantics.

The response status change from OK to CREATED better reflects that a new resource is being created during import.

app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/PartialImportServiceTest.java (1)

288-289: LGTM! Test coverage maintained.

All test cases have been updated to use the new method signature while maintaining the same test coverage and assertions.

Also applies to: 341-342, 401-402

app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceCEImpl.java (1)

108-108: LGTM! Implementation simplified while maintaining functionality.

The implementation has been updated to remove the unused parameter while preserving all the core import logic and transactional boundaries.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Feb 18, 2025
@sharat87 sharat87 added the ok-to-test Required label for CI label Feb 18, 2025
@sharat87 sharat87 marked this pull request as ready for review February 18, 2025 07:19
@sharat87 sharat87 requested a review from a team as a code owner February 18, 2025 07:19
mohanarpit
mohanarpit previously approved these changes Feb 20, 2025
@sharat87 sharat87 merged commit b07bb97 into release Feb 20, 2025
4 checks passed
@sharat87 sharat87 deleted the chore/remove-unused-param branch February 20, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants