Skip to content
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

feat: paragon frontend ds creation implementation added #38456

Open
wants to merge 3 commits into
base: release
Choose a base branch
from

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Jan 2, 2025

Description

This PR adds CE changes for the paragon integrations, with this whenever anybody is using CE version, paragon integrations will be visible but once they click on it, it will ask for them to put in email id and request access.

It's counterpart EE PR handles the paragon integration creation and authorisation in appsmith.

EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5859
EE PR which has both CE and EE changes to ensure all things are working smoothly: https://github.com/appsmithorg/appsmith-ee/pull/5866

Fixes #38406
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"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12627633263
Commit: 9c1e06b
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Mon, 06 Jan 2025 07:10:57 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for External SaaS datasources and plugins.
    • Introduced new actions and configurations for External SaaS integration.
  • Refactor

    • Restructured datasource-related sagas and import paths.
    • Updated selectors and constants to support new plugin type.
  • Code Improvements

    • Enhanced datasource management and integration capabilities.
    • Improved modularity of saga functions.

Copy link
Contributor

coderabbitai bot commented Jan 2, 2025

Walkthrough

This pull request introduces a comprehensive update to the datasource management system, focusing on expanding support for external SaaS integrations. The changes involve modifying multiple files across the application to add a new EXTERNAL_SAAS plugin type, updating import paths, and enhancing the flexibility of datasource and action handling. The modifications streamline the codebase's approach to managing different types of datasources and their associated actions.

Changes

File Change Summary
app/client/src/ce/sagas/DatasourcesSagas.ts Multiple generator functions exported, import paths restructured, removal of watchDatasourcesSagas
app/client/src/ce/sagas/index.tsx Updated import for watchDatasourcesSagas
app/client/src/ce/selectors/entitiesSelector.ts Updated categorization condition for SAAS
app/client/src/constants/AppsmithActionConstants/ActionConstants.tsx Added EXTERNAL_SAAS to PluginType enum, updated constants
app/client/src/constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig.ts Added EXTERNAL_SAAS key with actions
app/client/src/entities/Action/index.ts Introduced EXTERNAL_SAAS enum, new ExternalSaasAction interface
app/client/src/entities/Datasource/index.ts Added ExternalSaasDSAuthentication interface and AuthenticationType enum
app/client/src/entities/JSCollection/index.ts Updated import path for BaseAction
app/client/src/pages/Editor/EntityNavigation/ActionPane/index.ts Added case for PluginType.EXTERNAL_SAAS
app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx Expanded filtering logic for API plugins
app/client/src/sagas/WidgetBlueprintSagas.ts Updated import path for createOrUpdateDataSourceWithAction
app/client/test/sagas.ts Updated import for watchDatasourcesSagas

Sequence Diagram

sequenceDiagram
    participant User
    participant ActionPane
    participant DatasourceSaga
    participant ExternalSaasPlugin

    User->>ActionPane: Select External SaaS Integration
    ActionPane->>DatasourceSaga: Initiate Datasource Creation
    DatasourceSaga->>ExternalSaasPlugin: Create/Authorize Datasource
    ExternalSaasPlugin-->>DatasourceSaga: Return Datasource Configuration
    DatasourceSaga-->>ActionPane: Update UI with New Datasource
Loading

Assessment against linked issues

Objective Addressed Explanation
Enable authorization for paragon integration (38406)
Create new datasource with auth data from paragon (38406) Implementation details for calling datasourceCreate API are unclear.

Possibly related PRs

  • chore: Added pg branch #36086: The changes in the main PR regarding the restructuring of import statements and the exportation of generator functions in DatasourcesSagas.ts may relate to the modifications in the index.tsx file, which also involves changes to the import of watchDatasourcesSagas, indicating a connection in how these sagas are organized and utilized.
  • chore: updated actions fetch logic for consolidated view api #36096: The updates in the main PR to the generator functions in DatasourcesSagas.ts could be related to the changes in the NewActionServiceCE class, which also involves significant modifications to method signatures and logic that may interact with the data sources being managed by the sagas.
  • fix: remove redundant eval trigger #36764: The removal of the watchDatasourcesSagas function in the main PR aligns with the changes in the PageVisibilitySagas, which also involves the removal of websocket-related functionalities, indicating a broader restructuring of how sagas are managed in relation to data sources.
  • fix: API Body format focus retention #37150: The enhancements to the DatasourcesSagas.ts file in the main PR may relate to the changes in the ApiPaneSagas.ts, which also involve updates to how API parameters and body content types are managed, indicating a connection in the handling of data sources and API interactions.

Suggested Labels

Integrations Product, Task, Datasources

Suggested Reviewers

  • sagar-qa007
  • AmanAgarwal041
  • hetunandu
  • ankitakinger

Poem

🌐 Sagas of data, dancing light,
External plugins take their flight
Exports bloom like springtime flowers
Code evolves through coding powers
Integration's new frontier! 🚀


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Enhancement New feature or request label Jan 2, 2025
@sneha122 sneha122 added the ok-to-test Required label for CI label Jan 2, 2025
@sneha122
Copy link
Contributor Author

sneha122 commented Jan 2, 2025

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Jan 2, 2025

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link

github-actions bot commented Jan 2, 2025

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

Copy link

github-actions bot commented Jan 2, 2025

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

@sneha122 sneha122 marked this pull request as ready for review January 3, 2025 07:30
@sneha122 sneha122 requested review from ayushpahwa and a team as code owners January 3, 2025 07:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (16)
app/client/src/ce/sagas/DatasourcesSagas.ts (16)

2-2: Check imports scope.
Confirm each imported symbol is utilized and prune any unused references.


92-92: Check for potential duplication.
createActionRequestSaga is imported here; if used repeatedly, see if a single entry point might suffice.


93-93: Validate usage of validateResponse.
Consider verifying whether multiple calls stack up, or if there's a single orchestrator method that can unify it.


169-170: Focus retention logic.
The saga references focus/retention utilities. Confirm no race conditions occur when focus or navigation is updated.


217-217: Large try block.
handleFetchDatasourceStructureOnLoad is quite dense. Consider refactoring for clarity and better error separation.


520-520: Connection method logic.
getConnectionMethod might be re-usable elsewhere. Extracting it could simplify the saga if repeated often.


881-881: Refactor large code path.
testDatasourceSaga could benefit from a smaller, dedicated success/failure helper to improve clarity.


887-887: Improve error logging.
Currently it’s a basic error assignment. Consider more verbose messaging or unique error codes.


1431-1431: Possible refactor for “storeAsDatasourceSaga”.
This logic lumps multiple transformations. Slight decomposition could enhance readability.


1547-1547: Unify fetch and refresh.
fetchDatasourceStructureSaga has many parallels with refreshDatasourceStructure. Extract shared code if feasible.


1666-1666: Add & fetch structure after mock creation.
Check that environment details are properly set or defaulted before fetching structure.


1794-1794: Dual usage in executeDatasourceQuerySaga.
Handling generate-page vs. normal queries in one saga can grow complex. Keep an eye on maintainability.


1973-1973: Potential large result sets.
fetchGsheetSpreadhsheets should account for multiple or nested sheets. Ensure performance remains acceptable.


2121-2121: Common logic for columns fetch.
fetchGsheetColumns is similar to previous calls. Factor out common code for simpler maintenance.


2173-2173: Relying on window variable.
loadFilePickerSaga checks window.googleAPIsLoaded. Consider a more robust or safer detection approach.


2197-2197: Consistent success messaging.
updateDatasourceAuthStateSaga toasts success or failure distinctly. Confirm a uniform pattern for user-facing messages.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49f9362 and 988d146.

📒 Files selected for processing (13)
  • app/client/src/ce/sagas/DatasourcesSagas.ts (30 hunks)
  • app/client/src/ce/sagas/index.tsx (1 hunks)
  • app/client/src/ce/selectors/entitiesSelector.ts (1 hunks)
  • app/client/src/constants/AppsmithActionConstants/ActionConstants.tsx (4 hunks)
  • app/client/src/constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig.ts (1 hunks)
  • app/client/src/ee/sagas/DatasourcesSagas.ts (1 hunks)
  • app/client/src/entities/Action/index.ts (2 hunks)
  • app/client/src/entities/Datasource/index.ts (2 hunks)
  • app/client/src/entities/JSCollection/index.ts (1 hunks)
  • app/client/src/pages/Editor/EntityNavigation/ActionPane/index.ts (1 hunks)
  • app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx (1 hunks)
  • app/client/src/sagas/WidgetBlueprintSagas.ts (1 hunks)
  • app/client/test/sagas.ts (1 hunks)
🔇 Additional comments (42)
app/client/src/ee/sagas/DatasourcesSagas.ts (4)

1-6: Use consistent import references

The import for createOrUpdateDataSourceWithAction references "ce/sagas/DatasourcesSagas" while most watchers are in the ee folder. Ensure this is intentional, or consider consolidating imports for consistent readability.


7-40: Confirm the ReduxActionConstants import

You appear to be using the ee/constants/ReduxActionConstants for action types. Verify that it matches the structure in ce/constants/ReduxActionConstants if there's any overlap. Duplicated or mismatched enums can cause confusion.


42-100: Appropriate use of takeEvery and takeLatest

Each saga uses the correct effect pattern (takeEvery vs. takeLatest) for its intended behavior. This is a good practice to handle concurrency in side effects.


100-140: Overall concurrency approach

All watchers run concurrently using yield all([...]). This is standard and should manage side effects well. No issues spotted.

app/client/src/constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig.ts (1)

7-7: Consistent naming across plugin types

EXTERNAL_SAAS is introduced with ["CANCEL", "SAVE_AND_AUTHORIZE"]. Ensure other configurations in the code adhere to the same naming.

app/client/src/pages/Editor/EntityNavigation/ActionPane/index.ts (1)

23-23: Extended switch case for EXTERNAL_SAAS

Good approach. The new EXTERNAL_SAAS case extends existing logic without duplication.

app/client/src/entities/JSCollection/index.ts (1)

1-1: Updated import path

The path for BaseAction now references "../../entities/Action". If there are no unintended import cycles, this looks fine.

app/client/test/sagas.ts (1)

6-6: Referring to ee/sagas/DatasourcesSagas

Switching to ee/sagas/DatasourcesSagas aligns with the new file location. Confirm no leftover references to the old path.

app/client/src/ce/sagas/index.tsx (1)

19-19: Migrating to Enterprise sagas
The change from "sagas/DatasourcesSagas" to "ee/sagas/DatasourcesSagas" looks valid. Confirm that related references are updated accordingly.

app/client/src/entities/Datasource/index.ts (3)

143-143: Union Type for authentication
Allowing ExternalSaasDSAuthentication alongside the existing type seems correct, but ensure that downstream references properly handle this union.


209-214: New ExternalSaasDSAuthentication interface
This interface extends the base authentication model. Confirm that integrationId, credentialId, and integrationType are used consistently throughout the system.


216-218: Additional AuthenticationType enum
Adding EXTERNAL_SAAS_AUTHENTICATION maintains clarity. Ensure it aligns with existing references to avoid confusion.

app/client/src/constants/AppsmithActionConstants/ActionConstants.tsx (4)

180-180: EXTERNAL_SAAS in defaultActionSettings
The addition mirrors other plugin types. Looks consistent with overall usage patterns.


193-193: Empty editor config for EXTERNAL_SAAS
Having no default editor config is acceptable if you plan to provide one later. Keep an eye out for usage that expects a non-empty array.


207-207: No dependencies config
Declaring an empty dependencies object is perfectly fine if no additional dependencies are required.


218-218: Datasource form button config
Including EXTERNAL_SAAS here keeps the plugin coverage consistent. Good move.

app/client/src/entities/Action/index.ts (3)

18-18: New plugin type for EXTERNAL_SAAS
Introducing EXTERNAL_SAAS expands the range of plugin integrations.


264-270: ExternalSaasAction interface
Extending BaseAction with PluginType.EXTERNAL_SAAS and a datasource ensures clarity for external SaaS flows.


278-279: Union support for the new ExternalSaasAction
This addition enables typed usage throughout the codebase for EXTERNAL_SAAS actions.

app/client/src/sagas/WidgetBlueprintSagas.ts (1)

21-21: Confirm correct import path.
Ensure the new relative path to the DatasourcesSagas file is accurate and that createOrUpdateDataSourceWithAction is indeed exported there.

app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx (1)

253-255: Extended plugin type match is appropriate.
Adding PluginType.EXTERNAL_SAAS to the filter ensures compatibility with additional external sources. Confirm there's adequate test coverage for the new plugin type.

app/client/src/ce/selectors/entitiesSelector.ts (1)

122-123: Inclusion of EXTERNAL_SAAS is consistent.
This maintains uniformity in how SaaS-like plugin types are categorized. Make sure it aligns with the rest of the UI logic.

app/client/src/ce/sagas/DatasourcesSagas.ts (20)

Line range hint 21-21: Validate module sub-import usage.
Ensure referencing ee/selectors/entitiesSelector meets the new folder structure.


90-90: Confirm side-effect usage.
Invoking setIdeEditorViewMode can affect global view state; verify correctness in related flows.


176-177: Check fallback request approach.
getFromServerWhenNoPrefetchedResult could obscure failure details; consider logging or tracking fallback usage.


181-181: Import usage check.
openGeneratePageModalWithSelectedDS is invoked subsequently. Confirm it’s tested in relevant user flows.


183-183: Ensure robust error handling.
fetchDatasourcesSaga should maintain consistent fallback logic if an API call fails.


250-250: Check partial/invalid mockDatasources.
Ensure unexpected data from the server is handled gracefully.


696-696: Redirect logic for various plugin types.
redirectAuthorizationCodeSaga checks pluginType. Confirm fallback scenarios for unknown types.


749-749: Local storage reliance.
In getOAuthAccessTokenSaga, handle missing or tampered tokens gracefully, ensuring robust user feedback.


846-846: Non-blocking name update.
updateDatasourceNameSaga is straightforward. Confirm concurrency is managed if multiple updates occur rapidly.


1045-1045: Check plugin form config availability.
createTempDatasourceFromFormSaga merges with config. Confirm plugin form retrieval is always completed beforehand.


1161-1165: Validate environment integrity.
When merging initial values and environment data in createDatasourceFromFormSaga, ensure environment keys are correct and that partial merges don’t break defaults.


1319-1319: Skip redirect logic.
The condition shouldNotRedirect can be impactful. Confirm we have coverage in tests for cases that skip redirect.


1378-1378: Logic for switchDatasourceSaga.
We simply dispatch a changeDatasource. This looks lean. Confirm it's tested for partial data scenarios.


1392-1392: Replay entity consistency.
For partial form changes in formValueChangeSaga, ensure the replay state remains in sync with the rest of the store.


1505-1507: Update success logic.
updateDatasourceSuccessSaga transitions the editor state on success. The flow is correct as is.


1848-1848: Check defaultKeyValue logic.
initializeFormWithDefaults sets default map arrays. Confirm it aligns with all plugin usage when form loads.


1886-1886: Validate klonaLite usage.
filePickerActionCallbackSaga clones and modifies datasource state. Check if certain fields need sanitization or deeper checks.


2073-2073: Error detail enrichment.
fetchGsheetSheets could provide more context if the request fails, especially for large data sets.


2248-2248: Clear usage of analytics.
datasourceDiscardActionSaga logs correct event. No further concerns here.


2268-2268: Banner reset approach.
setDatasourceViewModeSaga resets banner for the datasource. Straightforward solution.

@@ -1697,7 +1693,7 @@ function* addAndFetchDatasourceStructureSaga(
}
}

function* refreshDatasourceStructure(
export function* refreshDatasourceStructure(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid duplication in refreshDatasourceStructure.
Many lines duplicate fetchDatasourceStructureSaga. Merge if possible for easier maintenance.

Copy link

github-actions bot commented Jan 3, 2025

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

AmanAgarwal041
AmanAgarwal041 previously approved these changes Jan 3, 2025
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

github-actions bot commented Jan 6, 2025

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
app/client/src/ce/sagas/DatasourcesSagas.ts (4)

217-217: Potential enhancement on parallelizing structure fetch.
You're using a for-loop to dispatch multiple fetchDatasourceStructure. Consider bundling them with yield all(...) for concurrent performance, if safe.


520-520: Function is quite large.
Consider modularizing logic (e.g., environment updates, plugin checks, analytics) for readability and simpler testing.


888-888: Test datasource saga logic.
Function is somewhat lengthy. Consider extracting repeated patterns into helper functions to keep it DRY.


2198-2198: Auth update saga.
Nice to see a success/error toast. Validate concurrency if multiple updates may overlap.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 988d146 and 9c1e06b.

📒 Files selected for processing (3)
  • app/client/src/ce/sagas/DatasourcesSagas.ts (30 hunks)
  • app/client/src/ce/sagas/index.tsx (1 hunks)
  • app/client/src/ce/selectors/entitiesSelector.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/client/src/ce/selectors/entitiesSelector.ts
  • app/client/src/ce/sagas/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (29)
app/client/src/ce/sagas/DatasourcesSagas.ts (29)

2-2: No issues with the new import statement.
Looks straightforward and aligns with typical Saga usage.


90-90: Import is valid and put to good use.
No concerns.


92-92: Import introduced for action creation.
Seems properly referenced in subsequent code.


169-170: New imports from FocusRetentionSaga and FocusEntity look fine.
No issues with maintainability.


176-176: Helper import is used appropriately.
Integration with saga logic is consistent.


181-181: Utilities import for generating pages is valid.
No immediate suggestions.


183-183: Good use of generator function for fetching datasources.
Error handling and success dispatch appear solid.


250-250: Mock datasources fetching logic looks fine.
Handles both cached and uncached scenario.


847-847: Update datasource name saga is straightforward.
No concerns; error handling is in place.


882-882: Failure saga correctly reverts the name to the old value.
Simple and reliable.


1046-1046: Creation of a temporary datasource.
Implementation flow is sound. Potentially add unit tests to cover edge cases.


1162-1166: Datasource creation saga.
Logic is robust. Keep an eye on environment-level concurrency if multiple calls happen in parallel.


1320-1320: Good approach for changing datasource references.
Nicely uses redux-form initialization. No issues.


1379-1379: Switch between datasources with minimal overhead.
No concerns.


1393-1393: Form value change saga is well-structured.
Limits side effects to recognized forms. Implementation is tidy.


1432-1432: Segregating REST API and datasource headers is logical.
Implementation is consistent.


1506-1508: updateDatasourceSuccessSaga.
Handles success scenario and triggers relevant actions. No immediate issues.


1548-1548: fetchDatasourceStructureSaga.
Error handling and analytics usage are appropriate. Code is good to go.


1667-1667: Mock datasource + fetch structure.
Logic is linear and straightforward. No concerns.


1697-1697: Duplication in refreshDatasourceStructure.
This repeats logic from fetchDatasourceStructureSaga. Merging could enhance maintainability.


1795-1795: Datasource query execution.
Clear flow, robust error handling. Looks solid.


1849-1849: Initializing form with defaults.
Valid approach for form controls.


1887-1887: Sensitive data checks.
Resets token upon file selection or cancellation. Good practice to minimize stale data.


1974-1974: Fetching GSheet spreadsheets logic.
No major issues, consistent usage of Saga pattern.


2074-2074: Fetching GSheet sheets.
Implementation mirrors the standard approach. No concerns evident.


2122-2122: Fetching GSheet columns step.
Implementation in line with the other GSheet sagas.


2174-2174: Load file picker and handle overlay toggling.
No red flags, environment checks are sound.


2249-2249: Discarding datasource changes.
Analytics event is a helpful addition. Implementation is simple.


2269-2269: Setting datasource view mode.
Correct approach for toggling modes.

@@ -703,7 +693,7 @@ function* updateDatasourceSaga(
}
}

function* redirectAuthorizationCodeSaga(
export function* redirectAuthorizationCodeSaga(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security caution with storing tokens in localStorage.
Consider using session storage or a secure HTTP-only cookie to reduce XSS risks.

@@ -757,7 +747,7 @@
}
}

function* getOAuthAccessTokenSaga(
export function* getOAuthAccessTokenSaga(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Token retrieval logic might be vulnerable to localStorage-based attacks.
Review the security model to ensure it meets your threat requirements.

@sneha122
Copy link
Contributor Author

sneha122 commented Jan 6, 2025

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Jan 6, 2025

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

Copy link

github-actions bot commented Jan 6, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants