Skip to content

feat: add redux action to generate aiagent schemas#39791

Merged
hetunandu merged 1 commit intoreleasefrom
feat/39781-generate-query-types
Mar 19, 2025
Merged

feat: add redux action to generate aiagent schemas#39791
hetunandu merged 1 commit intoreleasefrom
feat/39781-generate-query-types

Conversation

@znamenskii-ilia
Copy link
Contributor

@znamenskii-ilia znamenskii-ilia commented Mar 18, 2025

Description

Fixes #39781

Automation

/ok-to-test tags="@tag.JS, @tag.Datasource"

🔍 Cypress test results

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13941556348
Commit: 6586907
Cypress dashboard.
Tags: @tag.JS, @tag.Datasource
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts
List of identified flaky tests.
Wed, 19 Mar 2025 09:16:15 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced the AI agent schema generation process with improved status tracking for initiation, cancellation, success, and error scenarios.
    • Introduced refined state management to ensure a more responsive and reliable experience during schema generation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

The changes introduce new Redux handlers and constants to support the AI agent schema generation process. In the reducer, three new action handlers update the state when a schema generation request is initiated, succeeds, or encounters an error. In addition, corresponding action types and error constants are added to the constants file. These updates aim to correctly track the schema generation lifecycle for AI agents within the application.

Changes

File(s) Change Summary
app/client/src/.../pluginEditorReducer.ts Added three new handlers: GENERATE_AI_AGENT_SCHEMA_REQUEST (sets generating state to true), ..._SUCCESS and ..._ERROR (both reset the state to false).
app/client/src/.../ReduxActionConstants.tsx Introduced new action types (REQUEST, CANCELLED, SUCCESS) in ActionExecutionTypes and an error type (GENERATE_AI_AGENT_SCHEMA_ERROR) in ActionExecutionErrorTypes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Reducer
    participant Service

    User->>UI: Initiate AI Agent Schema Generation
    UI->>Reducer: Dispatch GENERATE_AI_AGENT_SCHEMA_REQUEST
    Reducer->>Reducer: Set isSchemaGenerating = true
    Service-->>Reducer: Return Response (Success/Error)
    alt Success
        Reducer->>Reducer: Dispatch GENERATE_AI_AGENT_SCHEMA_SUCCESS (set isSchemaGenerating = false)
    else Error
        Reducer->>Reducer: Dispatch GENERATE_AI_AGENT_SCHEMA_ERROR (set isSchemaGenerating = false)
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Allow generating schema based on description in AI chat pane (#39781)

Possibly related PRs

Suggested labels

Enhancement, ok-to-test, AI Agents

Suggested reviewers

  • KelvinOm
  • AmanAgarwal041

Poem

In the realm of code so grand,
A schema is born at command.
With actions set and state in line,
Our AI agents now shine! ✨
Code whispers magic, truly divine.
Happy coding! 🚀

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 919b290 and 6586907.

📒 Files selected for processing (2)
  • app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (1 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (2)
app/client/src/ce/constants/ReduxActionConstants.tsx (2) (2)
  • ReduxActionTypes (1276:1319)
  • ReduxActionErrorTypes (1321:1348)
app/client/src/PluginActionEditor/index.ts (1) (1)
  • PluginActionEditorState (15:15)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
🔇 Additional comments (3)
app/client/src/ce/constants/ReduxActionConstants.tsx (2)

723-725: The new AI agent schema action types look good.

These action constants properly follow the established pattern for tracking lifecycle of schema generation operations. The naming is consistent with other similar actions in the file.


740-740: Correct error type implementation.

The error type follows the same pattern as other schema generation error types, maintaining consistency in the codebase.

app/client/src/PluginActionEditor/store/pluginEditorReducer.ts (1)

166-183: Well-implemented action handlers for AI agent schema operations.

These new handlers correctly manage the state for AI agent schema generation operations by:

  1. Setting isSchemaGenerating to true when a request starts
  2. Resetting it to false on success or error

The implementation follows the same pattern as the existing plugin action schema handlers with proper payload structure usage.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • 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.
  • @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 AI Agents Issues related to agentic solutions on Appsmith Anvil Pod Issue related to Anvil project Task A simple Todo Enhancement New feature or request labels Mar 18, 2025
@znamenskii-ilia znamenskii-ilia added the ok-to-test Required label for CI label Mar 19, 2025
@hetunandu hetunandu merged commit c82e795 into release Mar 19, 2025
47 of 49 checks passed
@hetunandu hetunandu deleted the feat/39781-generate-query-types branch March 19, 2025 09:20
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
## Description


Fixes appsmithorg#39781

## Automation

/ok-to-test tags="@tag.JS, @tag.Datasource"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13941556348>
> Commit: 6586907
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13941556348&attempt=3&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.JS, @tag.Datasource
> Spec: 
> The following are new failures, please fix them before merging the PR:
<ol>
>
<li>cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Wed, 19 Mar 2025 09:16:15 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

- **New Features**
- Enhanced the AI agent schema generation process with improved status
tracking for initiation, cancellation, success, and error scenarios.
- Introduced refined state management to ensure a more responsive and
reliable experience during schema generation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Agents Issues related to agentic solutions on Appsmith Anvil Pod Issue related to Anvil project Enhancement New feature or request ok-to-test Required label for CI Task A simple Todo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow generating schema based on description in AI chat pane

2 participants