Skip to content

refactor: simplify deployment access ownership#37994

Merged
hyoban merged 6 commits into
mainfrom
codex/refactor-deployment-access-ownership
Jun 26, 2026
Merged

refactor: simplify deployment access ownership#37994
hyoban merged 6 commits into
mainfrom
codex/refactor-deployment-access-ownership

Conversation

@hyoban

@hyoban hyoban commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Refactor deployment access and developer API tabs so page/tab components only compose layout while sections and action owners read route/query state where consumed.
  • Remove the access-specific store/provider and thin access-control wrapper components by folding dialog state and selection handling into local owners.
  • Move route app instance ownership down to switches, permission rows, API key generation, and API docs rendering to reduce prop drilling.
  • Reorganize web/features/deployments/detail so tab entries live in their owning tab folders and detail-level shared UI lives under detail/components.
  • Rename the access route implementation folder to web/features/deployments/detail/access-tab, then group its files by access channels, developer API, permissions, and shared access-tab components.
  • Update the component writing skill with route/tab naming, tab folder organization, concrete shared component naming, and no-barrel guidance learned from this refactor.
  • Add and update focused tests for access dialog submission, permission rows, channel sections, API key generation, and add-button reset behavior.

No linked issue provided.

Screenshots

Before After
N/A N/A

Validation

  • pnpm -C web exec eslint --fix "app/(commonLayout)/deployments/[appInstanceId]/access/page.tsx" "app/(commonLayout)/deployments/[appInstanceId]/api-tokens/page.tsx" features/deployments/detail/index.tsx features/deployments/detail/access-tab
  • pnpm -C web test features/deployments/detail --run
  • pnpm -C web type-check
  • git diff --check HEAD~1 HEAD

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 does not apply to typos.)
  • I have added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I have 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

From Codex

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

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.61039% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.30%. Comparing base (f4e832f) to head (8896284).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...deployments/detail/access-tab/channels/section.tsx 84.61% 2 Missing ⚠️
...l/access-tab/permissions/access-control-dialog.tsx 93.54% 2 Missing ⚠️
...permissions/access-subject-selector/add-button.tsx 86.66% 2 Missing ⚠️
...ess-tab/permissions/environment-permission-row.tsx 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #37994      +/-   ##
==========================================
+ Coverage   85.28%   85.30%   +0.01%     
==========================================
  Files        4938     4931       -7     
  Lines      256070   256028      -42     
  Branches    48559    48543      -16     
==========================================
+ Hits       218389   218393       +4     
+ Misses      33434    33388      -46     
  Partials     4247     4247              
Flag Coverage Δ
dify-ui 94.94% <ø> (ø)
web 84.81% <89.61%> (+0.03%) ⬆️

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 marked this pull request as ready for review June 26, 2026 04:04
@hyoban hyoban requested review from iamjoel and lyzno1 as code owners June 26, 2026 04:04
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 26, 2026
@hyoban hyoban enabled auto-merge June 26, 2026 04:04
@dosubot dosubot Bot added the refactor label Jun 26, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 26, 2026
@hyoban hyoban added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 16b698b Jun 26, 2026
39 checks passed
@hyoban hyoban deleted the codex/refactor-deployment-access-ownership branch June 26, 2026 04:18
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:XL This PR changes 500-999 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.

2 participants