Skip to content

chore(api): annotate simple contract responses#36331

Draft
hyoban wants to merge 14 commits into
mainfrom
codex/contracts-simple-readiness
Draft

chore(api): annotate simple contract responses#36331
hyoban wants to merge 14 commits into
mainfrom
codex/contracts-simple-readiness

Conversation

@hyoban
Copy link
Copy Markdown
Member

@hyoban hyoban commented May 18, 2026

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

close #36330

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

@github-actions github-actions Bot added the web This relates to changes on the web. label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-18 10:31:53.029870873 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-18 10:31:42.570770704 +0000
@@ -1,9 +1,9 @@
 ERROR `str` is not assignable to `Literal['advanced-chat', 'agent-chat', 'all', 'channel', 'chat', 'completion', 'workflow']` [bad-assignment]
-  --> controllers/console/app/app.py:69:104
+  --> controllers/console/app/app.py:70:104
 ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
-   --> controllers/console/app/app.py:583:13
+   --> controllers/console/app/app.py:585:13
 ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
-  --> controllers/console/auth/email_register.py:83:108
+  --> controllers/console/auth/email_register.py:86:108
 ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
   --> controllers/console/init_validate.py:31:2
 ERROR Object of class `MissingRouter` has no attribute `post` [missing-attribute]
@@ -1830,22 +1830,6 @@
   --> tests/unit_tests/controllers/console/app/test_wraps.py:43:16
 ERROR Cannot set item in `OrderedDict[str, bool | list[str] | str]` [unsupported-operation]
    --> tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py:137:47
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:516:16
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:543:16
-ERROR Object of class `tuple` has no attribute `json` [missing-attribute]
-  --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:74:16
-ERROR Type `Response` is not iterable [not-iterable]
-  --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:92:13
-ERROR Type `Response` is not iterable [not-iterable]
-   --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:117:13
-ERROR Type `Response` is not iterable [not-iterable]
-   --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:142:13
-ERROR Type `Response` is not iterable [not-iterable]
-   --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:165:13
-ERROR Object of class `tuple` has no attribute `json` [missing-attribute]
-   --> tests/unit_tests/controllers/console/auth/test_token_refresh.py:192:16
 ERROR Object of class `BadRequest` has no attribute `data` [missing-attribute]
     --> tests/unit_tests/controllers/console/datasets/test_datasets.py:1655:16
 ERROR Object of class `BytesIO` has no attribute `filename` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 0.00% 44.41% +44.41%
Strict coverage 0.00% 43.93% +43.93%
Typed symbols 0 22,518 +22,518
Untyped symbols 0 28,497 +28,497
Modules 0 2558 +2,558

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.97%. Comparing base (f4c02e4) to head (cd1b85d).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #36331      +/-   ##
==========================================
+ Coverage   85.94%   85.97%   +0.02%     
==========================================
  Files        4454     4455       +1     
  Lines      211503   211858     +355     
  Branches    39515    39521       +6     
==========================================
+ Hits       181782   182143     +361     
+ Misses      26509    26503       -6     
  Partials     3212     3212              
Flag Coverage Δ
api 85.51% <100.00%> (+0.03%) ⬆️
dify-ui 94.59% <ø> (ø)
web 86.56% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Add OpenAPI annotations for simple deterministic API responses

2 participants