Skip to content

refactor(web): migrate console contracts to generated routes#38233

Merged
hyoban merged 9 commits into
mainfrom
codex/migrate-generated-console-contracts
Jul 1, 2026
Merged

refactor(web): migrate console contracts to generated routes#38233
hyoban merged 9 commits into
mainfrom
codex/migrate-generated-console-contracts

Conversation

@hyoban

@hyoban hyoban commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #38232.

This PR migrates the console contract paths that are now covered by generated OpenAPI contracts:

  • removes handwritten console contracts for billing, files, workflowDraft, and workflowComments
  • updates billing and workflow comment callers to use generated route names and path params
  • strengthens backend OpenAPI schemas needed by the generated contracts, including file upload bodies, billing invoices, workflow draft payloads, trigger/RBAC/plugin response shapes, and workflow comment mention user avatars
  • refreshes generated console contract artifacts and OpenAPI markdown

Screenshots

Before After
N/A N/A

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 scoped backend/frontend checks listed below.

Validation

  • uv run --project api ruff check api/controllers/console/app/workflow.py api/controllers/console/app/workflow_comment.py api/controllers/console/app/workflow_draft_variable.py api/controllers/console/billing/billing.py api/controllers/console/explore/recommended_app.py api/controllers/console/files.py api/controllers/console/workspace/members.py api/controllers/console/workspace/plugin.py api/controllers/console/workspace/rbac.py api/controllers/console/workspace/trigger_providers.py api/tests/unit_tests/commands/test_generate_swagger_specs.py
  • uv run --project api pytest api/tests/unit_tests/commands/test_generate_swagger_specs.py -q
  • pnpm --dir packages/contracts type-check
  • pnpm --dir web type-check
  • pnpm --dir web test app/components/workflow/hooks/__tests__/use-workflow-comment.spec.ts app/components/workflow/comment/mention-input.spec.tsx app/components/workflow/comment/thread.spec.tsx app/components/workflow/comment/comment-icon.spec.tsx app/components/workflow/comment/comment-preview.spec.tsx app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx __tests__/billing/pricing-modal-flow.test.tsx __tests__/billing/cloud-plan-payment-flow.test.tsx app/components/billing/pricing/plans/cloud-plan-item/__tests__/index.spec.tsx

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 51.86% 51.86% -0.00%
Strict coverage 51.38% 51.38% -0.00%
Typed symbols 31,527 31,527 0
Untyped symbols 29,535 29,537 +2
Modules 2952 2952 0

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.03106% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.36%. Comparing base (0923eba) to head (43a40c0).

Files with missing lines Patch % Lines
web/service/workflow.ts 0.00% 3 Missing ⚠️
...controllers/console/app/workflow_draft_variable.py 87.50% 2 Missing ⚠️
.../components/workflow/hooks/use-workflow-comment.ts 87.50% 2 Missing ⚠️
api/controllers/console/app/workflow.py 97.82% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #38233    +/-   ##
========================================
  Coverage   85.35%   85.36%            
========================================
  Files        4979     4979            
  Lines      261925   262037   +112     
  Branches    49623    49629     +6     
========================================
+ Hits       223567   223681   +114     
+ Misses      33974    33972     -2     
  Partials     4384     4384            
Flag Coverage Δ
api 85.49% <97.79%> (+0.01%) ⬆️
dify-ui 94.93% <ø> (ø)
web 85.07% <80.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@hyoban

hyoban commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved and pushed. Merge conflicts are fixed in commit 6ba56eb.

@hyoban hyoban marked this pull request as ready for review July 1, 2026 01:57
@hyoban hyoban enabled auto-merge July 1, 2026 01:57
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. refactor labels Jul 1, 2026
Copilot finished work on behalf of hyoban July 1, 2026 01:58
@hyoban hyoban disabled auto-merge July 1, 2026 02:01
lyzno1
lyzno1 previously approved these changes Jul 1, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 1, 2026
@hyoban hyoban enabled auto-merge July 1, 2026 02:52
lyzno1
lyzno1 previously approved these changes Jul 1, 2026
@hyoban hyoban added this pull request to the merge queue Jul 1, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 1, 2026
@lyzno1 lyzno1 added this pull request to the merge queue Jul 1, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 1, 2026
@autofix-ci autofix-ci Bot requested a review from a team July 1, 2026 05:07
@hyoban hyoban enabled auto-merge July 1, 2026 05:41
@hyoban hyoban added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 93981cf Jul 1, 2026
42 checks passed
@hyoban hyoban deleted the codex/migrate-generated-console-contracts branch July 1, 2026 05:56
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 refactor size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Migrate remaining custom console contract loaders

3 participants