Skip to content

chore: Split related to custom js libs for module instances#29372

Merged
nidhi-nair merged 1 commit intoreleasefrom
chore/js-libs-instantiation-split
Dec 6, 2023
Merged

chore: Split related to custom js libs for module instances#29372
nidhi-nair merged 1 commit intoreleasefrom
chore/js-libs-instantiation-split

Conversation

@nidhi-nair
Copy link
Contributor

@nidhi-nair nidhi-nair commented Dec 6, 2023

ApplicationDetail DTO split for extension.
Custom JS libs methods modified for extensibility.

Summary by CodeRabbit

  • New Features

    • Enhanced search capabilities within the application.
    • Improved JavaScript library management and visibility for applications.
  • Improvements

    • Streamlined the process of adding JavaScript libraries to application contexts.
    • Extended application detail inheritance for better code reuse and organization.
  • Bug Fixes

    • Adjusted method calls to align with updated JavaScript library management functions.
  • Refactor

    • Renamed methods to more accurately reflect their functionality.
    • Refactored methods to handle sets of items, improving efficiency and scalability.
  • Documentation

    • Updated method documentation to match new signatures and behaviors.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2023

Walkthrough

Walkthrough

The changes across various files in the Appsmith server codebase reflect a shift towards handling sets of JavaScript libraries (JSLibs) rather than individual ones. This includes method renamings to reflect the visibility of JSLibs, changes in method signatures to accept sets, and refactoring of methods to accommodate these sets. Additionally, there's a new class extension pattern for ApplicationDetail, and a shift in repository methods to use DTOs for querying.

Changes

File Path Change Summary
.../jslibs/base/CustomJSLibServiceCE.java
.../jslibs/base/CustomJSLibServiceCEImpl.java
.../controllers/ce/CustomJSLibControllerCE.java
.../server/services/ce/ApplicationServiceCETest.java
.../server/solutions/ImportApplicationServiceTests.java
Methods handling JSLibs have been refactored to accept and process sets of JSLibs instead of single instances.
.../server/applications/jslibs/ApplicationJsLibServiceCEImpl.java
.../server/jslibs/context/ContextBasedJsLibServiceCE.java
Methods have been renamed to reflect the handling of visible JSLibs and field access has been modified to use a static method.
.../server/domains/ApplicationDetail.java
.../server/domains/ce/ApplicationDetailCE.java
ApplicationDetail now extends a new class ApplicationDetailCE, which includes default constructor and Lombok annotations.
.../server/dtos/ce/CustomJSLibContextCE_DTO.java Variable names within a method have been updated to better reflect their purpose.
.../server/repositories/ce/CustomJSLibRepositoryCE.java
.../server/repositories/ce/CustomJSLibRepositoryCEImpl.java
Repository methods have been updated to use a set of DTOs for querying instead of individual parameters.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 6, 2023
@nidhi-nair nidhi-nair requested a review from sumitsum December 6, 2023 08:39
Comment on lines 4766 to 4772
public void createExportAppJsonWithCustomJSLibTest() {
CustomJSLib jsLib = new CustomJSLib("TestLib", Set.of("accessor1"), "url", "docsUrl", "1.0", "defs_string");
Mono<Boolean> addJSLibMonoCached = customJSLibService
.addJSLibToContext(testAppId, CreatorContextType.APPLICATION, jsLib, null, false)
.addJSLibsToContext(testAppId, CreatorContextType.APPLICATION, Set.of(jsLib), null, false)
.flatMap(isJSLibAdded ->
Mono.zip(Mono.just(isJSLibAdded), applicationPageService.publish(testAppId, true)))
.map(tuple2 -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

The test method name createExportAppJsonWithCustomJSLibTest should be prefixed with test to follow Java's standard naming conventions for test methods.


The test method name createExportAppJsonWithCustomJSLibTest should be prefixed with test to follow Java's standard naming conventions for test methods.

@nidhi-nair
Copy link
Contributor Author

/ok-to-test

@github-actions
Copy link

github-actions bot commented Dec 6, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7114077049.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@github-actions
Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7114077049.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js

To know the list of identified flaky tests - Refer here

@nidhi-nair nidhi-nair merged commit 1257476 into release Dec 6, 2023
@nidhi-nair nidhi-nair deleted the chore/js-libs-instantiation-split branch December 6, 2023 12:53
@github-actions
Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7114077049.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

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