Skip to content

Commit

Permalink
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
Browse files Browse the repository at this point in the history
…o chore/no-access-state-ds-bottom-tab
  • Loading branch information
ankitakinger committed Dec 20, 2024
2 parents 8dc0ed5 + d1cff32 commit f5eda87
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 14 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
matrix_count: ${{steps.matrix.outputs.matrix_count}}
run_count: ${{ steps.countArgs.outputs.run_count }}
is-pg-build: ${{steps.args.outputs.is-pg-build}}
update_snapshot: ${{steps.args.outputs.update_snapshot}}
specs_to_run: ${{steps.args.outputs.specs_to_run}}
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v4
Expand All @@ -38,6 +40,21 @@ jobs:
runId=$((checkArg + 0))
echo "runId=$runId" >> $GITHUB_OUTPUT
fi
# Check for update_snapshot
checkArg=${{ github.event.client_payload.slash_command.args.named.update_snapshot }}
if [[ -z "$checkArg" ]]; then
echo "update_snapshot=false" >> $GITHUB_OUTPUT
else
echo "update_snapshot=$checkArg" >> $GITHUB_OUTPUT
fi
# Check for spec file
checkArg=${{ github.event.client_payload.slash_command.args.named.specs_to_run }}
if [[ -z "$checkArg" ]]; then
echo "specs_to_run=''" >> $GITHUB_OUTPUT
else
echo "specs_to_run=$checkArg" >> $GITHUB_OUTPUT
fi
- name: Set run count
id: countArgs
Expand Down Expand Up @@ -97,7 +114,7 @@ jobs:
body: |
Tests running at: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
[Cypress dashboard](https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail)
PR: #${{ fromJson(steps.args.outputs.pr) }}.
PR: #${{ fromJson(steps.args.outputs.pr) }} with spec: ${{steps.args.outputs.specs_to_run}} .
server-build:
name: server-build
Expand Down Expand Up @@ -149,6 +166,8 @@ jobs:
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
update_snapshot: ${{fromJson(needs.file-check.outputs.update_snapshot)}}
specs_to_run: ${{needs.file-check.outputs.specs_to_run}}


ci-test-limited-existing-docker-image:
Expand All @@ -162,6 +181,8 @@ jobs:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
previous-workflow-run-id: ${{ fromJson(needs.file-check.outputs.runId) }}
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
update_snapshot: ${{fromJson(needs.file-check.outputs.update_snapshot)}}
specs_to_run: ${{needs.file-check.outputs.specs_to_run}}

ci-test-limited-result:
needs: [file-check, ci-test-limited]
Expand Down
54 changes: 49 additions & 5 deletions .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ on:
required: false
type: number
default: 1
update_snapshot:
description: 'Give option to update snapshot (true/false)'
required: false
type: boolean
default: false
specs_to_run:
description: 'Cypress spec file(s) to run'
required: false
type: string

workflow_call:
inputs:
pr:
Expand All @@ -35,6 +45,15 @@ on:
required: false
type: number
default: 1
update_snapshot:
description: 'Give option to update snapshot (true/false)'
required: false
type: boolean
default: false
specs_to_run:
description: 'Cypress spec file(s) to run'
required: false
type: string

jobs:
ci-test-limited:
Expand Down Expand Up @@ -111,10 +130,18 @@ jobs:
else
echo "rerun=false" >> $GITHUB_OUTPUT
fi
- name: Upload existing snapshot data
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-existing-compare-snapshots
path: ${{ github.workspace }}/app/client/cypress/snapshots
overwrite: true

# Get specs to run
- name: Get specs to run
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
if: ${{ (inputs.specs_to_run == '' || inputs.specs_to_run == null) && steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' }}
run: |
specs_to_run=""
while IFS= read -r line
Expand Down Expand Up @@ -349,10 +376,19 @@ jobs:
NODE_ENV: development
run: |
cd app/client
npx cypress-repeat-pro run -n ${{ inputs.run_count }} --force \
--spec ${{ env.specs_to_run }} \
if [[ "${{ inputs.update_snapshot }}" == "true" ]]; then
echo "Running Cypress with snapshot updates..."
CYPRESS_updateSnapshots=true npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ inputs.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser ${{ env.BROWSER_PATH }}
--browser "${{ env.BROWSER_PATH }}"
else
echo "Running Cypress tests without snapshot updates..."
npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ env.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
fi
cat cy-repeat-summary.txt
# Define the path for the failure flag file
FAILURE_FLAG_FILE="ci_test_status.txt"
Expand Down Expand Up @@ -453,9 +489,17 @@ jobs:
if: always()
with:
name: server-logs
path: app/server/server-logs.log
path: ${{ github.workspace }}/app/server/server-logs.log
overwrite: true

- name: Upload new compared snapshot data
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-new-compare-snapshots
path: ${{ github.workspace }}/app/client/cypress/snapshots
overwrite: true

# Set status = success
- name: Save the status of the run
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-limited.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ jobs:
if: failure()
with:
name: server-logs
path: app/server/server-logs.log
path: ${{ github.workspace }}/app/server/server-logs.log
overwrite: true

# Set status = success
Expand Down
9 changes: 3 additions & 6 deletions app/client/src/ce/workers/Evaluation/evaluationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
ConfigTree,
} from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE } from "ee/entities/DataTree/types";
import _, { difference, find, get, has, isEmpty, isNil, set } from "lodash";
import _, { difference, get, has, isEmpty, isNil, set } from "lodash";
import type { WidgetTypeConfigMap } from "WidgetProvider/factory";
import { PluginType } from "entities/Action";
import { klona } from "klona/full";
Expand Down Expand Up @@ -987,11 +987,8 @@ export const isATriggerPath = (
};

// Checks if entity newly got added to the unevalTree
export const isNewEntity = (updates: DataTreeDiff[], entityName: string) => {
return !!find(updates, {
event: DataTreeDiffEvent.NEW,
payload: { propertyPath: entityName },
});
export const isNewEntity = (updates: Set<string>, entityName: string) => {
return updates.has(entityName);
};

const widgetPathsNotToOverride = (
Expand Down
7 changes: 6 additions & 1 deletion app/client/src/workers/common/DataTreeEvaluator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,11 @@ export default class DataTreeEvaluator {
const { isFirstTree, metaWidgets, unevalUpdates } = options;
let staleMetaIds: string[] = [];

const allNewEntityDiffSet = new Set(
unevalUpdates
.filter((v) => v.event === DataTreeDiffEvent.NEW)
.map((v) => v.payload.propertyPath),
);
let evalContextCache;

if (WorkerEnv.flags.release_evaluation_scope_cache) {
Expand Down Expand Up @@ -1198,7 +1203,7 @@ export default class DataTreeEvaluator {
if (isATriggerPath) continue;

const isNewWidget =
isFirstTree || isNewEntity(unevalUpdates, entityName);
isFirstTree || isNewEntity(allNewEntityDiffSet, entityName);

const widgetEntity = entity as WidgetEntity;

Expand Down

0 comments on commit f5eda87

Please sign in to comment.