Skip to content

Commit c7197af

Browse files
authored
Merge pull request #38610 from appsmithorg/release
13/01 Daily Promotion
2 parents efdabad + f8784fc commit c7197af

File tree

349 files changed

+4258
-2221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+4258
-2221
lines changed

.github/workflows/ci-client-cyclic-deps-check.yml

+43-9
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,32 @@ jobs:
3434
files: |
3535
app/client/src/**
3636
37+
- name: Use Node.js
38+
if: steps.changed-files.outputs.any_changed == 'true'
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version-file: app/client/package.json
42+
43+
# Globally install the npm package
44+
- name: Install dpdm globally
45+
if: steps.changed-files.outputs.any_changed == 'true'
46+
run: npm install -g [email protected]
47+
48+
# Install all the dependencies
49+
- name: Install dependencies
50+
if: steps.changed-files.outputs.any_changed == 'true'
51+
run: |
52+
yarn install --immutable
53+
3754
- name: Count circular dependencies on PR branch
3855
id: count-cyclic-deps-in-pr
3956
if: steps.changed-files.outputs.any_changed == 'true'
4057
run: |
41-
npx dpdm ./src/* --circular --warning=false --tree=false > pr_circular_deps.txt
42-
pr_count=$(cat pr_circular_deps.txt | wc -l)
58+
dpdm "./src/**/*.{js,jsx,ts,tsx}" --circular --warning=false --tree=false > pr_circular_deps.txt
59+
# awk 'NF' pr_circular_deps.txt: Filter out empty lines from the file
60+
# wc -l: Count the number of lines in the file
61+
# awk '{print $1 - 1}': Subtract 1 from the count because the first line is the header 'Circular Dependencies'
62+
pr_count="$(awk 'NF' pr_circular_deps.txt | wc -l | awk '{print $1 - 1}')"
4363
echo "pr_count=$pr_count" >> $GITHUB_OUTPUT
4464
cat pr_circular_deps.txt
4565
@@ -49,22 +69,31 @@ jobs:
4969
with:
5070
ref: release
5171

72+
# Install all the dependencies
73+
- name: Install dependencies
74+
if: steps.changed-files.outputs.any_changed == 'true'
75+
run: |
76+
yarn install --immutable
77+
5278
- name: Count circular dependencies on release branch
53-
id: coun-cyclic-deps-in-release
79+
id: count-cyclic-deps-in-release
5480
if: steps.changed-files.outputs.any_changed == 'true'
5581
run: |
56-
npx dpdm ./src/* --circular --warning=false --tree=false > release_circular_deps.txt
57-
release_count=$(cat release_circular_deps.txt | wc -l)
82+
dpdm "./src/**/*.{js,jsx,ts,tsx}" --circular --warning=false --tree=false > release_circular_deps.txt
83+
# awk 'NF' release_circular_deps.txt: Filter out empty lines from the file
84+
# wc -l: Count the number of lines in the file
85+
# awk '{print $1 - 1}': Subtract 1 from the count because the first line is the header 'Circular Dependencies'
86+
release_count="$(awk 'NF' release_circular_deps.txt | wc -l | awk '{print $1 - 1}')"
5887
echo "release_count=$release_count" >> $GITHUB_OUTPUT
5988
cat release_circular_deps.txt
6089
6190
- name: Compare circular dependencies
6291
id: compare-deps
6392
if: steps.changed-files.outputs.any_changed == 'true'
6493
run: |
65-
release_count=${{ steps.coun-cyclic-deps-in-release.outputs.release_count }}
66-
pr_count=${{ steps.count-cyclic-deps-in-pr.outputs.pr_count }}
67-
diff=$((pr_count - release_count))
94+
release_count="${{ steps.count-cyclic-deps-in-release.outputs.release_count }}"
95+
pr_count="${{ steps.count-cyclic-deps-in-pr.outputs.pr_count }}"
96+
diff="$((pr_count - release_count))"
6897
6998
if [ "$diff" -gt 0 ]; then
7099
echo "has_more_cyclic_deps=true" >> "$GITHUB_OUTPUT"
@@ -79,9 +108,14 @@ jobs:
79108
github-token: ${{secrets.GITHUB_TOKEN}}
80109
script: |
81110
const prNumber = context.payload.pull_request.number;
82-
const message = `⚠️ Cyclic Dependency Check:\n\nThis PR has increased the number of cyclic dependencies by ${{steps.compare-deps.outputs.diff}}, when compared with the release branch.\n\nRefer [this document](https://appsmith.notion.site/How-to-check-cyclic-dependencies-c47b08fe5f2f4261a3a234b19e13f2db) to identify the cyclic dependencies introduced by this PR.`;
111+
const message = `🔴🔴🔴 Cyclic Dependency Check:\n\nThis PR has increased the number of cyclic dependencies by ${{steps.compare-deps.outputs.diff}}, when compared with the release branch.\n\nRefer [this document](https://appsmith.notion.site/How-to-check-cyclic-dependencies-c47b08fe5f2f4261a3a234b19e13f2db) to identify the cyclic dependencies introduced by this PR.`;
83112
github.issues.createComment({
84113
...context.repo,
85114
issue_number: prNumber,
86115
body: message
87116
});
117+
118+
# Fail the workflow if cyclic dependencies are found
119+
- name: Fail the workflow if cyclic dependencies are found
120+
if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' && steps.changed-files.outputs.any_changed == 'true'
121+
run: exit 1

.github/workflows/ci-test-custom-script.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,12 @@ jobs:
390390
overwrite: true
391391

392392
# Upload the screenshots as artifacts if there's a failure
393-
- uses: actions/upload-artifact@v3
393+
- uses: actions/upload-artifact@v4
394394
if: failure()
395395
with:
396396
name: cypress-screenshots-${{ matrix.job }}
397397
path: ${{ github.workspace }}/app/client/cypress/screenshots/
398+
overwrite: true
398399

399400
- name: Collect CI container logs
400401
if: failure()

.github/workflows/ci-test-limited-with-count.yml

+31-21
Original file line numberDiff line numberDiff line change
@@ -144,35 +144,47 @@ jobs:
144144
# Step to get specs from the file or use the provided specs
145145
- name: Get specs to run
146146
run: |
147+
ls -l
148+
echo "[DEBUG] Checking inputs.specs_to_run: '${{ inputs.specs_to_run }}'"
149+
echo "[DEBUG] Checking github.event.inputs.specs_to_run: '${{ github.event.inputs.specs_to_run }}'"
150+
151+
# Determine the source of the specs_to_run input
152+
if [[ -n "${{ inputs.specs_to_run }}" ]]; then
153+
specs_to_run="${{ inputs.specs_to_run }}" # For workflow_call
154+
echo "[INFO] specs_to_run provided via workflow_call: $specs_to_run"
155+
elif [[ -n "${{ github.event.inputs.specs_to_run }}" ]]; then
156+
specs_to_run="${{ github.event.inputs.specs_to_run }}" # For workflow_dispatch
157+
echo "[INFO] specs_to_run provided via workflow_dispatch: $specs_to_run"
158+
else
159+
specs_to_run=""
160+
echo "[INFO] No specs provided. Falling back to limited-tests.txt."
161+
fi
162+
147163
# Check if specs_to_run is provided; if not, use the fallback file
148-
echo "[DEBUG] Initial specs_to_run value: $specs_to_run"
149-
if [[ -z "$specs_to_run" || "$specs_to_run" == "no_data" ]]; then
150-
echo "[INFO] No specs provided, falling back to limited-tests.txt file."
151-
152-
# Verify if the fallback file exists
153-
if [[ ! -f app/client/cypress/limited-tests.txt ]]; then
154-
echo "[ERROR] limited-tests.txt file not found in app/client/cypress!" >&2
155-
exit 1
156-
else
157-
echo "[DEBUG] limited-tests.txt file found. Proceeding to read specs."
158-
fi
164+
echo "[DEBUG] Initial specs_to_run value: '$specs_to_run'"
165+
166+
if [[ "$specs_to_run" == *"no_data"* || -z "$specs_to_run" || "$specs_to_run" == "" ]]; then
167+
echo "[INFO] No specs provided or 'no_data' detected, falling back to limited-tests.txt file."
159168
169+
# Verify if the fallback file exists
170+
limited_tests_file="${{ github.workspace }}/app/client/cypress/limited-tests.txt"
171+
ls -l ${{ github.workspace }}/app/client/cypress/limited-tests.txt
172+
cat ${{ github.workspace }}/app/client/cypress/limited-tests.txt
160173
specs_to_run=""
161174
162175
# Read each line of limited-tests.txt
163176
while IFS= read -r line || [[ -n "$line" ]]; do
164-
# Log each line being read
165-
echo "[DEBUG] Reading line: $line"
177+
echo "[DEBUG] Read line: '$line'"
166178
167179
# Skip comments and empty lines
168180
if [[ $line =~ ^#|^\/\/ || -z $line ]]; then
169-
echo "[DEBUG] Skipping comment/empty line: $line"
181+
echo "[DEBUG] Skipped line: '$line'" # Indicate skipped lines
170182
continue
171-
else
172-
echo "[DEBUG] Adding spec to specs_to_run: $line"
173-
specs_to_run="$specs_to_run,$line"
174183
fi
175-
done < app/client/cypress/limited-tests.txt
184+
185+
# Add the line to specs_to_run
186+
specs_to_run="$specs_to_run,$line"
187+
done < ${{ github.workspace }}/app/client/cypress/limited-tests.txt
176188
177189
# Remove leading comma
178190
specs_to_run=${specs_to_run#,}
@@ -187,10 +199,8 @@ jobs:
187199
echo "[INFO] Using provided specs: $specs_to_run"
188200
fi
189201
190-
# Log the final specs_to_run value before writing it to GitHub environment
202+
# Log the final specs_to_run value
191203
echo "[DEBUG] Setting specs_to_run to GitHub environment variable: $specs_to_run"
192-
193-
# Set the final specs_to_run to GitHub environment variable
194204
echo "specs_to_run=$specs_to_run" >> $GITHUB_ENV
195205
196206

.github/workflows/github-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
needs:
4444
- prelude
4545

46-
runs-on: ubuntu-latest-4-cores
46+
runs-on: ubuntu-latest-8-cores
4747

4848
defaults:
4949
run:

.github/workflows/quality-checks.yml

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
client-prettier,
103103
client-unit-tests,
104104
client-lint,
105+
client-check-cyclic-deps,
105106
]
106107
if: always()
107108
runs-on: ubuntu-latest
@@ -116,6 +117,7 @@ jobs:
116117
"${{ needs.client-build.result }}" == "failure" || \
117118
"${{ needs.client-prettier.result }}" == "failure" || \
118119
"${{ needs.client-unit-tests.result }}" == "failure" || \
120+
"${{ needs.client-check-cyclic-deps.result }}" == "failure" || \
119121
"${{ needs.client-lint.result }}" == "failure" ]]; then
120122
echo "Quality checks failed";
121123
exit 1;

app/client/cypress/e2e/Regression/ClientSide/AdminSettings/Admin_settings_spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import adminsSettings from "../../../../locators/AdminsSettings";
22
import {
33
agHelper,
44
adminSettings as adminSettingsHelper,
5+
homePage,
56
} from "../../../../support/Objects/ObjectsCore";
67

78
const {
@@ -210,7 +211,9 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
210211
"11. Verify all admin setting sections are accessible",
211212
{ tags: ["@tag.excludeForAirgap"] },
212213
() => {
213-
cy.visit("/applications", { timeout: 60000 });
214+
homePage.LogOutviaAPI();
215+
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
216+
agHelper.VisitNAssert("/applications", "getAllWorkspaces");
214217
agHelper.GetNClick(adminSettingsHelper._adminSettingsBtn);
215218
cy.wait("@getEnvVariables");
216219
agHelper.GetNClick(adminsSettings.generalTab);

app/client/cypress/e2e/Regression/ClientSide/EmbedSettings/EmbedSettings_spec.js

+22-13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
1818
);
1919
};
2020

21+
let clipboardData;
22+
2123
function ValidateEditModeSetting(setting) {
2224
_.deployMode.NavigateBacktoEditor();
2325
_.embedSettings.OpenEmbedSettings();
@@ -31,6 +33,7 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
3133
}
3234

3335
before(() => {
36+
_.agHelper.GiveChromeCopyPermission();
3437
_.homePage.NavigateToHome();
3538
_.homePage.CreateNewApplication();
3639
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.IFRAME);
@@ -48,9 +51,22 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
4851
.click()
4952
.wait(1000);
5053
_.agHelper.ClickButton("Copy application url");
54+
5155
cy.window().then((win) => {
52-
cy.stub(win.navigator.clipboard, "writeText").as("deployUrl").resolves();
56+
new Cypress.Promise((resolve, reject) => {
57+
win.navigator.clipboard.readText().then(resolve).catch(reject);
58+
}).then((text) => {
59+
clipboardData = text; // Store the clipboard content in a variable
60+
cy.log(`Clipboard Content: ${clipboardData}`); // Log clipboard content
61+
expect(clipboardData).to.equal("Expected clipboard text"); // Add assertions if needed
62+
});
5363
});
64+
65+
// Log clipboard data after it's been set
66+
cy.then(() => {
67+
cy.log(`Stored Clipboard Data: ${clipboardData}`);
68+
});
69+
5470
cy.enablePublicAccess();
5571
cy.wait(8000); //adding wait time for iframe to load fully!
5672
_.agHelper.RefreshPage();
@@ -67,10 +83,8 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
6783
cy.get(adminSettings.saveButton).click();
6884
cy.waitForServerRestart();
6985
_.agHelper.Sleep(2000);
70-
cy.get("@deployUrl").then((depUrl) => {
71-
cy.log("deployUrl is " + depUrl);
72-
cy.visit(depUrl, { timeout: 60000 });
73-
});
86+
87+
cy.visit(clipboardData, { timeout: 60000 });
7488
getIframeBody().contains("Submit").should("exist");
7589
ValidateEditModeSetting(_.embedSettings.locators._restrictedText);
7690
// });
@@ -84,10 +98,7 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
8498
cy.get(adminSettings.saveButton).click();
8599
cy.waitForServerRestart();
86100
_.agHelper.Sleep(2000);
87-
cy.get("@deployUrl").then((depUrl) => {
88-
cy.log("deployUrl is " + depUrl);
89-
cy.visit(depUrl, { timeout: 60000 });
90-
});
101+
cy.visit(clipboardData, { timeout: 60000 });
91102
getIframeBody().contains("Submit").should("exist");
92103
ValidateEditModeSetting(_.embedSettings.locators._allowAllText);
93104
// });
@@ -98,13 +109,11 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
98109
cy.get(".t--admin-settings-APPSMITH_ALLOWED_FRAME_ANCESTORS").within(() => {
99110
cy.get("input").last().click();
100111
});
112+
101113
cy.get(adminSettings.saveButton).click();
102114
cy.waitForServerRestart();
103115
_.agHelper.Sleep(2000);
104-
cy.get("@deployUrl").then((depUrl) => {
105-
cy.log("deployUrl is " + depUrl);
106-
cy.visit(depUrl, { timeout: 60000 });
107-
});
116+
cy.visit(clipboardData, { timeout: 60000 });
108117
getIframeBody().contains("Submit").should("not.exist");
109118

110119
ValidateEditModeSetting(_.embedSettings.locators._disabledText);

0 commit comments

Comments
 (0)