Skip to content

ability store (and version) flows in github repo #4767

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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

vinodkiran
Copy link
Contributor

@vinodkiran vinodkiran commented Jul 1, 2025

This PR introduces Git configuration and flow versioning functionalities into both the UI and server. Key changes include the addition of Git config views and dialogs, integration of new API endpoints and service functions for Git operations and version publishing, and corresponding migrations and database entity updates to support these features.

work-in-progress.

@vinodkiran vinodkiran requested a review from Copilot July 1, 2025 11:37
Copilot

This comment was marked as outdated.

HenryHengZJ and others added 9 commits July 9, 2025 14:04
…readonly state

- Updated API calls in the UI to include commit ID when fetching chatflows.
…chatflows from Git based on commit ID. This allows for fetching the latest version of a chatflow if it is dirty or if a specific commit ID is provided.
… ID.

- Enhanced FlowVersionService to handle draft creation logic, ensuring the last published commit is preserved.
- Updated UI components to integrate the makeDraft feature, including API calls and user notifications for draft creation status.
- Introduced a section for unpublished changes in the VersionSideDrawer, showing the current draft if available.
…d addtional functionality for delete the file from git once the chatflow is deleted.
- Added 'external' property to commit information to indicate if a commit is external to Flowise.
- Updated FlowVersionService to handle branch names in git operations, improving commit and retrieval processes.
@vinodkiran vinodkiran requested a review from Copilot July 12, 2025 07:06
Copilot

This comment was marked as outdated.

@vinodkiran vinodkiran requested a review from Copilot July 12, 2025 07:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Git configuration management and flow versioning features across the UI and server.

  • Introduce Git Config UI views and dialogs (list, add/edit, test, activate/delete)
  • Implement new API endpoints and service logic for publishing flows to Git, fetching version history, and creating drafts
  • Extend database schema, entities, and reducers to store Git config and flow version metadata

Reviewed Changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/ui/src/views/gitconfig/index.jsx New Git Config list view with add/edit/delete/activate actions
packages/ui/src/views/canvas/index.jsx Added commitId parsing, readonly flags, and flowVersion API calls
packages/ui/src/store/reducers/canvasReducer.js Added isReadonly state, SET_READONLY action, and fixed SET_DIRTY logic
packages/server/src/services/chatflows/index.ts Added pre-delete Git cleanup logic but uses incorrect config key
packages/server/src/enterprise/services/flow-version.service.ts Core implementation of flow publish, history, fetch-by-commit, and draft
Comments suppressed due to low confidence (1)

packages/ui/src/views/gitconfig/index.jsx:170

  • [nitpick] The permissionId is set to 'datasets:create', which doesn't align with Git Config functionality. Consider updating it to something like 'gitconfig:create' per the TODO.
                                permissionId={'datasets:create'}

@@ -14,10 +15,12 @@ export const initialState = {
const canvasReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.SET_DIRTY:
Copy link
Preview

Copilot AI Jul 12, 2025

Choose a reason for hiding this comment

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

The SET_DIRTY case falls through to REMOVE_DIRTY when action.isReadonly is true, which unintentionally clears the dirty flag. Add an explicit return (or a break) for the read-only case to prevent fallthrough.

Copilot uses AI. Check for mistakes.

getSpecificChatflowApi.request(chatflowId)
// commitId is the query param not a path param
// http://localhost:8080/canvas/84620a63-cb4b-4a82-884b-21d72b3ea72f?commitId=f6f9c7cbf5ed00d6e48e5ed275c85bb8554661d5
const commitId = getUrlParameter('commitId')
Copy link
Preview

Copilot AI Jul 12, 2025

Choose a reason for hiding this comment

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

[nitpick] This inner declaration of commitId shadows the outer variable. Remove the inner const and use the top-level commitId to simplify the logic.

Suggested change
const commitId = getUrlParameter('commitId')
commitId = getUrlParameter('commitId')

Copilot uses AI. Check for mistakes.

Comment on lines 427 to 430
{<MenuItem onClick={handleShowCommit}>
<IconEye size={18} style={{ marginRight: 8 }} />
Show Commit
</MenuItem>}
Copy link
Preview

Copilot AI Jul 12, 2025

Choose a reason for hiding this comment

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

[nitpick] The curly braces around <MenuItem> are unnecessary. Render the <MenuItem> directly without wrapping in {}.

Suggested change
{<MenuItem onClick={handleShowCommit}>
<IconEye size={18} style={{ marginRight: 8 }} />
Show Commit
</MenuItem>}
<MenuItem onClick={handleShowCommit}>
<IconEye size={18} style={{ marginRight: 8 }} />
Show Commit
</MenuItem>

Copilot uses AI. Check for mistakes.

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.

2 participants