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: Workflow query conversion #38688

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Jan 16, 2025

Description

Don't show "Convert to module" for a workflow query

Shadow EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5958

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Tip

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


Thu, 16 Jan 2025 10:26:27 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Prevented conversion of workflow queries to modules for internal plugins
    • Updated plugin context retrieval to include plugin information

Copy link
Contributor

coderabbitai bot commented Jan 16, 2025

Walkthrough

The pull request modifies the ConvertToModuleCTA component in the client application. The change involves updating the destructuring of the usePluginActionContext() hook to include the plugin variable. A new conditional check is added to prevent converting workflow queries to modules for internal plugins by returning null when the plugin type is INTERNAL.

Changes

File Change Summary
app/client/src/pages/Editor/AppPluginActionEditor/components/ConvertToModule/ConvertToModuleCTA.tsx - Added plugin to context destructuring
- Implemented type check to return null for internal plugins

Possibly related PRs

Suggested Labels

Bug, ok-to-test, Query & JS Pod

Suggested Reviewers

  • ankitakinger
  • ApekshaBhosale

Poem

🔧 In the realm of code, a change so slight
Plugin context expanded with newfound might
Internal plugins now blocked from conversion's dance
A simple check, a programmatic glance
Refactoring magic, line by line we write! 🚀


📜 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 2b8ba77 and cfb2b2f.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/AppPluginActionEditor/components/ConvertToModule/ConvertToModuleCTA.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (3)
app/client/src/pages/Editor/AppPluginActionEditor/components/ConvertToModule/ConvertToModuleCTA.tsx (3)

13-13: LGTM!

Clean import of the PluginType enum.


16-16: LGTM!

Correctly destructures the plugin from usePluginActionContext.


28-31: LGTM! Clean implementation of the workflow query restriction.

The early return pattern with a clear comment effectively prevents workflow queries from being converted to modules.

Let's verify that this change doesn't affect non-workflow queries:

✅ Verification successful

Verified: The workflow query restriction is correctly implemented and doesn't affect other query types.

The implementation aligns with the codebase's existing patterns and only restricts module conversion for workflow (INTERNAL) queries, while preserving the functionality for other query types (API, DB, SAAS).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other usages of PluginType.INTERNAL to ensure we're not breaking existing functionality
ast-grep --pattern 'plugin.type === PluginType.INTERNAL'

Length of output: 206


Script:

#!/bin/bash
# Search for all references to PluginType.INTERNAL
rg "PluginType\.INTERNAL" -A 2

# Search for module conversion related code
rg "convertToModule|toModule" -A 2

# Look for the PluginType enum definition
ast-grep --pattern 'enum PluginType {
  $$$
}'

Length of output: 7703


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 Bug Something isn't working label Jan 16, 2025
@hetunandu hetunandu added the ok-to-test Required label for CI label Jan 16, 2025
@hetunandu hetunandu merged commit 4e7a2a0 into release Jan 16, 2025
51 checks passed
@hetunandu hetunandu deleted the fix/workflow-query-context-menu branch January 16, 2025 11:36
@coderabbitai coderabbitai bot mentioned this pull request Feb 3, 2025
2 tasks
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants