appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

feat: enable datasource reconnection while forking application

Open NilanshBansal opened this issue 1 year ago • 38 comments

Description

This PR sets a field isPartialImport in the /{defaultApplicationId}/fork/{workspaceId} POST API response, based on which the client will show the reconnection modal. If the isPartialImport field is True, the client has to show the reconnection modal. Earlier, this field was only added as part of the Import flow and not the forking flow, hence the reconnect datasource modal was only shown while importing an app from JSON when datasource credentials are not present.

This PR will solve the following issues:

  1. Create a new field forkWithConfiguration that will represent whether datasource credentials will be shared while forking or not. Issue #21691 (Initial PR #22157, but had to be reverted due to the reconnection modal functionality, not being present in the forking code)
  2. Enable Reconnection Datasource Modal while forking an app if datasource credentials are not shared. Issue #22305
  3. Reset flags forkWithConfiguration and exportWithConfiguration to False when forking/cloning/exporting an app. Issues #22165 #22166
  4. Reconnect Datasource Modal is not being triggered when forking apps using Google Sheets datasource. https://github.com/appsmithorg/appsmith/issues/16767

Frontend changes

Fronted changes involve showing the reconnect modal depending of the flag sent by the backend post forking. So far on prod datasources need not require re-authentication, with this change they will be prompted to re-authenticate. Cypress tests will be pushed post merging this PR as cypress CI uses release backend. Have created a PR for it https://github.com/appsmithorg/appsmith/pull/22696/commits/d703a00a7c06d0421a658a681b9730812273d7d9#diff-2f04da010b929ec86d1064b51ce570cc33fee7481997ff5477a48e3527773dd9R7

https://user-images.githubusercontent.com/67054171/234506804-f1b5f21b-dd4d-4616-8cfe-6b06649d5df6.mov

Deploy preview

https://ce-22390.dp.appsmith.com/

Fixes #22305 Fixes https://github.com/appsmithorg/appsmith/issues/22609

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Manual
  • JUnit
  • Cypress

Test Plan

  • https://docs.google.com/spreadsheets/d/1vGYaKHtl8-g7--zBEAP219DCZLhoNah6IwjiijJlQAc/edit#gid=0

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [ ] PR is being merged under a feature flag

QA activity:

  • [X] Test plan has been approved by relevant developers
  • [X] Test plan has been peer reviewed by QA
  • [ ] Cypress test cases have been added and approved by either SDET or manual QA
  • [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA
  • [ ] Added Test Plan Approved label after reveiwing all Cypress test

NilanshBansal avatar Apr 13 '23 15:04 NilanshBansal

/build-deploy-preview

akash-codemonk avatar Apr 24 '23 09:04 akash-codemonk

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4784791286. Workflow: On demand build Docker image and deploy preview. skip-tests: . env: . PR: 22390. recreate: .

github-actions[bot] avatar Apr 24 '23 09:04 github-actions[bot]

/build-deploy-preview

akash-codemonk avatar Apr 24 '23 09:04 akash-codemonk

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4784856764. Workflow: On demand build Docker image and deploy preview. skip-tests: . env: . PR: 22390. recreate: .

github-actions[bot] avatar Apr 24 '23 09:04 github-actions[bot]

/build-deploy-preview skip-tests=true

akash-codemonk avatar Apr 24 '23 10:04 akash-codemonk

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4785129407. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 22390. recreate: .

github-actions[bot] avatar Apr 24 '23 10:04 github-actions[bot]

Deploy-Preview-URL: https://ce-22390.dp.appsmith.com

github-actions[bot] avatar Apr 24 '23 10:04 github-actions[bot]

/ok-to-test sha=8cdea413f6805c929ce6e652aa9e8ec86c70030e

NilanshBansal avatar Apr 24 '23 18:04 NilanshBansal

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4790032077. Workflow: Appsmith External Integration Test Workflow. Commit: 8cdea413f6805c929ce6e652aa9e8ec86c70030e. PR: 22390. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=22390&runId=4790032077_1

github-actions[bot] avatar Apr 24 '23 18:04 github-actions[bot]

/ok-to-test sha=4f7d70c1ccda161beb0050a2718b4ba8e2347fb8

NilanshBansal avatar Apr 25 '23 11:04 NilanshBansal

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4796918595. Workflow: Appsmith External Integration Test Workflow. Commit: 4f7d70c1ccda161beb0050a2718b4ba8e2347fb8. PR: 22390. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=22390&runId=4796918595_1

github-actions[bot] avatar Apr 25 '23 11:04 github-actions[bot]

/build-deploy-preview skip-tests=true

NilanshBansal avatar Apr 25 '23 11:04 NilanshBansal

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4796973738. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 22390. recreate: .

github-actions[bot] avatar Apr 25 '23 11:04 github-actions[bot]

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/4796918595. Commit: 4f7d70c1ccda161beb0050a2718b4ba8e2347fb8. The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/Application/CommunityIssues_Spec.ts
  2. cypress/integration/Regression_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js
  3. cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts
  4. cypress/integration/Regression_TestSuite/ClientSideTests/MobileResponsiveTests/HugWidgetValidationSpec.js
  5. cypress/integration/Regression_TestSuite/ClientSideTests/Onboarding/CreateNewApp_spec.js
  6. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Chart/Chart_spec.js
  7. cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/DeleteWorkspace_spec.js
  8. cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/LeaveWorkspaceTest_spec.js
  9. cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/ShareAppTests_spec.js
  10. cypress/integration/Regression_TestSuite/ServerSideTests/GenerateCRUD/Postgres1_Spec.ts
  11. cypress/integration/Regression_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad2_Spec.ts
  12. cypress/integration/Regression_TestSuite/ServerSideTests/Postgres_DataTypes/Array_Spec.ts
  13. cypress/integration/Regression_TestSuite/ServerSideTests/Postgres_DataTypes/BooleanEnum_Spec.ts
  14. cypress/integration/SmokeSuite/FormLogin/EnableFormLogin_spec.js
To know the list of identified flaky tests - Refer here

github-actions[bot] avatar Apr 25 '23 13:04 github-actions[bot]

/build-deploy-preview skip-tests=true

NilanshBansal avatar Apr 25 '23 16:04 NilanshBansal

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4799847863. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 22390. recreate: .

github-actions[bot] avatar Apr 25 '23 16:04 github-actions[bot]

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/4796918595. Commit: 4f7d70c1ccda161beb0050a2718b4ba8e2347fb8. All cypress tests have passed 🎉

github-actions[bot] avatar Apr 25 '23 16:04 github-actions[bot]

/build-deploy-preview

akash-codemonk avatar Apr 26 '23 05:04 akash-codemonk

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4805348136. Workflow: On demand build Docker image and deploy preview. skip-tests: . env: . PR: 22390. recreate: .

github-actions[bot] avatar Apr 26 '23 05:04 github-actions[bot]

Deploy-Preview-URL: https://ce-22390.dp.appsmith.com

github-actions[bot] avatar Apr 26 '23 07:04 github-actions[bot]

/ok-to-test

akash-codemonk avatar Apr 28 '23 04:04 akash-codemonk

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4827150326. Workflow: Appsmith External Integration Test Workflow. Commit: ``. PR: 22390. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=22390&runId=4827150326_1

github-actions[bot] avatar Apr 28 '23 04:04 github-actions[bot]

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/4827150326. Commit: ``. The following are new failures, please fix them before merging the PR:

  1. cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js
  2. cypress/integration/Regression_TestSuite/ClientSideTests/MobileResponsiveTests/FillwidgetResizingSpec.js
  3. cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/JSONForm/JSONForm_HiddenFields_spec.js
  4. cypress/integration/Regression_TestSuite/ServerSideTests/ApiTests/API_Search_spec.js
To know the list of identified flaky tests - Refer here

github-actions[bot] avatar Apr 28 '23 06:04 github-actions[bot]

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/4827150326. Commit: ``. All cypress tests have passed 🎉

github-actions[bot] avatar Apr 28 '23 06:04 github-actions[bot]

/build-deploy-preview skip-tests=true

NilanshBansal avatar May 09 '23 05:05 NilanshBansal

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4922675299. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 22390. recreate: .

github-actions[bot] avatar May 09 '23 05:05 github-actions[bot]

Deploy-Preview-URL: https://ce-22390.dp.appsmith.com

github-actions[bot] avatar May 09 '23 05:05 github-actions[bot]

/ok-to-test

NilanshBansal avatar May 11 '23 10:05 NilanshBansal

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4946592312. Workflow: Appsmith External Integration Test Workflow. Commit: ``. PR: 22390. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=22390&runId=4946592312_1

github-actions[bot] avatar May 11 '23 10:05 github-actions[bot]

/build-deploy-preview skip-tests=true

NilanshBansal avatar May 11 '23 10:05 NilanshBansal