From 294503b03bb1b3b2023b6a316e124645ba3b3322 Mon Sep 17 00:00:00 2001 From: Rishabh Rathod Date: Tue, 10 Sep 2024 17:21:50 +0530 Subject: [PATCH] fix: Remove Gsheets unauth method (#36125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This PR temporarily removes the unauthorised Google Sheets method to ensure users are only shown methods that would work and avoid causing confusion. - The feature flag wasn't used here as the form JSON config's method field does not support hidden fields using feature flag and we avoided writing a logic specifically to remove the field from JSON before sending it as once the other methods get authorised again, we won't need the feature flag again Fixes #35523 ## Automation /test gsheet ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 040643a4d4ed4f2467a0af5733f4015a92d74e26 > Cypress dashboard. > Tags: `@tag.GSheet` > Spec: >
Tue, 10 Sep 2024 09:37:24 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Simplified authorization options for Google Sheets integration, now limited to read and write access for selected sheets only. - **Bug Fixes** - Updated integration tests to reflect the removal of outdated Google Sheets permission options, ensuring tests align with current authorization constraints. - **Tests** - Temporarily skipped multiple test suites related to Google Sheets functionality to streamline testing and focus on relevant tests. --- app/client/cypress/e2e/GSheet/AllAccess_Spec.ts | 2 +- app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts | 2 +- .../cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts | 2 +- .../cypress/e2e/GSheet/ReadOnly_Access_Spec.ts | 2 +- .../e2e/GSheet/WidgetBinding_AllAccess_Spec.ts | 2 +- .../ServerSide/QueryPane/GoogleSheets_spec.ts | 9 ++++----- .../googleSheetsPlugin/src/main/resources/form.json | 12 ------------ 7 files changed, 9 insertions(+), 22 deletions(-) diff --git a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts index 0f4ac2f2d2..aca3a5ab40 100644 --- a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts @@ -15,7 +15,7 @@ const workspaceName = "gsheet apps"; const dataSourceName = "gsheet-all"; let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; -describe( +describe.skip( "GSheet-Functional Tests With All Access", { tags: ["@tag.Datasource", "@tag.GSheet"] }, function () { diff --git a/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts b/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts index 479c3b65b5..b54a27b257 100644 --- a/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts +++ b/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts @@ -21,7 +21,7 @@ const workspaceName = "gsheet apps"; const dataSourceName = "gsheet-all"; let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; -describe( +describe.skip( "GSheet Miscellaneous Tests", { tags: ["@tag.Datasource", "@tag.GSheet"] }, function () { diff --git a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts index 38bfcc82f8..8d5a72c78b 100644 --- a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts @@ -11,7 +11,7 @@ import { appSettings, } from "../../support/Objects/ObjectsCore"; -describe( +describe.skip( "GSheet-Functional Tests With Read/Write Access", { tags: ["@tag.Datasource", "@tag.GSheet"] }, function () { diff --git a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts index 95ad0629d4..e90840f7d3 100644 --- a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts @@ -11,7 +11,7 @@ import { appSettings, } from "../../support/Objects/ObjectsCore"; -describe( +describe.skip( "GSheet-Functional Tests With Read Access", { tags: ["@tag.Datasource", "@tag.GSheet"] }, function () { diff --git a/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts b/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts index 1bf5939922..a3afbd7761 100644 --- a/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts @@ -21,7 +21,7 @@ const workspaceName = "gsheet apps"; const dataSourceName = "gsheet-all"; let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; -describe( +describe.skip( "GSheet-widget binding", { tags: ["@tag.Datasource", "@tag.GSheet"] }, function () { diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts index 345f3982e4..792f633cd8 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts @@ -20,9 +20,10 @@ describe( dataSources.CreatePlugIn("Google Sheets"); VerifyFunctionDropdown([ "Read / Write / Delete | Selected google sheets", - "Read / Write / Delete | All google sheets", - "Read / Write | All google sheets", - "Read | All google sheets", + // Hiding below methods as they are not authorized at this state + // "Read / Write / Delete | All google sheets", + // "Read / Write | All google sheets", + // "Read | All google sheets", ]); dataSources.SaveDSFromDialog(false); }); @@ -31,8 +32,6 @@ describe( agHelper.GetNClick(dataSources._gsScopeDropdown); cy.get(dataSources._gsScopeOptions).then(function ($ele) { expect($ele.eq(0).text()).to.be.oneOf(scopeOptions); - expect($ele.eq(1).text()).to.be.oneOf(scopeOptions); - expect($ele.eq(2).text()).to.be.oneOf(scopeOptions); }); agHelper.GetNClick(dataSources._gsScopeDropdown); } diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json index 66447b9f56..25774c83cf 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json @@ -38,18 +38,6 @@ { "label": "Read / Write / Delete | Selected google sheets", "value": "https://www.googleapis.com/auth/drive.file" - }, - { - "label": "Read / Write / Delete | All google sheets", - "value": "https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drive" - }, - { - "label": "Read / Write | All google sheets", - "value": "https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drive.readonly" - }, - { - "label": "Read | All google sheets", - "value": "https://www.googleapis.com/auth/spreadsheets.readonly,https://www.googleapis.com/auth/drive.readonly" } ], "initialValue": "https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drive",