Skip to content

UN-2315 [FEAT] Added frontend error handling for GDrive input/output connectors in workflow settings#1464

Merged
vishnuszipstack merged 11 commits into
mainfrom
UN-2315-Gdrive-FE-error
Aug 5, 2025
Merged

UN-2315 [FEAT] Added frontend error handling for GDrive input/output connectors in workflow settings#1464
vishnuszipstack merged 11 commits into
mainfrom
UN-2315-Gdrive-FE-error

Conversation

@kirtimanmishrazipstack

@kirtimanmishrazipstack kirtimanmishrazipstack commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

What

  • After Signin in G-drive connector, still singin option is enabled while navigating among the options
  • When we successfully connected the file system connector the files are displaying but when we click any option and try to see the listed files, the option is disabled
  • When the G-drive connector is connected successfully in Source and the destination G-drive also showing as authenticated which is false.
  • Can’t list files with non-zipstack account

Why

How

  • Fix FE issues for point 1) 2) and 3)
  • For 4) when we try to autherize zipstack account, we need to select the checkbox as shown in screenshot

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • NO

Database Migrations

  • N/A

Env Config

  • N/A

Relevant Docs

Related Issues or PRs

Dependencies Versions

Notes on Testing

  • Tested connectors extensively on workflow settings in call with @gopalsamyperumal
  • Also run the workflow for selected connector

Screenshots

  • 16

Checklist

I have read and understood the Contribution Guidelines.

@coderabbitai

coderabbitai Bot commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Selection of items in the input/output list is now persisted across sessions, ensuring your last selection is restored when you return.
    • OAuth authentication state is now managed and preserved separately for each connector, allowing seamless switching and consistent status across tabs and sessions.
  • Bug Fixes

    • Improved handling of tab disabling in the connector configuration modal to accurately reflect connector state and type.
  • Chores

    • Updated .gitignore to exclude additional files from version control.

Walkthrough

This set of changes implements connector-specific OAuth state management and persistent selection in the frontend. It introduces localStorage keys scoped per connector for OAuth credentials and status, updates the logic for enabling/disabling UI elements based on connector state, and ensures selected items persist across sessions. Backend cache behavior for OAuth credentials is also adjusted.

Changes

Cohort / File(s) Change Summary
Git Ignore Updates
.gitignore
Added CONTRIBUTION_GUIDE.md and .mcp.json to the ignore list under the "Claude" section.
Backend OAuth Cache Behavior
backend/connector_v2/views.py
Changed the cache retrieval for OAuth credentials to retain the cache key after fetching, instead of deleting it.
Configure Connector Modal Tab Logic
frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx
Updated useEffect to explicitly set the disabled property for the File System tab based on connector state, and expanded the effect's dependency array.
OAuth State Isolation and Persistence
frontend/src/components/input-output/configure-ds/ConfigureDs.jsx,
frontend/src/components/oauth-ds/oauth-ds/OAuthDs.jsx,
frontend/src/components/oauth-ds/oauth-status/OAuthStatus.jsx
Refactored OAuth state management to use connector- and role-specific localStorage keys, added logic to persist and restore OAuth state per connector, updated prop signatures, and ensured OAuth status is not cross-contaminated between connectors.
Persistent Item Selection
frontend/src/components/input-output/input-output/InputOutput.jsx
Added logic to persist selected item in localStorage, restore it on reload, and clear it on deletion; centralized item selection logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConfigureDs
    participant OAuthDs
    participant LocalStorage
    participant Backend

    User->>ConfigureDs: Selects connector (SOURCE/DESTINATION)
    ConfigureDs->>LocalStorage: Load OAuth state for connector/role
    ConfigureDs->>OAuthDs: Pass connector-specific props and setters
    User->>OAuthDs: Initiates OAuth flow
    OAuthDs->>Backend: Start OAuth, receive cache key
    OAuthDs->>LocalStorage: Store cache key and status with connector-specific key
    OAuthDs->>ConfigureDs: Update state with cache key/status
    User->>ConfigureDs: Submits form
    ConfigureDs->>LocalStorage: Persist OAuth state for connector/role
Loading
sequenceDiagram
    participant User
    participant InputOutput
    participant LocalStorage

    User->>InputOutput: Opens Input/Output page
    InputOutput->>LocalStorage: Retrieve last selected item
    InputOutput->>User: Display selected item
    User->>InputOutput: Selects new item
    InputOutput->>LocalStorage: Save selected item
    User->>InputOutput: Deletes selected item
    InputOutput->>LocalStorage: Remove selected item entry
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 41af872 and d76f64c.

📒 Files selected for processing (1)
  • frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch UN-2315-Gdrive-FE-error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BE changes LGTM.
@kirtimanmishrazipstack why do we need to store this in cache if the test connection succeeds? I think it should be safe to delete it from the cache in that case - try to perform this just to be safe

Comment thread backend/connector_v2/views.py
@vishnuszipstack

Copy link
Copy Markdown
Contributor

@kirtimanmishrazipstack check the sonar issue and try to resolve that.

@github-actions

github-actions Bot commented Aug 4, 2025

Copy link
Copy Markdown
Contributor
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_for\_sidecar}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_sidecar\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{11}}$$ $$\textcolor{#23d18b}{\tt{11}}$$

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2025

Copy link
Copy Markdown

@vishnuszipstack vishnuszipstack merged commit 5137ef7 into main Aug 5, 2025
7 checks passed
@vishnuszipstack vishnuszipstack deleted the UN-2315-Gdrive-FE-error branch August 5, 2025 04:28
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
…connectors in workflow settings (#1464)

* FE gdrive changes

* FE gdrive changes

* FE gdrive changes

* FE gdrive changes

* adding .gitignore

* small documentation

---------

Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants