feat(FR-2577): add project admin deployments page#6698
feat(FR-2577): add project admin deployments page#6698graphite-app[bot] merged 1 commit intomainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 81.87% | 429/524 |
| 🟡 | Branches | 70.43% | 362/514 |
| 🟡 | Functions | 76.86% | 93/121 |
| 🟢 | Lines | 83.19% | 391/470 |
Test suite run success
319 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from 786086e
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.65% (+0% 🔼) |
1859/21499 |
| 🔴 | Branches | 7.84% | 1187/15145 |
| 🔴 | Functions | 5.11% (+0.02% 🔼) |
297/5807 |
| 🔴 | Lines | 8.39% (+0% 🔼) |
1750/20867 |
Test suite run success
865 tests passing in 40 suites.
Report generated by 🧪jest coverage report action from 786086e
There was a problem hiding this comment.
Pull request overview
Adds a new “Project Admin Deployments” admin page to list and manage model deployments scoped to the current project, wiring it into routing, navigation, and shared UI fragments.
Changes:
- Adds
ProjectAdminDeploymentsPageand registers it in the main route table. - Adds a new project-admin menu entry (
project-admin-deployments) and navigation link. - Introduces
BAIModelDeploymentNodesfragment/table component (with delete action) and new i18n keys for the page and component.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/i18n/en.json | Adds webui.menu.ProjectDeployments label for the new page/menu item (English only). |
| react/src/routes.tsx | Registers /project-admin-deployments route and lazy-loads the new page. |
| react/src/pages/ProjectAdminDeploymentsPage.tsx | Implements the project-scoped deployments list page with filtering/sorting/pagination. |
| react/src/hooks/useWebUIMenuItems.tsx | Adds the new project-admin menu key and menu item link. |
| packages/backend.ai-ui/src/locale/en.json | Adds comp:BAIModelDeploymentNodes.* English strings used by the new fragment component. |
| packages/backend.ai-ui/src/components/fragments/index.ts | Re-exports BAIModelDeploymentNodes and sorter values from the fragments barrel. |
| packages/backend.ai-ui/src/components/fragments/BAIModelDeploymentNodes.tsx | New shared fragment/table for deployments with delete mutation and table columns. |
3052608 to
ba9ecb6
Compare
ba9ecb6 to
f78ddc5
Compare
966cf10 to
a64b7b0
Compare
f2d8203 to
542ec67
Compare
542ec67 to
4272a61
Compare
Merge activity
|
resolves #6697 (FR-2577) ## Summary Adds a dedicated **Project Admin → Deployments** page so project admins can list and delete model deployments scoped to their current project. - New page `react/src/pages/ProjectAdminDeploymentsPage.tsx` mirroring `ProjectAdminUsersPage` (status radio, URL-driven filter/sort, fetch-key refresh). - New reusable fragment component `packages/backend.ai-ui/src/components/fragments/BAIModelDeploymentNodes.tsx` with `BAITable`, column hide/show, and delete wired through `BAINameActionCell`. - Menu entry under **Admin Settings → Operations → Deployments** for project admins (`react/src/hooks/useWebUIMenuItems.tsx`) plus a new `/project-admin-deployments` route (`react/src/routes.tsx`). - English i18n keys added in `resources/i18n/en.json` and `packages/backend.ai-ui/src/locale/en.json`. Other locales will be handled by the i18n pass. - Uses the v2 `projectDeployments` query and the shared `deleteModelDeployment` mutation. No legacy `endpoint_*` APIs; no update/scale mutations. ## Review fixes applied (from code-reviewer + lead-frontend-reviewer + pr-reviewer) - **HIGH**: Restored column sorting — dropped nested-array `dataIndex` on `name`, `createdAt`, `updatedAt` so Antd falls back to `column.key` and the emitted order strings match `availableDeploymentSorterValues`. - **HIGH**: Added `updater: (store) => store.delete(record.id)` to the delete mutation so deleted nodes are evicted from the Relay store immediately. - **MEDIUM**: Removed the stale `okButtonProps.loading: isInflightDelete` capture in `modal.confirm`; Antd now manages the OK button loading via the `onOk` promise. - **MEDIUM**: Added an allow-list parser for the URL `filter` query param (`name`, `tags`, `endpointUrl` only) so users can no longer smuggle `status` or `AND/OR/NOT` via the URL. - Nits: removed unused `createdUserId` scalar; replaced `|| null` cast with explicit nullish check. ## Test plan - [x] `bash scripts/verify.sh` ends with `=== ALL PASS ===` - [x] Logged in as `project-admin-for-default@lablup.com` on the FR-2209 test server; menu item "Deployments" appears under Admin Settings → Operations - [x] `/project-admin-deployments` route renders the table, status radio, property filter, and column settings toggle - [ ] With non-empty data, verify sort by name/createdAt/updatedAt produces correct `orderBy` in network requests - [ ] With non-empty data, verify delete mutation removes the row and decrements the count - [ ] Non-project-admin users do not see the menu entry (backend auth still enforces scope if URL is accessed directly) ## Known follow-ups - Filter property labels in `BAIGraphQLPropertyFilter` use `comp:BAIModelDeploymentNodes.*` keys; in the current app the `comp` namespace is not registered at the main i18n instance and the key is shown verbatim. Consider moving the labels to a registered namespace or adding the `comp` namespace to the main app. - `defaultHidden` columns appear to render in the screenshot despite the flag — investigate whether the page needs a `tableId` / explicit `columnOverrides` to persist the intended default visibility. - Replicas column currently shows only `desiredReplicaCount`; `currentReplicaCount` requires an N+1 subquery and was intentionally deferred. ## Screenshots ### Project Admin Deployments (empty state, default columns) Signed in as `project-admin-for-default@lablup.com`; the new "Deployments" entry appears under **Admin Settings → Operations**, next to Users.  ### Context after login (sider menu) 
4272a61 to
786086e
Compare

resolves #6697 (FR-2577)
Summary
Adds a dedicated Project Admin → Deployments page so project admins can list and delete model deployments scoped to their current project.
react/src/pages/ProjectAdminDeploymentsPage.tsxmirroringProjectAdminUsersPage(status radio, URL-driven filter/sort, fetch-key refresh).packages/backend.ai-ui/src/components/fragments/BAIModelDeploymentNodes.tsxwithBAITable, column hide/show, and delete wired throughBAINameActionCell.react/src/hooks/useWebUIMenuItems.tsx) plus a new/project-admin-deploymentsroute (react/src/routes.tsx).resources/i18n/en.jsonandpackages/backend.ai-ui/src/locale/en.json. Other locales will be handled by the i18n pass.projectDeploymentsquery and the shareddeleteModelDeploymentmutation. No legacyendpoint_*APIs; no update/scale mutations.Review fixes applied (from code-reviewer + lead-frontend-reviewer + pr-reviewer)
dataIndexonname,createdAt,updatedAtso Antd falls back tocolumn.keyand the emitted order strings matchavailableDeploymentSorterValues.updater: (store) => store.delete(record.id)to the delete mutation so deleted nodes are evicted from the Relay store immediately.okButtonProps.loading: isInflightDeletecapture inmodal.confirm; Antd now manages the OK button loading via theonOkpromise.filterquery param (name,tags,endpointUrlonly) so users can no longer smugglestatusorAND/OR/NOTvia the URL.createdUserIdscalar; replaced|| nullcast with explicit nullish check.Test plan
bash scripts/verify.shends with=== ALL PASS ===project-admin-for-default@lablup.comon the FR-2209 test server; menu item "Deployments" appears under Admin Settings → Operations/project-admin-deploymentsroute renders the table, status radio, property filter, and column settings toggleorderByin network requestsKnown follow-ups
BAIGraphQLPropertyFilterusecomp:BAIModelDeploymentNodes.*keys; in the current app thecompnamespace is not registered at the main i18n instance and the key is shown verbatim. Consider moving the labels to a registered namespace or adding thecompnamespace to the main app.defaultHiddencolumns appear to render in the screenshot despite the flag — investigate whether the page needs atableId/ explicitcolumnOverridesto persist the intended default visibility.desiredReplicaCount;currentReplicaCountrequires an N+1 subquery and was intentionally deferred.Screenshots
Project Admin Deployments (empty state, default columns)
Signed in as
project-admin-for-default@lablup.com; the new "Deployments" entry appears under Admin Settings → Operations, next to Users.Context after login (sider menu)