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

fix: collection id not updated in import block API response #32933

Merged
merged 9 commits into from Apr 30, 2024

Conversation

AnaghHegde
Copy link
Member

@AnaghHegde AnaghHegde commented Apr 25, 2024

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 #32903

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/8892306251
Commit: 6b2c1c8
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced functionality to set collection IDs during partial imports.
  • Tests
    • Improved testing for partial imports by adding new assertions to verify action names.

@AnaghHegde AnaghHegde self-assigned this Apr 25, 2024
@AnaghHegde AnaghHegde requested a review from a team as a code owner April 25, 2024 03:49
Copy link
Contributor

coderabbitai bot commented Apr 25, 2024

Walkthrough

The update enhances the import functionality of the Appsmith server, focusing on action names and collection IDs. It introduces a new method for setting collection IDs and includes an assertion in unit tests to verify action names post-import. Refactoring in sagas also addresses sequential processing to avoid racing conditions during action execution.

Changes

File Path Change Summary
.../appsmith-server/src/main/java/com/appsmith/server/imports/internal/partial/PartialImportServiceCEImpl.java
.../appsmith-server/src/test/java/com/appsmith/server/solutions/PartialImportServiceTest.java
Added setCollectionId method to dslExecutableDTO in importBuildingBlock method. Added assertion to check action names in BuildingBlockResponseDTO1 against expected names.
.../app/client/src/ce/api/ApplicationApi.tsx Modified onPageLoadActions structure in ImportBuildingBlockToApplicationResponse for detailed action object.
.../app/client/src/sagas/BuildingBlockAdditionSagas.ts Refactored logic for running actions, handling JavaScript actions separately, and fetching JavaScript collections for specific actions.

Assessment against linked issues

Objective Addressed Explanation
Enhance the import functionality to prevent failures due to missing fields and provide clear feedback. The addition of setCollectionId method and assertion for action names aligns with improving the import process as intended.
Refactor logic to handle newly created actions effectively to avoid failures. The refactored logic in BuildingBlockAdditionSagas.ts specifically addresses this objective by handling actions sequentially.

Possibly related issues


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@AnaghHegde AnaghHegde removed the request for review from a team April 25, 2024 03:50
@github-actions github-actions bot added the Bug Something isn't working label Apr 25, 2024
@AnaghHegde
Copy link
Member Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8826733292.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 32933.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-32933.dp.appsmith.com

@github-actions github-actions bot added Backend This marks the issue or pull request to reference server code Building blocks Building blocks on cavas, on templates listing or drag and drop of building blocks. High This issue blocks a user from building or impacts a lot of users Templates Pod Issues related to Templates labels Apr 25, 2024
@AnaghHegde
Copy link
Member Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8830988464.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 32933.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-32933.dp.appsmith.com

Copy link

Failed server tests

  • com.appsmith.server.solutions.ApplicationForkingServiceTests#cloneApplicationForkWithConfigurationFalseWithActionsThrice

@github-actions github-actions bot added Needs Triaging Needs attention from maintainers to triage potential-duplicate This label marks issues that are potential duplicates of already open issues Production Templates Issues related to templates labels Apr 26, 2024
@jacquesikot
Copy link
Contributor

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8877517480.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 32933.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-32933.dp.appsmith.com

app/client/src/ce/api/ApplicationApi.tsx Outdated Show resolved Hide resolved
app/client/src/sagas/BuildingBlockAdditionSagas.ts Outdated Show resolved Hide resolved
app/client/src/sagas/BuildingBlockAdditionSagas.ts Outdated Show resolved Hide resolved
app/client/src/sagas/BuildingBlockAdditionSagas.ts Outdated Show resolved Hide resolved
NilanshBansal
NilanshBansal previously approved these changes Apr 29, 2024
Copy link
Contributor

@NilanshBansal NilanshBansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BE changes looks good.

…o fix/block-onpage-load-actions-collision
@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 30, 2024
@jacquesikot jacquesikot merged commit 0d89168 into release Apr 30, 2024
42 checks passed
@jacquesikot jacquesikot deleted the fix/block-onpage-load-actions-collision branch April 30, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend This marks the issue or pull request to reference server code Bug Something isn't working Building blocks Building blocks on cavas, on templates listing or drag and drop of building blocks. High This issue blocks a user from building or impacts a lot of users Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI potential-duplicate This label marks issues that are potential duplicates of already open issues Production Templates Pod Issues related to Templates Templates Issues related to templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Building blocks with JS Actions do not load after being dropped
4 participants