-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove Gsheets unauth method #36125
Conversation
WalkthroughThe recent changes involve modifications to the Google Sheets integration within the application, specifically focusing on the authorization scopes and the corresponding tests. Certain permissions have been removed from both the testing framework and the JSON configuration, streamlining the available options to enhance user experience and align with current authorization requirements. Changes
Assessment against linked issues
Possibly related issues
Poem
Tip Announcements
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10717377018. |
Deploy-Preview-URL: https://ce-36125.dp.appsmith.com |
app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts (2 hunks)
- app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json (1 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts (1)
Pattern
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
Additional comments not posted (3)
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/form.json (1)
Line range hint
1-30
: Approval of Simplified Authorization ScopesThe changes to the JSON configuration effectively simplify the authorization options, aligning with the PR's objective to reduce user confusion during the authorization issues with Google. The remaining scope for "Read / Write / Delete | Selected google sheets" is correctly retained and should be thoroughly tested to ensure it functions as expected.
app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts (2)
23-26
: Temporary Removal of Unauthorized Methods in TestsThe commenting out of certain dropdown options in the test is a necessary adjustment given the current authorization constraints with Google. This change aligns the tests with the actual state of the application, ensuring that only authorized options are tested.
23-26
: Avoid UsingagHelper.Sleep()
The use of
agHelper.Sleep()
in the test cases is not recommended as it introduces potential flakiness and makes the tests less reliable. Consider using Cypress's built-in wait mechanisms to wait for specific conditions or elements, which can provide a more robust and efficient testing approach.Skipped due to learnings
Learnt from: sagar-qa007 PR: appsmithorg/appsmith#34955 File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settingsTe_Spec.ts:33-33 Timestamp: 2024-07-16T08:25:23.799Z Learning: Avoid using sleep functions like `agHelper.Sleep` and `this.Sleep` in Cypress tests within the `app/client/cypress` directory to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable.
Learnt from: sagar-qa007 PR: appsmithorg/appsmith#34955 File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56 Timestamp: 2024-07-16T06:44:55.263Z Learning: Avoid using sleep functions like `agHelper.Sleep`, `this.Sleep` in Cypress tests within the `app/client/cypress` directory to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable.
Learnt from: sagar-qa007 PR: appsmithorg/appsmith#35412 File: app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/mysql_spec.ts:99-99 Timestamp: 2024-08-06T05:59:19.000Z Learning: In Cypress tests within the `app/client/cypress` directory, avoid using `agHelper.Sleep`, `this.Sleep`, and other related sleep functions to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable. Instead, use Cypress methods like `cy.get()`, `cy.contains()`, and `cy.intercept()` to wait for specific conditions.
Learnt from: ApekshaBhosale PR: appsmithorg/appsmith#35412 File: app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/mysql_spec.ts:99-99 Timestamp: 2024-08-06T05:39:47.929Z Learning: In Cypress tests, avoid using `agHelper.Sleep` as it can lead to flaky tests and unnecessary delays. Instead, use Cypress methods like `cy.get()`, `cy.contains()`, and `cy.intercept()` to wait for specific conditions.
Learnt from: sagar-qa007 PR: appsmithorg/appsmith#34955 File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56 Timestamp: 2024-07-16T06:48:43.110Z Learning: Learnt from: sagar-qa007 PR: appsmithorg/appsmith#34955 File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56 Timestamp: 2024-07-16T06:44:55.118Z Learning: Avoid using sleep functions like `agHelper.Sleep`, `this.Sleep`, and other related sleep functions in Cypress tests within the `app/client/cypress` directory to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable.
Learnt from: sagar-qa007 PR: appsmithorg/appsmith#34955 File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settingsTe_Spec.ts:33-33 Timestamp: 2024-07-16T08:27:01.667Z Learning: Follow best practices for Cypress code and e2e automation: - Avoid using cy.wait in code. - Avoid using cy.pause in code. - Avoid using agHelper.sleep(). - Use locator variables for locators and do not use plain strings. - Use data-* attributes for selectors. - Avoid Xpaths, Attributes, and CSS path. - Avoid selectors like .btn.submit or button[type=submit]. - Perform logins via API with LoginFromAPI. - Perform logout via API with LogOutviaAPI. - Perform signup via API with SignupFromAPI. - Avoid using it.only. - Avoid using after and aftereach in test cases. - Use multiple assertions for expect statements. - Avoid using strings for assertions. - Do not use duplicate filenames even with different paths. - Avoid using agHelper.Sleep, this.Sleep in any file in code.
// 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Data Attributes for Selectors
To enhance the maintainability and readability of your test code, consider using data-*
attributes for your selectors instead of relying on class names or other attributes. This practice helps decouple your tests from changes in the UI and makes your selectors more descriptive and easier to manage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- app/client/cypress/e2e/GSheet/AllAccess_Spec.ts (1 hunks)
- app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts (1 hunks)
- app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts (1 hunks)
- app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts (1 hunks)
- app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts (1 hunks)
Files skipped from review due to trivial changes (5)
- app/client/cypress/e2e/GSheet/AllAccess_Spec.ts
- app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts
- app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts
- app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts
- app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts
Failed server tests
|
PR is ready to merge as the gheet specific test are changed to pass.
## 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 appsmithorg#35523 ## Automation /test gsheet ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10789501829> > Commit: 040643a > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10789501829&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.GSheet` > Spec: > <hr>Tue, 10 Sep 2024 09:37:24 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This reverts commit 294503b.
## Description This PR adds back all sheets option which had been removed in PR: #36125 Fixes #38002 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Datasource, @tag.Widget" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12311024852> > Commit: e177b64 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12311024852&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource, @tag.Widget` > Spec: > <hr>Fri, 13 Dec 2024 08:27:08 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new options for Google Sheets permissions, enhancing user selection capabilities. - Introduced a feature flag to control the visibility of new Google Sheets options. - **Bug Fixes** - Improved handling of feature flags in the datasource section rendering, ensuring correct visibility based on flags. - **Documentation** - Updated test specifications for Google Sheets datasource to include new dropdown options. - **Chores** - Enhanced the logic for setting default values in the RadioButtonControl component. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”> Co-authored-by: Alex Golovanov <alex@appsmith.com>
Description
This PR temporarily removes the unauthorised Google Sheets method to ensure users are only shown methods that would work and avoid causing confusion.
Fixes #35523
Automation
/test gsheet
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10789501829
Commit: 040643a
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?
Summary by CodeRabbit
New Features
Bug Fixes
Tests