feat: refine snippet siderbar and support RBAC.#38134
Merged
Merged
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-06-29 05:40:57.466468868 +0000
+++ /tmp/pyrefly_pr.txt 2026-06-29 05:40:45.871479368 +0000
@@ -7393,88 +7393,100 @@
--> tests/unit_tests/services/test_snippet_service.py:258:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.sync_draft_workflow` [bad-argument-type]
--> tests/unit_tests/services/test_snippet_service.py:261:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:284:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:285:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:287:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:304:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:305:17
+ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.update_workflow` [bad-argument-type]
+ --> tests/unit_tests/services/test_snippet_service.py:307:17
ERROR `() -> _SessionContext` is not assignable to attribute `_session_maker` with type `sessionmaker[Session]` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:339:30
+ --> tests/unit_tests/services/test_snippet_service.py:378:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:345:17
+ --> tests/unit_tests/services/test_snippet_service.py:384:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:347:17
+ --> tests/unit_tests/services/test_snippet_service.py:386:17
ERROR `() -> _SessionContext` is not assignable to attribute `_session_maker` with type `sessionmaker[Session]` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:364:30
+ --> tests/unit_tests/services/test_snippet_service.py:403:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:370:21
+ --> tests/unit_tests/services/test_snippet_service.py:409:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:372:21
+ --> tests/unit_tests/services/test_snippet_service.py:411:21
ERROR `() -> _SessionContext` is not assignable to attribute `_session_maker` with type `sessionmaker[Session]` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:393:30
+ --> tests/unit_tests/services/test_snippet_service.py:432:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:403:17
+ --> tests/unit_tests/services/test_snippet_service.py:442:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.restore_published_workflow_to_draft` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:405:17
+ --> tests/unit_tests/services/test_snippet_service.py:444:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_published_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:416:45
+ --> tests/unit_tests/services/test_snippet_service.py:455:45
ERROR `() -> _SessionContext` is not assignable to attribute `_session_maker` with type `sessionmaker[Session]` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:425:30
+ --> tests/unit_tests/services/test_snippet_service.py:464:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_published_workflow_by_id` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:429:21
+ --> tests/unit_tests/services/test_snippet_service.py:468:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:440:21
+ --> tests/unit_tests/services/test_snippet_service.py:479:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:441:21
+ --> tests/unit_tests/services/test_snippet_service.py:480:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:442:21
+ --> tests/unit_tests/services/test_snippet_service.py:481:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:465:17
+ --> tests/unit_tests/services/test_snippet_service.py:504:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:466:17
+ --> tests/unit_tests/services/test_snippet_service.py:505:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.snippet_service.SnippetService.publish_workflow` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:467:17
+ --> tests/unit_tests/services/test_snippet_service.py:506:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.get_all_published_workflows` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:482:17
+ --> tests/unit_tests/services/test_snippet_service.py:521:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_all_published_workflows` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:483:17
+ --> tests/unit_tests/services/test_snippet_service.py:522:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.get_all_published_workflows` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:497:17
+ --> tests/unit_tests/services/test_snippet_service.py:536:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_all_published_workflows` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:498:17
+ --> tests/unit_tests/services/test_snippet_service.py:537:17
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.delete_snippet` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:516:52
+ --> tests/unit_tests/services/test_snippet_service.py:555:52
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.delete_snippet` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:516:69
+ --> tests/unit_tests/services/test_snippet_service.py:555:69
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService._delete_draft_variable_files` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:549:57
+ --> tests/unit_tests/services/test_snippet_service.py:588:57
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService._delete_draft_variable_files` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:549:74
+ --> tests/unit_tests/services/test_snippet_service.py:588:74
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService._delete_archived_workflow_run_files` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:569:64
+ --> tests/unit_tests/services/test_snippet_service.py:608:64
ERROR `SimpleNamespace` is not assignable to attribute `_workflow_run_repo` with type `APIWorkflowRunRepository` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:585:34
+ --> tests/unit_tests/services/test_snippet_service.py:624:34
ERROR `SimpleNamespace` is not assignable to attribute `_node_execution_service_repo` with type `DifyAPIWorkflowNodeExecutionRepository` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:586:44
+ --> tests/unit_tests/services/test_snippet_service.py:625:44
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_snippet_workflow_runs` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:589:54
+ --> tests/unit_tests/services/test_snippet_service.py:628:54
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/unit_tests/services/test_snippet_service.py:590:12
+ --> tests/unit_tests/services/test_snippet_service.py:629:12
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_snippet_workflow_run` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:590:53
+ --> tests/unit_tests/services/test_snippet_service.py:629:53
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_snippet_workflow_run_node_executions` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:591:69
+ --> tests/unit_tests/services/test_snippet_service.py:630:69
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/unit_tests/services/test_snippet_service.py:595:9
+ --> tests/unit_tests/services/test_snippet_service.py:634:9
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_snippet_node_last_run` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:596:21
+ --> tests/unit_tests/services/test_snippet_service.py:635:21
ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `services.snippet_service.SnippetService.get_snippet_node_last_run` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:597:22
+ --> tests/unit_tests/services/test_snippet_service.py:636:22
ERROR `SimpleNamespace` is not assignable to attribute `_node_execution_service_repo` with type `DifyAPIWorkflowNodeExecutionRepository` [bad-assignment]
- --> tests/unit_tests/services/test_snippet_service.py:623:44
+ --> tests/unit_tests/services/test_snippet_service.py:662:44
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.get_snippet_workflow_run_node_executions` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:627:17
+ --> tests/unit_tests/services/test_snippet_service.py:666:17
ERROR Object of class `FunctionType` has no attribute `assert_not_called` [missing-attribute]
- --> tests/unit_tests/services/test_snippet_service.py:632:5
+ --> tests/unit_tests/services/test_snippet_service.py:671:5
ERROR Argument `SimpleNamespace` is not assignable to parameter `session` with type `Session` in function `services.snippet_service.SnippetService.increment_use_count` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:639:48
+ --> tests/unit_tests/services/test_snippet_service.py:678:48
ERROR Argument `SimpleNamespace` is not assignable to parameter `snippet` with type `CustomizedSnippet` in function `services.snippet_service.SnippetService.increment_use_count` [bad-argument-type]
- --> tests/unit_tests/services/test_snippet_service.py:639:65
+ --> tests/unit_tests/services/test_snippet_service.py:678:65
ERROR Missing required key `enable` for TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
--> tests/unit_tests/services/test_summary_index_service.py:98:93
ERROR Key `a` is not defined in TypedDict `SummaryIndexSettingDict` [bad-typed-dict-key]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #38134 +/- ##
==========================================
+ Coverage 85.33% 85.34% +0.01%
==========================================
Files 4964 4967 +3
Lines 258334 258421 +87
Branches 49023 49033 +10
==========================================
+ Hits 220452 220562 +110
+ Misses 33593 33569 -24
- Partials 4289 4290 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JzoNgKVO
previously approved these changes
Jun 29, 2026
JzoNgKVO
approved these changes
Jun 29, 2026
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.
Important
Fixes #<issue number>.Summary
feat: refine snippet siderbar and support RBAC.
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods