Commit Graph

62 Commits

Author SHA1 Message Date
Trisha Anand
d5e5be5d6a
[Feature] Mongo Form (#4378) 2021-05-19 11:05:24 +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
Trisha Anand
dd00f51808
Type Migration for Plugins Part 2 : Migration of existing actions + revert hotfix for editor.json (#4085)
* WIP :  Migration of data type for smart substitution configuration

* Fixed the migration code. Also reverted editor.jsons  back to equality check after migrations of existing actions

* Only fetching actions for plugins which belong to supported plugins.

* Setting a default value of "false" for all the actions which don't have a valid configuration for smart substitution.

* Minor code formatting

* Minor language change in comment

* Removed debug logs
2021-04-22 12:07:25 +05:30
Trisha Anand
30a82c2d24
Hotfix for broken release. Would do a proper fix on release tomorrow with migration (#4075) 2021-04-20 18:54:34 +05:30
Trisha Anand
eeaa26a7cc
Type migration from String to Object for plugin specified templates to preserve boolean and any other future data types (#4053)
* WIP : Type migration from String to Object for value

* Migrating config from string to boolean for prepared statement.
Handled error for already stored actions where PS config is stored as String and not Boolean.
2021-04-20 16:09:48 +05:30
Trisha Anand
9b49308abe
Adding dependency relationship to plugins (#3997)
* Added dependencies to be added to dependencyMap on client to Postgres, MSSQL, MySQL and Mongo plugins

* Added Dependency config for API

* Fixed the test case
2021-04-15 11:36:41 +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
Hetu Nandu
28995e5b53
Fix PS and smart substitute true false value (#3896) 2021-04-07 16:06:17 +05:30
Hetu Nandu
5a1584377b
Update editor.json for Postgres, Mongo, MySQL, MS-SQL adding evaluation type (#3884)
Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-04-06 18:27:51 +05:30
Trisha Anand
4a087b172c
Feature : BSON Smart Substitution in Mongo Plugin (#3804)
* Feature : JSON Smart Substitution in Mongo Plugin

* Added BSON data type for Mongo substitution. Added test case

* Minor comment added

* Minor variable re-naming and correcting failing test cases.

* REST API : Escaping special characters in string before smart substitution

* Incorporated review comment
2021-04-05 17:12:29 +05:30
Sumit Kumar
00bcac7591
add support for 'prefer' ssl mode in postgresql. (#3848)
- add support for 'Prefer' ssl option for postgres plugin.
2021-04-05 15:51:17 +05:30
Sumit Kumar
7dbae1e481
fix regex for whitespace (#3761)
- fix regex for whitespace
2021-03-30 15:03:39 +05:30
Trisha Anand
b9fd72e89d
Smart Substitution Debugging - Adding Appsmith data type to each parameter in response's request object for execute (#3716)
* Smart Substitution Debugging - Adding appsmith data type to each parameter in response's request object for execute

* Incorporated review comments.

* Fixed failing test cases.

* Fixed MS-SQL test failures.
2021-03-26 23:29:12 +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
ed1a0b4045
Refactor the smart substitution code to extract common code at plugin interface level. (#3497) 2021-03-25 19:10:42 +05:30
Sumit Kumar
56f22edbe8
Return hint message on identical columns (#3656)
- Return hint message if identical column names are found in SQL query for postgres, MySQL, mssql, redshift plugin.
- Add a PluginUtils class to hold general utility functions for plugins.
2021-03-24 08:22:49 +05:30
Sumit Kumar
38c5639542
Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins. (#3518)
- Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins.
- Added a new option default, apart from the the SSL mode types supported by the driver. Default means that go with whatever default configuration driver provides.
2021-03-19 15:03:56 +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
Trisha Anand
9f63bfafd2
Adding JSON intelligent substitution for Rest Api plugin (#3474)
* POC : null value getting handled correctly

* Refactor code. Tested with and without quotes. This is working! Woohoo!

* Added support for mustache binding to include json objects and arrays

* Added test for smart substitution.

* Added setting to turn on/off smart substitutions in Rest API plugin

* Handling turning on smart json substitution

* Added error handling

* Added config to turn on smart substitution in JSON to make the tests pass now

* Adding a beta tag to the API setting.

* Spelling error resolved.

* Incorporated review comments.

* Catching JSON Parse exception in http call.
2021-03-11 14:10:00 +05:30
Trisha Anand
10cd7f5f80
Adding support for Prepared Statements in MySQL plugin (#3327) 2021-03-05 16:22:46 +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
Trisha Anand
e5574c1945
Support Prepared Statements in Postgres (#2967)
* Pushing minor editor form changes to ensure that prepared statement could be turned off.

* Code refactor to do variable substitution in PluginExecutor instead of action service.

* WIP : Prepared Statement handling in psql plugin

* WIP Prepared Statements.

* Working version of prepared statements

* Quote trimming added for post preparing sql statements. Now the unprepared statements and prepared statements do not require edits.

* Fixed existing test cases failing.

* Code formatting.

* Super minor code cleanup.

* Added migration for the existing postgres actions.

* Fixed failing test cases in ActionServiceTest.

* Minor change in the text for turning on and off prepared statements in the postgres query pane.

* Added test cases for prepared statement.

* Some minor comments for code readability

* Moved Prepared Statement setting from Action Configuration to Plugin Specified Templates since this setting does not make sense for all the DB plugins.

* Added function level comments

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/SqlStringUtils.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/SqlStringUtils.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Incorporated review comments.

* Fixed compile time error.

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2021-02-18 18:33:27 +05:30
Nidhi
c0e44d0cd9
Added null check for error messages (#2922)
* Added null check for error messages

* Added a generic null check for future null pointers from other sources.
2021-02-09 15:00:22 +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
Nikhil Nandagopal
db9c2d6c27 Updated doc link 2021-02-03 17:28:05 +05:30
Nidhi
6515b5c91c
Fixed null endpoint issue for MySQL plugin (#2719) 2021-01-26 17:16:31 +05:30
Shrikant Sharat Kandula
5e04ca5c9d
Add ability to configure order of templates of plugins (#2279) 2020-12-18 20:45:08 +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
Sumit Kumar
db3636f7b0
mysql plugin - check if connection is stale before running query (#2080)
1. Check if mysql plugin connection is stale. If so, then return stale connection exception which triggers a retry after 
    establishing a new connection.
2. Refactor execute method code to remove code duplication.
3. Add a new test case to check if stale connection gets detected.
2020-12-08 21:03:31 +05:30
Sumit Kumar
d347448b24
Propagte mysql test datasource failure to UI. (#2001)
1. Propagte mysql test datasource failure exception message to UI.
2. Change build TC to reflect the same.
2020-12-02 17:53:38 +05:30
Sumit Kumar
b3c3102c72
Add tests for mysql plugin to test all regularly used data types in mysql. (#1994) 2020-12-02 11:49:41 +05:30
Sumit Kumar
883fa44896
Make sql plugin use R2DBC driver instead of JDBC driver (#1936)
1. Add R2BC driver and remove JDBC driver usage in mysql plugin to make the plugin reactive.
2. Update dependencies in POM file.
3. Update mysql plugin to return result based on the type of sql query i.e select vs other queries. In case the queries are chained, then the last query is used for deciding the type.
4. Added a new TC for testing datasource and removed a non functional TC.
2020-11-28 18:04:56 +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
d8cba1bf8c
Making MySql blocking commands run on elastic thread pool (#1862) 2020-11-23 17:02:18 +05:30
Arpit Mohan
470f2fafcd
Adding support for https endpoints for ES plugin (#1445)
* Adding host:port validation checks to ES plugin & Redis plugin

Also correcting the assertions in the RedisPluginTest so that the error message on test failure is accurate.

* Removing the endpoint validation from datasourceServiceImpl

Moving the endpoint validation to the plugin implementation classes because there are databases that require complete HTTP URL in their configuration. Checking for http/https at the platform level affects the UX for the user & plugin developer when using a new integration. Hence, all plugins must implement their own client/server validations in their own implementations

* Adding tests to assert hostname validation in mysql & postgres plugins
2020-10-28 19:06:10 +05:30
akash-codemonk
9d27315213
Update datasource form config to include encrypted property (#1360) 2020-10-23 13:31:46 +05:30
Arpit Mohan
45e436a7c6 Merging latest master into release 2020-10-19 23:02:24 +05:30
Nikhil Nandagopal
77e1998e74
updated query template to have an explanatory comment (#1260) 2020-10-19 15:10:21 +05:30
akash-codemonk
0772bffe23
Create a new input field which outputs a key value pair (#1226) 2020-10-16 13:04:32 +05:30
dependabot[bot]
f6b1ff2ed4
Bump junit in /app/server/appsmith-plugins/mysqlPlugin (#1163)
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-13 14:33:02 +05:30
Shrikant Sharat Kandula
13ddcc0cc9
Upgrade pf4j & test containers and fix plugin tests (#1156) 2020-10-13 13:42:14 +05:30
Shrikant Sharat Kandula
4f3de3ab9f
Datasource structure support for MongoDB (#641)
* Added structure for MongoDB datasources

* Fixed tests for MongoDB template queries
2020-10-01 10:41:29 +05:30
Shrikant Sharat Kandula
2bb2ad4d19
Fix zero date-times in MySQL throwing exceptions (#705) 2020-09-24 14:36:22 +05:30
Shrikant Sharat Kandula
de1ea7dfb4
Add option to override server timezone for MySQL datasources (#659)
* Add option to override server timezone for MySQL datasources

* Added test for server timezone override for MySQL

* Fix serverTimezone property config
2020-09-23 10:07:33 +05:30
Shrikant Sharat Kandula
6ef5838cd8
Add UPDATE query templates for Postgres and MySQL plugins (#646) 2020-09-21 17:56:24 +05:30
Shrikant Sharat Kandula
75ba90928e
Add datasource structure caching and MySQL structure support (#553)
* Implement caching for datasource structure

* Avoid using final fields so spring-data can load objects

* Use type variable for getStructure method

* Initial version with base structure for MySQL plugin

* Add tests for MySQL plugin structure

* Add sorting for keys in Postgres structure as well

* Show "primary key" instead of just "primary"

* Refactor to reduce inline magic strings
2020-09-17 13:59:46 +05:30
Shrikant Sharat Kandula
e551043080
Fix plugin executions/test/structure breaks when auth is null (#544) 2020-09-15 12:09:49 +05:30