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

fix: ds structure issue fixed for zendesk integration #38795

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Jan 22, 2025

Description

This PR fixes the issue where for Saas integrations like zendesk, we do not have a structure to be displayed, in that case we should show appropriate error message.

Fixes #38736
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.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12907027118
Commit: 5a9ef72
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 22 Jan 2025 12:24:10 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Deprecated the previous method for retrieving datasource context.
    • Updated the datasource context retrieval process to include plugin information.

Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

Walkthrough

The pull request modifies the DatasourceContextServiceCEImpl class in the Appsmith server, marking the getDatasourceContext(DatasourceStorage datasourceStorage) method as deprecated. It introduces a new logic in the retryOnce method to retrieve the Plugin before obtaining the datasource context, enhancing the retrieval process by ensuring plugin information is included. This change is particularly relevant for handling non-relational datasources such as Zendesk.

Changes

File Change Summary
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java - Deprecated getDatasourceContext(DatasourceStorage datasourceStorage) method
- Modified retryOnce method to retrieve Plugin before calling getDatasourceContext(datasourceStorage, plugin)

Assessment against linked issues

Objective Addressed Explanation
Show correct error message for Zendesk datasource Modification seems related, but full error handling not clearly demonstrated
Handle non-relational datasource structure Code change suggests improvement, but complete implementation not visible

Possibly related PRs

Suggested labels

Datasources

Suggested reviewers

  • ankitakinger
  • sharat87

Poem

🔍 Datasource detective at work,
Plugins and contexts, no more shirk!
Zendesk whispers its secret tale,
Through refactored code that shall not fail.
A context retrieved, mysteries unfurled 🕵️‍♂️


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa8495c and 5a9ef72.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: server-spotless / spotless-check

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 Bug Something isn't working Deploy Preview Issues found in Deploy Preview Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Query & JS Pod Issues related to the query & JS Pod labels Jan 22, 2025
@sneha122 sneha122 added the ok-to-test Required label for CI label Jan 22, 2025
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: 0

🧹 Nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java (1)

456-460: Consider enhancing error handling for plugin retrieval.

While the changes look good, consider adding explicit error handling for plugin retrieval failures. This would help in distinguishing between plugin-related issues and datasource context issues during retries.

 return pluginService
         .findById(datasourceStorage.getPluginId())
+        .onErrorMap(error -> new AppsmithException(
+            AppsmithError.PLUGIN_NOT_FOUND,
+            datasourceStorage.getPluginId()
+        ))
         .flatMap(plugin -> getDatasourceContext(datasourceStorage, plugin));
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 704e473 and 038ccb6.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: server-spotless / spotless-check
🔇 Additional comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java (1)

456-460: LGTM! The changes improve datasource context retrieval.

The modification to fetch the plugin before getting the datasource context is a good improvement. This ensures proper structure handling for non-relational datasources like Zendesk.

@github-actions github-actions bot added Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets labels Jan 22, 2025
NilanshBansal
NilanshBansal previously approved these changes Jan 22, 2025
Copy link

Failed server tests

  • com.appsmith.server.services.LayoutActionServiceTest#simpleOnPageLoadActionCreationTest

@sneha122 sneha122 merged commit b14669e into release Jan 22, 2025
83 checks passed
@sneha122 sneha122 deleted the fix/zendesk-get-structure-call-failure branch January 22, 2025 14:21
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
)

## Description
This PR fixes the issue where for Saas integrations like zendesk, we do
not have a structure to be displayed, in that case we should show
appropriate error message.


Fixes appsmithorg#38736 
_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.All"

### 🔍 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/12907027118>
> Commit: 5a9ef72
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12907027118&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 22 Jan 2025 12:24:10 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
	- Deprecated the previous method for retrieving datasource context.
- Updated the datasource context retrieval process to include plugin
information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“[email protected]”>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Deploy Preview Issues found in Deploy Preview Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Show correct error message for when datasource structure is not supported for zendesk
2 participants