Skip to content

chore: CE changes for updates on import-export-na #40232

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

Merged
merged 1 commit into from
Apr 14, 2025

Conversation

nidhi-nair
Copy link
Contributor

@nidhi-nair nidhi-nair commented Apr 14, 2025

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=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced export capabilities to support dynamic processing of interconnected elements during export procedures.
  • Refactor
    • Restructured the import workflow to update reference identifiers before finalizing collection updates, ensuring more consistent data synchronization.

@nidhi-nair nidhi-nair requested a review from a team as a code owner April 14, 2025 05:46
Copy link
Contributor

coderabbitai bot commented Apr 14, 2025

Walkthrough

This update introduces multiple new methods and modifications that enhance exportable entity processing and control flows. A new update method is added in a service implementation to handle artifact component dependencies. In related interfaces, corresponding default update methods have been introduced. Additionally, the export service now merges an extra Flux stream to process interdependent exported entities, while the imported actions flow is refactored to update action ID references before proceeding with further updates.

Changes

File(s) Change Summary
app/.../exports/ApplicationExportServiceCEImpl.java, app/.../exports/exportable/ExportableServiceCE.java, app/.../exports/internal/artifactbased/ArtifactBasedExportServiceCE.java Added new update methods (updateArtifactComponentDependentExportables & updateExportableEntities) to process exportable entities and artifact component dependencies.
app/.../exports/internal/ExportServiceCEImpl.java Introduced a new Flux variable (artifactComponentInterDependentExportedEntities) and merged its output into the existing getExportableEntities control flow.
app/.../newactions/importable/NewActionImportableServiceCEImpl.java Refactored updateImportedEntities to first invoke a new method (updateActionIdReferencesInActions) before updating actions with imported collection IDs; added the new protected method.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant AppExportService as ApplicationExportServiceCEImpl
    participant ExportableSvc as ExportableServiceCE / ArtifactBasedExportServiceCE
    participant ExportService as ExportServiceCEImpl

    Caller->>AppExportService: updateArtifactComponentDependentExportables(...)
    AppExportService->>ExportableSvc: updateExportableEntities(...)
    ExportableSvc-->>AppExportService: Mono/Flux result
    AppExportService->>ExportService: Merge interdependent Flux responses
    ExportService-->>Caller: Return merged exportable entities
Loading
sequenceDiagram
    participant Caller
    participant NewActionImportable as NewActionImportableServiceCEImpl
    participant ActionService as newActionService

    Caller->>NewActionImportable: updateImportedEntities(...)
    NewActionImportable->>NewActionImportable: updateActionIdReferencesInActions(...)
    NewActionImportable->>ActionService: updateActionsWithImportedCollectionIds(...)
    ActionService-->>NewActionImportable: Update completion
    NewActionImportable-->>Caller: Return completion signal
Loading

Poem

Code paths awaken with a vibrant new swing,
Methods arrive, letting exportables sing.
Flux streams merge in a well-orchestrated flow,
Action IDs update before onward they go.
A byte of joy, a spark in the night –
Our code dances onward in pure delight!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 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 28a629f and 7f7181a.

📒 Files selected for processing (5)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/applications/exports/ApplicationExportServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/exports/exportable/ExportableServiceCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/exports/internal/ExportServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/exports/internal/artifactbased/ArtifactBasedExportServiceCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/importable/NewActionImportableServiceCEImpl.java (2 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 (7)
app/server/appsmith-server/src/main/java/com/appsmith/server/exports/exportable/ExportableServiceCE.java (1)

37-43: LGTM: New default method for updating exportable entities.

The new updateExportableEntities method follows the existing patterns in the interface and provides a minimal default implementation. This is a good design choice for interfaces where not all implementations may need this functionality.

app/server/appsmith-server/src/main/java/com/appsmith/server/exports/internal/artifactbased/ArtifactBasedExportServiceCE.java (1)

49-53: LGTM: New method for updating artifact component dependent exportables.

The method signature is consistent with the existing pattern in the interface. It leaves implementation details to the concrete classes which is appropriate for this interface.

app/server/appsmith-server/src/main/java/com/appsmith/server/exports/internal/ExportServiceCEImpl.java (2)

229-231: LGTM: Added component inter-dependent exports processing.

Correctly leverages the new method from ArtifactBasedExportService to handle interdependent exportables.


238-238: Added processing step to the export pipeline.

The use of Flux.defer() ensures proper lazy evaluation, maintaining the correct sequence of operations in the reactive chain.

app/server/appsmith-server/src/main/java/com/appsmith/server/applications/exports/ApplicationExportServiceCEImpl.java (1)

212-227: LGTM: Implementation of updateArtifactComponentDependentExportables.

The implementation correctly applies the pattern established in other methods, using reactive programming to process the artifact components. Currently only processing actions, which matches the requirements.

app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/importable/NewActionImportableServiceCEImpl.java (2)

167-170: Implementation changes the processing sequence for imported actions.

The code now introduces a sequential step to update action ID references before proceeding with collection ID updates. This enhances the import workflow by ensuring references are properly set before further processing.


215-217: New extension point for customizing action reference handling.

This empty implementation serves as a hook for subclasses to override and implement custom action ID reference processing. The method signature clearly indicates its purpose and aligns with reactive programming patterns.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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 Apr 14, 2025
@nidhi-nair nidhi-nair merged commit 88484a4 into release Apr 14, 2025
15 of 16 checks passed
@nidhi-nair nidhi-nair deleted the chore/import-export-ai branch April 14, 2025 05:51
Copy link

Failed server tests

  • com.appsmith.server.helpers.UserUtilsTest#makeInstanceAdministrator_WhenUserAlreadyAdmin_MaintainsPermissionsSuccessfully
  • com.appsmith.server.services.ce.OrganizationServiceCETest#checkAndExecuteMigrationsForOrganizationFeatureFlags_withPendingMigration_getUpdatedOrganization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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