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: saving workflow + feat: skeleton, do not reload page on delete, etc #3015

Merged
merged 18 commits into from
Jan 14, 2025

Conversation

Kiryous
Copy link
Contributor

@Kiryous Kiryous commented Jan 13, 2025

Closes #3014

Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
keep ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 1:52pm

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Bug Something isn't working Feature A new feature UI User interface related issues labels Jan 13, 2025
@Kiryous
Copy link
Contributor Author

Kiryous commented Jan 13, 2025

@coderabbitai summary

Copy link

coderabbitai bot commented Jan 13, 2025

📝 Walkthrough

Walkthrough

This pull request introduces comprehensive changes to the workflow management system in the Keep UI. The modifications span multiple components and files, focusing on improving data fetching, state management, and user interface for workflows. Key changes include server-side data retrieval for workflow details, introducing new components like WorkflowBreadcrumbs and WorkflowOverviewSkeleton, and refactoring workflow creation and deletion processes. The changes aim to streamline workflow interactions, enhance type safety, and provide a more robust user experience.

Changes

File Change Summary
workflows/[workflow_id]/layout.tsx Async layout with server-side workflow data fetching
workflows/[workflow_id]/page.tsx Updated to async page with initial workflow data
workflows/builder/utils.tsx Replaced buildAlert with getWorkflowFromDefinition
workflows/builder/builder.tsx Refactored workflow creation and management logic
shared/api/workflows.ts Added new workflow retrieval functions with error handling

Assessment against linked issues

Objective Addressed Explanation
Error handling when creating workflows [#3014]
Improve workflow creation process

Possibly related PRs

Suggested reviewers

  • Matvey-Kuk

Poem

🐰 Workflows dancing, code so bright
Async magic takes its flight
From builder's realm to template's grace
Our rabbit hops with coding embrace! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53a3fa0 and f409d6f.

📒 Files selected for processing (26)
  • keep-ui/app/(keep)/workflows/[workflow_id]/layout.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/page.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/workflow-breadcrumbs.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/workflow-detail-header.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/workflow-detail-page.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/workflow-overview-skeleton.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/[workflow_id]/workflow-overview.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/builder/builder-modal.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/builder/builder-store.tsx (3 hunks)
  • keep-ui/app/(keep)/workflows/builder/builder.tsx (8 hunks)
  • keep-ui/app/(keep)/workflows/builder/legacy-workflow.types.ts (1 hunks)
  • keep-ui/app/(keep)/workflows/builder/page.client.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/builder/utils.tsx (3 hunks)
  • keep-ui/app/(keep)/workflows/mockworkflows.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/noworkflows.tsx (1 hunks)
  • keep-ui/app/(keep)/workflows/preview/[workflowId]/page.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/workflow-menu.tsx (2 hunks)
  • keep-ui/app/(keep)/workflows/workflow-tile.tsx (5 hunks)
  • keep-ui/app/(keep)/workflows/workflows.client.tsx (2 hunks)
  • keep-ui/entities/workflows/index.ts (1 hunks)
  • keep-ui/entities/workflows/model/useWorkflowActions.ts (1 hunks)
  • keep-ui/shared/api/workflows.ts (2 hunks)
  • keep-ui/shared/lib/provider-utils.ts (1 hunks)
  • keep-ui/shared/ui/DropdownMenu/DropdownMenu.tsx (1 hunks)
  • keep-ui/utils/hooks/useWorkflowRun.ts (2 hunks)
  • keep/api/routes/workflows.py (1 hunks)

Finishing Touches

  • 📝 CodeRabbit is generating docstrings... (♻️ Check again to generate again)

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.

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.

coderabbitai bot added a commit that referenced this pull request Jan 13, 2025
Docstrings generation was requested by @Kiryous.

* #3015 (comment)

The following files were modified:

* `keep-ui/entities/workflows/model/useWorkflowActions.ts`
* `keep-ui/shared/api/workflows.ts`
* `keep-ui/shared/lib/provider-utils.ts`
* `keep/api/routes/workflows.py`
Copy link

coderabbitai bot commented Jan 13, 2025

Note

We have generated docstrings for this pull request, at #3016

talboren and others added 2 commits January 14, 2025 07:58
Signed-off-by: Tal <tal@keephq.dev>
# Conflicts:
#	keep-ui/app/(keep)/workflows/workflow-tile.tsx
…o fix/3014-workflow-saving

# Conflicts:
#	keep-ui/app/(keep)/workflows/workflow-tile.tsx
@Kiryous Kiryous changed the title fix: saving workflow + feat: skeleton, do not reload page on delete, etc [dnm]fix: saving workflow + feat: skeleton, do not reload page on delete, etc Jan 14, 2025
@Kiryous Kiryous changed the title [dnm]fix: saving workflow + feat: skeleton, do not reload page on delete, etc fix: saving workflow + feat: skeleton, do not reload page on delete, etc Jan 14, 2025
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.07%. Comparing base (2677f68) to head (27fdb45).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3015      +/-   ##
==========================================
- Coverage   43.44%   43.07%   -0.38%     
==========================================
  Files         165      166       +1     
  Lines       16318    16655     +337     
==========================================
+ Hits         7090     7174      +84     
- Misses       9228     9481     +253     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

lgtm generally, left 1 comment and not sure i understand the getWorkflowWithRedirectSafe. Worth adding a few docstring to these functions and why we need them

Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 14, 2025
@Kiryous Kiryous merged commit 613fc25 into main Jan 14, 2025
12 checks passed
@Kiryous Kiryous deleted the fix/3014-workflow-saving branch January 14, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feature A new feature lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files. UI User interface related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Error Alert when creating new workflow
2 participants