From 5968f87be0de411d9de9d8f4a41b092d67047c70 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Sat, 6 Apr 2024 10:09:57 +0530 Subject: [PATCH 1/4] ci: Show default TED tag when blank --- .github/workflows/test-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 047ae63f50..a64ff386f3 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -1,7 +1,7 @@ name: Test, build and push Docker Image run-name: > - ${{ github.workflow }} with TED:${{ inputs.ted_tag }} + ${{ github.workflow }} with TED:${{ inputs.ted_tag || 'latest' }} on: # This workflow will run everyday at 7:00AM, 1:00PM IST on weekdays From b85cf08a51a0e8d21ff42069250ae5e4bffd96b7 Mon Sep 17 00:00:00 2001 From: Nilansh Bansal Date: Mon, 8 Apr 2024 09:01:55 +0530 Subject: [PATCH 2/4] fix: mongo uri lowercasing removed (#32375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > This PR prevents the lowercasing of the URI for the plugins. The URI is now preserved in the same form that the user has added. Fixes #32145 ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: Cypress test results > [!IMPORTANT] > Workflow run: > Commit: `f6dcdc85a4aafdd3329bf7b9de3fa04e583ec340` > Cypress dashboard url: Click here! > All cypress tests have passed 🎉🎉🎉 ## Summary by CodeRabbit - **Bug Fixes** - Fixed an issue with option processing by retaining the original case of keys, ensuring accurate data handling. --- .../external/plugins/utils/DatasourceUtils.java | 11 ++++++----- .../plugins/utils/DatasourceUtilsTest.java | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/utils/DatasourceUtils.java b/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/utils/DatasourceUtils.java index 9f7644f8b9..22447bd93d 100644 --- a/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/utils/DatasourceUtils.java +++ b/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/utils/DatasourceUtils.java @@ -9,6 +9,7 @@ import com.appsmith.external.models.Endpoint; import com.appsmith.external.models.Property; import com.appsmith.external.models.SSLDetails; import com.external.plugins.exceptions.MongoPluginErrorMessages; +import org.springframework.util.LinkedCaseInsensitiveMap; import org.springframework.util.StringUtils; import java.util.ArrayList; @@ -131,23 +132,23 @@ public class DatasourceUtils { } private static String buildURITail(String tailInfo) { - Map optionsMap = new HashMap<>(); - + // case-insensitive match and preserves order of keys, hence the params ordering in the url remains unchanged + Map optionsMap = new LinkedCaseInsensitiveMap<>(); for (final String part : tailInfo.split("[&;]")) { if (part.isEmpty()) { continue; } int idx = part.indexOf('='); if (idx >= 0) { - String key = part.substring(0, idx).toLowerCase(); + String key = part.substring(0, idx); String value = part.substring(idx + 1); optionsMap.put(key, value); } else { - optionsMap.put(part.toLowerCase(), ""); + optionsMap.put(part, ""); } } optionsMap.putIfAbsent("authsource", "admin"); - optionsMap.put("minpoolsize", "0"); + optionsMap.putIfAbsent("minpoolsize", "0"); return optionsMap.entrySet().stream() .map(entry -> { if (StringUtils.hasLength(entry.getValue())) { diff --git a/app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/utils/DatasourceUtilsTest.java b/app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/utils/DatasourceUtilsTest.java index 3516815e2a..a3aeb2b92c 100644 --- a/app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/utils/DatasourceUtilsTest.java +++ b/app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/utils/DatasourceUtilsTest.java @@ -45,7 +45,22 @@ public class DatasourceUtilsTest { public void testBuildClientURI_withUserInfoAndAuthSource() { final String testUri = "mongodb://user:pass@host:port/db?param&authSource=notAdmin"; - final String resultUri = "mongodb://user:newPass@host:port/db?param&authsource=notAdmin&minpoolsize=0"; + final String resultUri = "mongodb://user:newPass@host:port/db?param&authSource=notAdmin&minpoolsize=0"; + + DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration(); + final DBAuth dbAuth = new DBAuth(); + dbAuth.setPassword("newPass"); + datasourceConfiguration.setAuthentication(dbAuth); + datasourceConfiguration.setProperties(List.of(new Property("0", "Yes"), new Property("1", testUri))); + final String clientURI = buildClientURI(datasourceConfiguration); + assertEquals(resultUri, clientURI); + } + + @Test + public void testBuildClientURI_withUpperCaseCharacters_CaseRemainsUnchanged() { + + final String testUri = "mongodb://user:pass@host:port/db?Param&authSource=notAdmin"; + final String resultUri = "mongodb://user:newPass@host:port/db?Param&authSource=notAdmin&minpoolsize=0"; DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration(); final DBAuth dbAuth = new DBAuth(); From dcd97da817efeb6c8646bc6a0356acb33ec568e5 Mon Sep 17 00:00:00 2001 From: Vemparala Surya Vamsi <121419957+vsvamsi1@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:57:16 +0530 Subject: [PATCH 3/4] chore: remove redundant evalTreeWithChanges calls during plugin page load call (#32459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Removed redundant evalTreeWithChanges calls made during plugin on load execution. We have noticed a 30% reduction in both main thread and web worker scripting. Fixes #32475 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!IMPORTANT] > Workflow run: > Commit: `0446a81d087ad975f12cd8e3a83c10380b5eb52d` > Cypress dashboard url: Click here! > All cypress tests have passed 🎉🎉🎉 ## Summary by CodeRabbit ## Summary by CodeRabbit - **Refactor** - Streamlined the execution logic for page load actions to improve performance and code clarity. --- .../sagas/ActionExecution/PluginActionSaga.ts | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index 6f21f05e81..2a7b8c1aaa 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -1213,15 +1213,7 @@ function* executePageLoadAction( data: payload, }), ); - yield put( - updateActionData([ - { - entityName: action.name, - dataPath: "data", - data: payload.body, - }, - ]), - ); + PerformanceTracker.stopAsyncTracking( PerformanceTransactionName.EXECUTE_ACTION, { @@ -1276,15 +1268,7 @@ function* executePageLoadAction( undefined, pageAction.id, ); - yield put( - updateActionData([ - { - entityName: action.name, - dataPath: "data", - data: payload.body, - }, - ]), - ); + yield take(ReduxActionTypes.SET_EVALUATED_TREE); } } From 08ef7ad53b24331eb67d56e2c81dd8d7e61535ae Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Mon, 8 Apr 2024 12:19:16 +0530 Subject: [PATCH 4/4] ci: Weekly schedule for Caddy route tests --- .github/workflows/caddy-routes-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/caddy-routes-test.yml b/.github/workflows/caddy-routes-test.yml index 25fac50395..cf47895442 100644 --- a/.github/workflows/caddy-routes-test.yml +++ b/.github/workflows/caddy-routes-test.yml @@ -1,7 +1,9 @@ -name: Caddy routes test +name: Caddy route tests on: workflow_dispatch: + schedule: + - cron: "0 0 * * MON" jobs: build: