Commit Graph

36 Commits

Author SHA1 Message Date
Sumit Kumar
98a509227f
fix: fix MySQL stale connection error (#24429)
## Description
- Add changes to address the`StaleConnection` exception caused by MySQL plugin.
- Update MySQL driver version.
- Other refactor changes not related to the main issue: 
  - Explicit empty constructor definition is replaced with Lombok annotation for all error messages class.
  - A base class is created for plugin error messages class to store all common error messages.
  - Fix Indentation.
2023-06-30 11:40:05 +05:30
albinAppsmith
629999f124
feat: [epic] appsmith design system version 2 deduplication (#22030)
## Description

### Fixes
- [x] https://github.com/appsmithorg/appsmith/issues/19383
- [x] https://github.com/appsmithorg/appsmith/issues/19384
- [x] https://github.com/appsmithorg/appsmith/issues/19385
- [x] https://github.com/appsmithorg/appsmith/issues/19386
- [x] https://github.com/appsmithorg/appsmith/issues/19387
- [x] https://github.com/appsmithorg/appsmith/issues/19388
- [x] https://github.com/appsmithorg/appsmith/issues/19389
- [x] https://github.com/appsmithorg/appsmith/issues/19390
- [x] https://github.com/appsmithorg/appsmith/issues/19391
- [x] https://github.com/appsmithorg/appsmith/issues/19392
- [x] https://github.com/appsmithorg/appsmith/issues/19393
- [x] https://github.com/appsmithorg/appsmith/issues/19394
- [x] https://github.com/appsmithorg/appsmith/issues/19395
- [x] https://github.com/appsmithorg/appsmith/issues/19396
- [x] https://github.com/appsmithorg/appsmith/issues/19397
- [x] https://github.com/appsmithorg/appsmith/issues/19398
- [x] https://github.com/appsmithorg/appsmith/issues/19399
- [x] https://github.com/appsmithorg/appsmith/issues/19400
- [x] https://github.com/appsmithorg/appsmith/issues/19401
- [x] https://github.com/appsmithorg/appsmith/issues/19402
- [x] https://github.com/appsmithorg/appsmith/issues/19403
- [x] https://github.com/appsmithorg/appsmith/issues/19404
- [x] https://github.com/appsmithorg/appsmith/issues/19405
- [x] https://github.com/appsmithorg/appsmith/issues/19406
- [x] https://github.com/appsmithorg/appsmith/issues/19407
- [x] https://github.com/appsmithorg/appsmith/issues/19408
- [x] https://github.com/appsmithorg/appsmith/issues/19409

Fixes # (issue)
> if no issue exists, please create an issue and ask the maintainers
about this first


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

> Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update


## How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Provide
instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.
> Delete anything that is not important

- Manual
- 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: Ankita Kinger <ankita@appsmith.com>
Co-authored-by: akash-codemonk <67054171+akash-codemonk@users.noreply.github.com>
Co-authored-by: Tanvi Bhakta <tanvi@appsmith.com>
Co-authored-by: Arsalan <arsalanyaldram0211@outlook.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Rohit Agarwal <rohit_agarwal@live.in>
Co-authored-by: Nilesh Sarupriya <nilesh@appsmith.com>
Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com>
Co-authored-by: Tanvi Bhakta <tanvibhakta@gmail.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
Co-authored-by: Vijetha-Kaja <vijetha@appsmith.com>
Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com>
Co-authored-by: Apple <nandan@thinkify.io>
Co-authored-by: Saroj <43822041+sarojsarab@users.noreply.github.com>
Co-authored-by: Sangeeth Sivan <74818788+berzerkeer@users.noreply.github.com>
Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com>
Co-authored-by: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com>
Co-authored-by: rahulramesha <rahul@appsmith.com>
Co-authored-by: Aswath K <aswath.sana@gmail.com>
Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com>
Co-authored-by: Vijetha-Kaja <119562824+Vijetha-Kaja@users.noreply.github.com>
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-05-20 00:07:06 +05:30
Shrikant Sharat Kandula
4280ded88e
chore: Fix unnecessary re-shading of jars (#21994)
Solves a single thing in the build configurations, resulting in a few
wins.

1. Reduced number of warnings in the output.
   1. In release branch:
      ```
mvn clean package -DskipTests | grep --fixed-strings --count '[WARNING]'
      3233
      ```
   1. In this PR's branch:
      ```
mvn clean package -DskipTests | grep --fixed-strings --count '[WARNING]'
      172
      ```

2. All uber-jar files are shaded twice, currently. Once with the default
execution of `maven-shade-plugin`, and again with the `shade-plugin-jar`
execution in these `pom.xml` files. This is double-work, and is the
cause of most of the warnings we see.
1. This `shade-plugin-jar` was added to have the plugin information
included in the `/META-INF/MANIFEST.MF` file, since we can't configure
the default execution of the shade plugin (it comes to us from Spring
Boot).
2. Instead, we switch to configuring plugin information in a
`/plugin.properties` file.
3. Previously, we used `/plugin.properities` for plugin information in
dev time, and `/META-INF/MANIFEST.MF` in production. This PR will change
it so that we use `/plugin.properties` all the time. We configure PF4J
with a custom plugin manager to achieve this.

3. Moved all `plugin.properties` into `src/main/resources`, so that they
land up in the root of the final jar files. But this means, during
development, loading the plugin fails since it looks for a
`plugin.properties` at the root of the plugin module, i.e., next to the
`src` folder.
1. For this, in the custom plugin manager class, we change where we look
for the `plugin.properties` file during development mode. In this mode,
we look at the `target/classes/plugin.properties` file, which is where
maven saves this file, taken from
`src/main/resources/plugin.properties`.
2. This also solves the duplication of the plugin properties that's
currently present, between `plugin.properties` and the `<properties>`
section of `pom.xml` files.


Here's the shade plugin's default execution and configuration, from
Spring Boot:
https://github.com/spring-projects/spring-boot/blob/v3.0.1/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle#L174.
2023-04-03 17:49:21 +05:30
subratadeypappu
0ad5aaa41d
fix: Show downstream error message for DynamoDB (#21042) (#21209)
This PR fixes one case where the downstream error message is captured as
`null`.

- In case of illegal access to any table the downstream error message is
not captured correctly. It was captured as `null` because the original
downstream message was available one level deeper.
2023-03-08 21:02:51 +05:30
ChandanBalajiBP
b72dea33f3
feat: Error handling phase 1 (#20629)
## Description
This PR updates the error logs 
- Establishing a consistent format for all error messages.
- Revising error titles and details for improved understanding.
- Compiling internal documentation of all error categories,
subcategories, and error descriptions.

Updated Error Interface:
https://www.notion.so/appsmith/Error-Interface-for-Plugin-Execution-Error-7b3f5323ba4c40bfad281ae717ccf79b

PRD:
https://www.notion.so/appsmith/PRD-Error-Handling-Framework-4ac9747057fd4105a9d52cb8b42f4452?pvs=4#008e9c79ff3c484abf0250a5416cf052

>TL;DR 

Fixes # 


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

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


## How Has This Been Tested?

- Manual
- Jest
- Cypress

### Test Plan


### Issues raised during DP testing


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


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: subrata <subrata@appsmith.com>
2023-02-18 18:25:46 +05:30
Nidhi
dfccd5a058
chore: Upgrade to Spring Boot 3.0.1 (#19044)
This upgrade takes care of our move to JDK 17, Spring Boot 3.0.1 and a
few other security upgrades along the way.

Fixes #18993 

TODO:

- [x] Check CI changes for Java 17
- [x] Check vulnerability report
- [x] Mongock needs an upgrade
- [x] Add JVM args at all possible places for exposing java.time module
- [x] Add type adapters everywhere / use the same config for type
adapters everywhere
2023-01-02 19:40:59 +07:00
Nidhi
c3e935ef40
fix: Remove datasource connection from cache when datasource is deleted (#17364)
* Changes to testDatasource interface method and archive flow

* Tests for plugin level testDatasource implementations

* Added test for refreshing cache on deleting datasource

* Modified warnings to errors in logs

* Fixed test

* Fixed test
2022-10-17 10:31:26 +05:30
Nidhi
66f3dfe790
chore: Move to Jupiter JUnit5 (#17083)
* Upgrading to Jupiter tests for everything but plugins

* Whoops, too soon

* Fixed failing tests

* Imports fixed

* Removed PowerMock dep and JUnit4 from interfaces

* Woohoo! That's testcontainers

* Added maven enforcer to disallow junit4

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/GitServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/CreateDBTablePageSolutionTests.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Weird formatting and version upgrades

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2022-09-29 08:54:07 +05:30
Nidhi
6df4dafead
chore: Better server logging infra (#15440)
* Fixed a bunch of server side logging issues

* Tests

* Added ISO8601 timestamp to log format
2022-07-28 09:40:03 +05:30
Shrikant Sharat Kandula
bba78afc3b
chore: Upgrade dependencies reported by Dependabot (#13735)
Upgrades vulnerable dependencies in all plugins except for MySQL. That one is still failing and I'll fix it in a separate PR. Issue #14475

Co-authored-by: Nayan <nayan@appsmith.com>
Co-authored-by: Anagh Hegde <anagh@appsmith.com>
2022-07-19 10:23:27 +05:30
Arpit Mohan
96677ef673
fix: Updating log4j to 2.17.0 to prevent JNDI lookups (#9863)
Also making minor edit to not show "Application name updated" toast message. This is a counter-productive toast that is distracting the user
2021-12-20 16:01:08 +05:30
Sumit Kumar
9faa22ad58
Fix: Dynamodb Plugin: remove data type info keys from raw values. (#6652)
* A fix had been introduced earlier (I had introduced it a few months back) to remove data type info keys from the raw response. However, the transformation was not getting applied to the Query action as the transformation was explicitly limited to few actions. This PR removes that check and allows the transformation for all actions as there does not seem to be any reason to withhold this transformation for other actions.
* The earlier fix also restricted this transformation to results that had specific keys. This PR removes this check as well as it does not seem to be required and further may lead to similar issues if any particular key gets missed.
* Some other redundant checks have been removed from the flow as the transformation function itself takes care of it as edge/base case.
2021-08-17 19:18:25 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +05:30
Sumit Kumar
247e5d7ea4
Feature: return prepared stmt / smart substitution params under request params section for debugging (#4421)
- return prepared stmt / smart substitution params under request params section for debugging
2021-05-17 08:59:17 +05:30
Sumit Kumar
52bfd25824
Feature: return request parameters with type for debug tab (#4078)
- return request parameters with type for debug tab.
- request params are stored in a RequestParamDTO object.
- a configProperty -> label map is cached in pluginService, which returns the param label as per the configProperty it is mapped to via editor.json file.
- This feature currently only works with prepared statements disabled.
2021-04-30 16:26:51 +05:30
Sumit Kumar
41e44eed30
Feature: add title to action execution errors to improve user experience (#3872)
- add title to action execution errors to improve user experience
    - all errors in AppsmithPluginErrors
    - action execution related errors in AppsmithError : NO_CONFIGURATION_FOUND_IN_DATASOURCE, INVALID_ACTION, INVALID_DATASOURCE, INVALID_DATASOURCE_CONFIGURATION - as these are the likely errors in an action execution flow (excluding plugin specific flow) that might result from faulty action / datasource configuration by a user.
    - title is returned as part of ActionExecutionResult.
    - title is set in ActionExecutionResult on failure during action execution.
    - In response to review comment - added a new BaseException class, so that both AppsmithException and AppsmithPluginException extend this base class. Also, refactored code to introduce setErrorInfo() function in ActionExecutionResult class to set its attributes.
- Some unrelated cleanup:
    - catch PoolInitializationException for Postgres plugin and return AppsmithPuginException
    - catch MongoTimeoutException and return AppsmithPluginException
2021-04-08 09:49:05 +05:30
Nidhi
683176fc48
Increased default limit for webclient payload (#3718)
* Increased default limit for webclient payload
2021-03-26 21:34:10 +05:30
Trisha Anand
217e36aaa9
Enrichment of analytics event for execute. (#3492)
* WIP : enrichment of analytics event for execute.

* Plugin level : Catch all exceptions and set request in the result
Server level : Adding new fields to analytics : `isSuccessfulExecution`, `statusCode`, `timeElapsed`

* Dont catch StaleConnectionException. Server handles the same.

* Removed class specification for onErrorResume in plugins since its supposed to catch all errors.
2021-03-11 15:40:07 +05:30
Sumit Kumar
5bab77a141
remove endpoint host and port fields from dynamodb datasource form (#3316)
- A consensus has emerged that the utility of overriding endpoint is only for local development and testing. Hence, removing the fields from datasource form.
2021-03-02 17:25:25 +05:30
Sumit Kumar
6c04e1467b
Provide option for only one endpoint and port in the dynamodb plugin datasource form (#3314)
- provide a max length to keyvalue_array type. If the max length is set to 1, then the "+" button will not appear.
- front end changes are pending. A new github issue will be opened to track the same : #3315
2021-03-02 15:42:38 +05:30
Trisha Anand
91e308665b
Requests preparation by plugins instead of ActionService (#3159)
* Added action request in S3 plugin.

* Added request data in Dynamo plugin

* Added request in Elastic Search.

* Request in Firestore.

* Request added in Mongo

* MsSQL request added.

* Added MySQL request.

* Added Postgres request.

* Added redis request.

* Redshift doen.

* Catching AppsmithPluginExceptions at the plugin level itself to ensure that the request gets passed on as part of the result.

* Fixed failing plugin test failures

* Fixed AmazonS3 test failures.

* WIP post analytics working

* WIP : Making the request data confirm to existing analytics request data format.

* Fixed the headers in the analytics body.

* Migrations S3, Postgres to the accepted format for request in analytics

* Updated S3 action to be the query

* Migration completed for all plugins for analytics.

* Removed the old analytics event. Now sending only the new one.

* Ensuring all data is captured in S3 plugin request in case of error.

* Minor editing of firestore to ensure that the errors get caught by the plugin itself.

* Fixed test cases in Amazon S3

* Incorporated review comments.
2021-03-02 10:58:46 +05:30
Sumit Kumar
d2643a18c3
check dynamodb connection validity using listTables cmd. (#3241)
* check dynamodb connection validity using listTables cmd.
* add TC
* add encrypted logo to password field
* rectify the default value of region dropdown
* remove unused imports
2021-02-26 16:57:18 +05:30
Sumit Kumar
1e59ed4928
Internal fix: Remove raw response from transformed DynamoDB response structure. (#3209)
* remove raw response from transformed response structure.
* update TCs
2021-02-25 16:34:07 +05:30
Sumit Kumar
4b09b2c379
Transform Dynamodb response for easy consumption (#3050)
- add support to handle dnyamoDb Binary type
- transform raw response to show extracted response and raw response for:
GetItem
BatchGetItem
DeleteItem
PutItem
Scan
TransactGetItems
UpdateItem
- modify TC.
2021-02-23 16:24:06 +05:30
Shrikant Sharat Kandula
4f6a48bf40
Fix BatchGetItem & TransactGetItems operations failing on the DynamoDB plugin (#3120)
* Fix batch operations APIs failing with DynamoDB

* Fixed TransactGetItems operation on DynamoDB
2021-02-23 09:51:23 +05:30
Shrikant Sharat Kandula
ed1c926c8a
Add datasource structure support for DynamoDB (#2919) 2021-02-10 13:28:35 +05:30
Shrikant Sharat Kandula
fbf6021080
Fix nested structure translation in DynamoDB (#2915) 2021-02-09 06:59:45 +05:30
Sumit Kumar
e6b77a1299
Stop logging some AppsmithPluginException to Sentry (#2351)
1. Move package  appsmith-interfaces/src/main/java/com/appsmith/external/pluginExceptions-> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/pluginExceptions
2. Move enum AppsmithErrorAction from appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java -> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/AppsmithErrorAction.java, so that both plugin exceptions and server exceptions could use the same enum.
3. Log exception based on the error action defined for each exception.
2021-02-04 15:24:30 +05:30
Nidhi
01bbc03857
Fixed handling of lists in dynamodb (#2818) 2021-02-02 13:35:58 +05:30
Nidhi
a00c144e85
Subclassing authentication (#2215)
* Sublcassing authentication

* Removed TODO

* Review changes
2020-12-17 21:38:52 +05:30
Trisha Anand
888d79b06d Removing printing of result objects from plugin execution. 2020-12-09 19:03:51 +05:30
Trisha Anand
8283396056
Moved from boundedElastic to elastic to ensure that the server services the plugin execution request as soon as the request arrives. (#2090) 2020-12-08 22:04:14 +05:30
Trisha Anand
2062c60ca3
Moved all the scheduling of the plugin executions to bounded elastic instead of elastic. (#1931) 2020-11-26 17:50:43 +05:30
Trisha Anand
772884e1a3
Making dynamo db's blocking commands run on elastic thread pool. (#1853) 2020-11-23 17:02:41 +05:30
dependabot[bot]
a4872f3cb6
Bump junit in /app/server/appsmith-plugins/dynamoPlugin (#1335)
Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.11.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.11...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-21 17:57:44 +05:30
Shrikant Sharat Kandula
2a53abd8a6
Add DynamoDB Plugin (#1167)
* Added DynamoPlugin to integrate with DynamoDB

* Connection management for DynamoPlugin

* Process action from a single JSON object as input

* Moved ListTables command to separate class

* Add missing UI definition files

* Use reflection to build request objects for AWS SDK

* All DynamoDB actions are now run purely by reflection

* Serialize responses to JSON

* Remove some unused/commented code and some refactorings

* Add non-working test with generic dynamodb container

* Added working test for ListTables action

* Added test for PutItem action

* Add tests for get and update actions

* Added comments and some refactoring

* Removed unused Command class.

* Added more tests for map to SDK object conversion

* Add templates

* Add option to set an endpoint override

* Fix Dynamo plugin tests when ~/.aws is missing

* Add documentation link for DynamoDB plugin

* Fix validation checks

* Remove debug log

* Added comments on expected query structure

* Fix incorrect error condition with incorrect request format

* Add comment for converting action to method name

* Error out if region is missing

* Remove unused throws declaration

* Use rich form for action configuration

* Removed templates

* Use PNG for logo images

* Use PNG logos for all plugins

* Avoid hard-coded field names

* Change logo to PNG only for ElasticSearch for now

* Wrap errors in AppsmithPluginException

* Typo

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Fix changeset order number

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Minor refactoring and fixed error messaging

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-10-21 17:45:54 +05:30