Add workflow#565
Open
awu0403 wants to merge 8 commits into
Open
Conversation
awu0403
force-pushed
the
add-workflow
branch
from
September 19, 2025 06:42
5bee2f5 to
ba20463
Compare
awu0403
force-pushed
the
add-workflow
branch
from
November 12, 2025 01:49
8eb8f0e to
374cc5c
Compare
r350178982
reviewed
Nov 13, 2025
| global_variables: Dict[str, Any] = None | ||
| node_executions: Dict[str, NodeExecution] = None | ||
|
|
||
| # def __post_init__(self): |
Contributor
There was a problem hiding this comment.
这里 两个 post_init 没用的话可以删掉, 同时在这里定义的类中增加一些简要的注释说明
r350178982
reviewed
Nov 13, 2025
| def _execute_trigger_node(self, context, node_data): | ||
| config_id = node_data.get('data', {}).get('config_id') | ||
| #TODO: handle other trigger types | ||
| if config_id == 'file_upload': |
Contributor
There was a problem hiding this comment.
这里触发节点改成 file_added, 不止是文件上传, 还有文件添加
r350178982
reviewed
Nov 13, 2025
| logger.info(f"Triggering workflow {workflow['id']} for file upload in repo {repo_id}") | ||
|
|
||
| trigger_data = { | ||
| 'trigger_type': 'file_upload', |
Contributor
There was a problem hiding this comment.
file_upload--> file_added
r350178982
reviewed
Nov 13, 2025
| self._db_session_class = init_db_session_class() | ||
|
|
||
|
|
||
| def add_file_upload_workflow_task(self, record): |
Contributor
There was a problem hiding this comment.
add_file_added_workflow_task
r350178982
reviewed
Nov 13, 2025
| @@ -0,0 +1,489 @@ | |||
| import os | |||
Contributor
There was a problem hiding this comment.
repo_workflow/utils.py 文件是空的,没用可以删掉
r350178982
reviewed
Nov 13, 2025
| # dependencies = graph.get_node_dependencies(node_id) | ||
| # if not all(dep in completed_nodes for dep in dependencies): | ||
| # execution_queue.append(node_id) | ||
| # continue |
r350178982
reviewed
Nov 13, 2025
| trigger_handler = WorkflowTriggerHandler(db_connection=session) | ||
| trigger_handler.handle_add_file_event(record) | ||
| except Exception as e: | ||
| logger.error(f"Error in file upload workflow event handler: {str(e)}") |
Contributor
There was a problem hiding this comment.
出现错误之后需要 对workflow set_invalid, 否则会不断运行以及出错
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.