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

feat: API for search entities #29203

Merged
merged 23 commits into from
Dec 8, 2023
Merged

feat: API for search entities #29203

merged 23 commits into from
Dec 8, 2023

Conversation

abhvsn
Copy link
Contributor

@abhvsn abhvsn commented Nov 29, 2023

Description

As per updated homepage experience search functionality will be handled by server and will be applicable for all the entities present on homepage.

Request format:

curl --location 'https://dev.appsmith.com/api/v1/search-entities?keyword=test&page=0&size=10&entities={comma separated entity names e.g.Application,Workspace}' \
--header 'Cookie: SESSION={logged_in_user's_session_cookie}'

Note: We will be running a couple of experiment to optimise the search, with this PR we have implemented basic search with contains functionality and index is applied on the searchable fields. Mongo does offer text-search functionality based on tokenisation which may tackle the incorrect spellings scenario. But as the searches are for names we have avoided that route for now as language tokenisation was not providing the expected results which basic search was able to.

Design handoff:
https://app.zeplin.io/project/653f7de4c1d563203f817bce/screen/653f7eea5d02e7233ede382c
Screenshot 2023-12-07 at 3 09 02 AM

PR fixes following issue(s)

Fixes #28793

Type of change

  • New feature (non-breaking change which adds functionality)

Testing

How Has This Been Tested?

  • Manual
  • JUnit
  • Jest
  • Cypress

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Speedbreak features have been covered
  • Test plan covers all impacted features and areas of interest
  • Test plan has been peer reviewed by project stakeholders and other QA members
  • Manually tested functionality on DP
  • We had an implementation alignment call with stakeholders post QA Round 2
  • Cypress test cases have been added and approved by SDET/manual QA
  • Added Test Plan Approved label after Cypress tests were reviewed
  • Added Test Plan Approved label after JUnit tests were reviewed

Summary by CodeRabbit

  • New Features

    • Introduced a new search functionality that allows users to find and sort applications and workspaces.
    • Added the ability to view recently used applications in a sorted order.
  • Improvements

    • Enhanced the application sorting mechanism to prioritize recently used items.
    • Streamlined the process of checking if an application is connected to Git.
  • Bug Fixes

    • Fixed an issue where the list of applications was not updating correctly for recently used items.
  • Deprecated Features

    • Marked the getAllApplicationsForHome method as deprecated.
  • Tests

    • Added new test cases to ensure the reliability of the search and sorting features.

@github-actions github-actions bot added the Enhancement New feature or request label Nov 29, 2023
@abhvsn abhvsn changed the base branch from release to feat/add-get-applications-for-homepage-api November 29, 2023 09:48
@abhvsn abhvsn changed the base branch from feat/add-get-applications-for-homepage-api to release December 5, 2023 06:52
@abhvsn abhvsn changed the base branch from release to feat/add-get-applications-for-homepage-api December 5, 2023 06:52
@abhvsn abhvsn changed the base branch from feat/add-get-applications-for-homepage-api to release December 5, 2023 06:53
@abhvsn abhvsn marked this pull request as ready for review December 5, 2023 08:57
Copy link
Contributor

coderabbitai bot commented Dec 5, 2023

Walkthrough

Walkthrough

The changes involve the implementation of new classes and methods to support search functionality and recently used entities tracking for an updated homepage experience. This includes new controllers, DTOs, helpers, migrations, and services, as well as modifications to existing classes to integrate these features. Deprecated methods are marked, and new tests are added to ensure the functionality works as expected.

Changes

File Path Change Summary
com.appsmith.server.controllers...SearchEntityController, com.appsmith.server.controllers.ce...SearchEntityControllerCE Added new controllers for search entity functionality.
com.appsmith.server.dtos...RecentlyUsedEntityDTO, SearchEntityDTO, com.appsmith.server.dtos.ce...RecentlyUsedEntityCE_DTO, SearchEntityCE_DTO Added new DTOs for recently used entities and search entities.
com.appsmith.server.helpers.ce...DomainSorter Added a new helper class for domain sorting.
com.appsmith.server.migrations.db.ce...Migration036AddRecentlyUsedEntitiesForUserData, Migration037AddCompoundIndexForNameAndDeletedAt Added new migration classes for user data and indexing.
com.appsmith.server.searchentities...SearchEntitySolution, SearchEntitySolutionCE, SearchEntitySolutionCEImpl, SearchEntitySolutionImpl, SearchEntityHelper Added new classes for search entity solutions and helpers.
com.appsmith.server.services...ApplicationServiceCE, ApplicationServiceCEImpl, ApplicationServiceImpl, ApplicationPageServiceCEImpl, ApplicationServiceCECompatibleImpl, UserDataService Modified services to integrate search and recently used entities functionality.
com.appsmith.server.controllers.ce...ApplicationControllerCE Deprecated a method and added a new method for finding applications by workspace ID and recently used order.
com.appsmith.server.services.ce...UserWorkspaceServiceUnitTest Added new test methods for user workspace service.
com.appsmith.server.services.ce...ApplicationServiceCETest Added new test methods for application service.
com.appsmith.server.searchentities...SearchEntitySolutionTest Added new test methods for search entity solution.

Assessment against linked issues

Objective Addressed Explanation
API for search functionality for updated homepage experience (#28793) The changes include the addition of new search-related classes, methods, and tests, which align with the objective of providing an API for search functionality on the updated homepage.

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 Backend This marks the issue or pull request to reference server code label Dec 5, 2023
@github-actions github-actions bot added Billing & Licensing Product Issues pertaining to licensing, billing and usage across self serve and enterprise customers Homepage Experience V2 labels Dec 5, 2023
@abhvsn
Copy link
Contributor Author

abhvsn commented Dec 5, 2023

/ok-to-test

@abhvsn abhvsn changed the base branch from release to feat/add-get-applications-for-homepage-api December 6, 2023 08:20
@abhvsn abhvsn changed the base branch from feat/add-get-applications-for-homepage-api to release December 6, 2023 08:21
@abhvsn
Copy link
Contributor Author

abhvsn commented Dec 6, 2023

/ok-to-test

Copy link

github-actions bot commented Dec 6, 2023

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

Comment on lines +50 to +55
Flux<Workspace> filterByEntityFields(
List<String> searchableEntityFields,
String searchString,
Pageable pageable,
Sort sort,
AclPermission permission);
Copy link
Contributor

Choose a reason for hiding this comment

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

The new method filterByEntityFields lacks documentation. Adding Javadoc comments would help maintainers and other developers understand the purpose, usage, and behavior of this method.

Copy link

github-actions bot commented Dec 6, 2023

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

Copy link
Contributor

@nayan-rafiq nayan-rafiq left a comment

Choose a reason for hiding this comment

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

LGTM

@Aishwarya-U-R Aishwarya-U-R merged commit 441795c into release Dec 8, 2023
23 of 24 checks passed
@Aishwarya-U-R Aishwarya-U-R deleted the feat/search-api-homepage branch December 8, 2023 05:49
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 Billing & Licensing Product Issues pertaining to licensing, billing and usage across self serve and enterprise customers Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: API for search functionality for updated homepage experience
3 participants