From 345372d49f590299fe3f703d93cb5da3b6f8c3a6 Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:59:50 +0530 Subject: [PATCH 1/6] test: increased timeout for Sidebar (#35013) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /ok-to-test tags="@tag.All" > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 5ec099d5e44a0483a575ee41f6c88cf01241ed9f > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Thu, 18 Jul 2024 07:28:51 UTC --- app/client/cypress/support/Pages/IDE/Sidebar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/cypress/support/Pages/IDE/Sidebar.ts b/app/client/cypress/support/Pages/IDE/Sidebar.ts index 58dc4c370b..00a75a1c7c 100644 --- a/app/client/cypress/support/Pages/IDE/Sidebar.ts +++ b/app/client/cypress/support/Pages/IDE/Sidebar.ts @@ -22,7 +22,7 @@ export class Sidebar { ); } - assertVisible(timeout: number = 4000) { + assertVisible(timeout: number = 10000) { cy.get(this.locators.sidebar, { timeout }).should("be.visible"); } } From d90654645db90940983678ff630b545f7112be6e Mon Sep 17 00:00:00 2001 From: Goutham Pratapa Date: Thu, 18 Jul 2024 13:53:10 +0530 Subject: [PATCH 2/6] chore: revert rts build to github runners (#35017) --- .github/workflows/rts-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rts-build.yml b/.github/workflows/rts-build.yml index 12b8dfd82b..8b80d2e3a6 100644 --- a/.github/workflows/rts-build.yml +++ b/.github/workflows/rts-build.yml @@ -32,7 +32,7 @@ defaults: jobs: build: - runs-on: appsmith-self-hosted-deployment-runner + runs-on: ubuntu-latest # Only run this workflow for internally triggered events if: | github.event.pull_request.head.repo.full_name == github.repository || From d044155e238ee24d2d0804a84cc64aa427d49c68 Mon Sep 17 00:00:00 2001 From: Rishabh Rathod Date: Thu, 18 Jul 2024 16:18:10 +0530 Subject: [PATCH 3/6] chore: Revert "chore: delete redundant files" (#35022) --- app/server/scripts/start-dev-server.sh | 18 +++++++++++ app/util/is_wsl.sh | 13 ++++++++ app/util/is_wsl_test.sh | 44 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100755 app/server/scripts/start-dev-server.sh create mode 100755 app/util/is_wsl.sh create mode 100755 app/util/is_wsl_test.sh diff --git a/app/server/scripts/start-dev-server.sh b/app/server/scripts/start-dev-server.sh new file mode 100755 index 0000000000..13b9cd10d8 --- /dev/null +++ b/app/server/scripts/start-dev-server.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Change to the parent directory of the directory containing this script. +cd "$(cd "$(dirname "$0")" && pwd)/.." + +# Ref: . +if [[ -f .env ]]; then + echo "Found a .env file, loading environment variables from that file." + set -o allexport + source .env +fi + +source ../util/is_wsl.sh +if [ $IS_WSL ]; then + _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true $_JAVA_OPTIONS" +fi + +(cd dist && exec java -jar server-*.jar) \ No newline at end of file diff --git a/app/util/is_wsl.sh b/app/util/is_wsl.sh new file mode 100755 index 0000000000..ee100634c0 --- /dev/null +++ b/app/util/is_wsl.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +IS_WSL= + +proc_version="$(cat /proc/version)" +case "$proc_version" in +*icrosoft*) + IS_WSL=true +;; +*WSL*) + IS_WSL=true +;; +esac diff --git a/app/util/is_wsl_test.sh b/app/util/is_wsl_test.sh new file mode 100755 index 0000000000..ba97288f68 --- /dev/null +++ b/app/util/is_wsl_test.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -e + +DIR="$(cd "$(dirname "$0")" && pwd)" + +distro= + +cat() { + echo $distro +} + +fail() { + local reason=$1 + + echo "${reason} + context: ${distro}" + + exit 1 +} + +stub_distro() { + local name=$1 + + distro=$name + source $DIR/is_wsl.sh +} + +stub_distro "Linux Computer 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux" +if [ ! $IS_WSL ]; then + fail "Failed: Detected lack of WSL where it should have." +fi + +stub_distro "Linux Computer 4.19.104-WSL-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux" +if [ ! $IS_WSL ]; then + fail "Failed: Detected lack of WSL where it should have." +fi + +stub_distro "Linux pop-os 5.3.0-22-generic #24+system76~1573659475~19.04~26b2022-Ubuntu SMP Wed Nov 13 20:0 x86_64 x86_64 x86_64 GNU/Linux" +if [ $IS_WSL ]; then + fail "Failed: Detected WSL where it shouldn't have." +fi + +echo "All Tests Pass!" From 404e6e6ad90e7975e770975dab9715465cdd8845 Mon Sep 17 00:00:00 2001 From: Rishabh Rathod Date: Fri, 19 Jul 2024 20:25:39 +0530 Subject: [PATCH 4/6] fix: JSObject function is not defined error (#35035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Add the initial fetch all entity completion to the affectedJSObject logic to make sure the JSObjects are defined on page change Fixes #34681 Fixed #34933 ## Automation /test js ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 88f6c636e89de881883e6d4f5d648104257977b9 > Cypress dashboard. > Tags: `@tag.JS` > Spec: >
Thu, 18 Jul 2024 22:05:02 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of specific action types to ensure correct identification of affected objects. - Enhanced logic to address cases where action types are not included in the predefined set, providing more accurate results. --- app/client/src/ce/sagas/InferAffectedJSObjects.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/client/src/ce/sagas/InferAffectedJSObjects.ts b/app/client/src/ce/sagas/InferAffectedJSObjects.ts index a2cd3e5d34..4f91912ea9 100644 --- a/app/client/src/ce/sagas/InferAffectedJSObjects.ts +++ b/app/client/src/ce/sagas/InferAffectedJSObjects.ts @@ -13,14 +13,20 @@ import type { JSCollection } from "entities/JSCollection"; export function getAffectedJSObjectIdsFromJSAction( action: ReduxAction | BufferedReduxAction, ): AffectedJSObjects { + if (action.type === ReduxActionTypes.FETCH_ALL_PAGE_ENTITY_COMPLETION) { + return { + ids: [], + isAllAffected: true, + }; + } + if (!JS_ACTIONS.includes(action.type)) { return { ids: [], isAllAffected: false, }; } - // only JS actions here - action as ReduxAction; + // When fetching JSActions fails, we need to diff all JSObjects because the reducer updates it // to empty collection if ( From 1b44d2c871229c17b731e5be953bd32820daa442 Mon Sep 17 00:00:00 2001 From: Rajat Agrawal Date: Mon, 22 Jul 2024 09:43:25 +0530 Subject: [PATCH 5/6] Revert "ci: Add a pre-push hook to check for only ce changes" (#35053) Reverts appsmithorg/appsmith#34992 --- app/client/.husky/pre-push | 95 -------------------------------------- 1 file changed, 95 deletions(-) delete mode 100755 app/client/.husky/pre-push diff --git a/app/client/.husky/pre-push b/app/client/.husky/pre-push deleted file mode 100755 index 7eb289f2e4..0000000000 --- a/app/client/.husky/pre-push +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -echo "Pre push hook called" - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# - -appsmith_ee_url="appsmith-ee.git" -appsmith_ce_url="appsmithorg/appsmith.git" - -# Define the null SHA. -null_sha="0000000000000000000000000000000000000000" - -# Function to get list of files between two commits -do_commits_contain_ee_files() { - # Store the commit hashes - from_commit=$1 - to_commit=$2 - string_to_match="app/client/src/ee" - - # to_commit sha can be null if a branch is being pushed for the first to remote - # In that case, we would need to compare the diff against a default branch, like release. - if [ "$to_commit" == "$null_sha" ]; then - echo "comparing changes against release" - - remote_name=$(git remote -v | grep -i $appsmith_ce_url | grep -i fetch | awk '{print $1}') - echo "remote name is $remote_name" - - git fetch $remote_name release - to_commit=$remote_name/release - fi - - echo "to_commit in function is $to_commit" - echo "from_commit is $from_commit" - - # Get the list of files between the two commits - files=$(git diff --name-only $from_commit $to_commit) - - # Iterate over each file - for file in $files; do - # Check if the file path contains the string - if [[ "$file" == *"$string_to_match"* ]]; then - echo "File '$file' matches the string '$string_to_match'" - return 0 - fi - done - return 1 -} - - -remote="$1" -url="$2" - -echo "URL is $url" -echo "remote is $remote" -echo "remote sha is $remote_sha" - -if [[ "$url" == *"$appsmith_ee_url"* ]]; then - echo "Hook invoked on EE repo. Ignoring pre-push hook checks" - exit 0 -fi - -while read local_ref local_sha remote_ref remote_sha -do - echo "pushing from $local_sha to $remote_sha" - echo "local ref is " $local_ref - echo "remote ref is " $remote_ref - - if [ "$local_sha" == "$null_sha" ]; then - echo "Branch is being deleted. Allow push" - exit 0 - fi - - if do_commits_contain_ee_files $local_sha $remote_sha - then - echo -e "Found EE changes in the commits\n" - exit 1 - else - echo -e "Didn't find ee changes in the commits\n" - exit 0 - fi -done \ No newline at end of file From 57deccef3b1886b51858d4fa5f5bb55debf15bf9 Mon Sep 17 00:00:00 2001 From: albinAppsmith <87797149+albinAppsmith@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:24:30 +0530 Subject: [PATCH 6/6] fix: Removed switch for overflow list when there are no files (#34983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Tabs overflow switch was staying active when no tabs is selected. This was confusing users and was grabing attention towards it. This PR removed the list button when there are no tabs. Fixes #34624 ## Automation /ok-to-test tags="@tag.Sanity, @tag.IDE" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 00ca00327095807d91964f191e898e0fee36be54 > Cypress dashboard. > Tags: `@tag.Sanity, @tag.IDE` > Spec: >
Wed, 17 Jul 2024 08:44:15 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Improved the conditional rendering of the `ToggleButton` in the `EditorTabs` based on `ideViewMode` and file presence for a more intuitive user experience. - **Tests** - Simplified and generalized the test cases for `EditorTabs` to ensure more reliable test results. --- .../pages/Editor/IDE/EditorTabs/Editortabs.test.tsx | 10 ++-------- app/client/src/pages/Editor/IDE/EditorTabs/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx b/app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx index 9e915cc936..d6d6afe83e 100644 --- a/app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx +++ b/app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx @@ -39,7 +39,6 @@ describe("EditorTabs render checks", () => { `/app/applicationSlug/pageSlug-${page.pageId}/edit`, state, ); - // check toggle is active expect(container.firstChild).toBeNull(); }); @@ -49,11 +48,6 @@ describe("EditorTabs render checks", () => { `/app/applicationSlug/pageSlug-${page.pageId}/edit/queries`, state, ); - // check toggle is active - expect(getByTestId("t--list-toggle")).toHaveAttribute( - "data-selected", - "true", - ); // check tabs is empty const tabsContainer = getByTestId("t--tabs-container"); expect(tabsContainer.firstChild).toBeNull(); @@ -74,7 +68,7 @@ describe("EditorTabs render checks", () => { `/app/applicationSlug/pageSlug-${page.pageId}/edit/queries`, state, ); - // check toggle is active + // check toggle expect(queryByTestId("t--list-toggle")).toBeNull(); // check tabs is empty @@ -143,7 +137,7 @@ describe("EditorTabs render checks", () => { state, ); - // check toggle is not active + // check toggle expect(queryByTestId("t--list-toggle")).toBeNull(); // check tabs is not empty diff --git a/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx b/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx index bd901e3bef..b8f91f10ae 100644 --- a/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx +++ b/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx @@ -86,7 +86,7 @@ const EditorTabs = () => { return ( <> - {ideViewMode === EditorViewMode.SplitScreen && ( + {ideViewMode === EditorViewMode.SplitScreen && files.length > 0 ? ( { onClick={handleHamburgerClick} size="md" /> - )} + ) : null}