Skip to content

refactor(api): extract workspace list into layered application service - #39822

Draft
41tair wants to merge 3 commits into
langgenius:mainfrom
41tair:feat/api-machinary-lab
Draft

refactor(api): extract workspace list into layered application service#39822
41tair wants to merge 3 commits into
langgenius:mainfrom
41tair:feat/api-machinary-lab

Conversation

@41tair

@41tair 41tair commented Jul 30, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@41tair
41tair requested a review from QuantumGhost as a code owner July 30, 2026 13:42
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels Jul 30, 2026
@41tair
41tair marked this pull request as draft July 30, 2026 13:43
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 56.86% 56.88% +0.02%
Strict coverage 56.38% 56.41% +0.03%
Typed symbols 37,167 37,201 +34
Untyped symbols 28,442 28,439 -3
Modules 3092 3100 +8

@WH-2099 WH-2099 self-assigned this Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-31 05:42:48.557399088 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-31 05:42:38.676300375 +0000
@@ -2115,11 +2115,11 @@
 ERROR `SimpleNamespace` is not assignable to attribute `_current_tenant` with type `Tenant | None` [bad-assignment]
    --> tests/unit_tests/controllers/console/test_workspace_members.py:188:43
 ERROR Argument `Literal['app']` is not assignable to parameter `resource_type` with type `RBACResourceScope` in function `controllers.common.wraps._extract_resource_id` [bad-argument-type]
-   --> tests/unit_tests/controllers/console/test_wraps.py:310:41
+   --> tests/unit_tests/controllers/console/test_wraps.py:352:41
 ERROR Argument `Literal['app']` is not assignable to parameter `resource_type` with type `RBACResourceScope` in function `controllers.common.wraps._extract_resource_id` [bad-argument-type]
-   --> tests/unit_tests/controllers/console/test_wraps.py:318:41
+   --> tests/unit_tests/controllers/console/test_wraps.py:360:41
 ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
-  --> tests/unit_tests/controllers/console/workspace/test_workspace.py:45:54
+  --> tests/unit_tests/controllers/console/workspace/test_workspace.py:52:54
 ERROR `SimpleNamespace` is not assignable to attribute `db` with type `SQLAlchemy` [bad-assignment]
   --> tests/unit_tests/controllers/files/test_image_preview.py:18:17
 ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]

Comment thread api/controllers/console/flask_admission.py Outdated
Comment thread api/controllers/console/flask_admission.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants