refactor(FR-2529): extract backend.ai-client as standalone workspace package#6614
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Merged
Conversation
Member
Author
Contributor
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.97% (+0.01% 🔼) |
1750/19515 |
| 🔴 | Branches | 8.07% (+0.01% 🔼) |
1100/13626 |
| 🔴 | Functions | 5.42% (+0.01% 🔼) |
288/5317 |
| 🔴 | Lines | 8.66% (+0.01% 🔼) |
1641/18958 |
Test suite run success
854 tests passing in 39 suites.
Report generated by 🧪jest coverage report action from 30fe95d
5 tasks
8137d0a to
30fe95d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Backend.AI API client out of the React app into a standalone workspace package (packages/backend.ai-client) and updates the React app/tooling to consume it via workspace dependency + webpack/TS aliases.
Changes:
- Adds new
backend.ai-clientworkspace package built withtsup(ESM,.d.ts, sourcemaps). - Splits client implementation into
client.ts,client-config.ts,pep440.ts,types.ts, and modular resource wrappers undersrc/resources/. - Updates React app configuration (tsconfig paths, craco alias, Jest mapper, and imports) to use
backend.ai-client.
Reviewed changes
Copilot reviewed 42 out of 46 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| react/tsconfig.json | Adds TS path mapping for backend.ai-client to the workspace source entry. |
| react/src/react-app-env.d.ts | Removes legacy module declaration for backend.ai-client-esm. |
| react/src/global-stores.ts | Switches import from backend.ai-client-esm to backend.ai-client for global client wiring. |
| react/package.json | Adds backend.ai-client as a workspace dependency. |
| react/jest.config.cjs | Updates Jest module mapping to mock backend.ai-client. |
| react/craco.config.cjs | Updates webpack aliasing and TS loader include paths for the new workspace package. |
| react/test/backendAiClient.mock.js | Provides new Jest mock module for backend.ai-client. |
| pnpm-workspace.yaml | Adds packages/backend.ai-client to the workspace. |
| packages/backend.ai-client/package.json | Introduces new package metadata, exports, scripts, and deps for backend.ai-client. |
| packages/backend.ai-client/tsup.config.ts | Defines tsup build configuration (ESM + d.ts + sourcemaps). |
| packages/backend.ai-client/tsconfig.json | Adds TypeScript config for the new package. |
| packages/backend.ai-client/src/index.ts | Exposes top-level exports and a backward-compatible backend namespace. |
| packages/backend.ai-client/src/client.ts | Main client implementation migrated into the package. |
| packages/backend.ai-client/src/client-config.ts | ClientConfig implementation migrated into the package. |
| packages/backend.ai-client/src/types.ts | Defines exported SDK types used by the client/resources. |
| packages/backend.ai-client/src/pep440.ts | PEP440 utilities used for version compatibility logic. |
| packages/backend.ai-client/src/pep440.test.ts | Adds tests for PEP440 helpers (currently not wired to run). |
| packages/backend.ai-client/src/resources/index.ts | Barrel export for resource wrappers. |
| packages/backend.ai-client/src/resources/agent.ts | Agent API wrapper module. |
| packages/backend.ai-client/src/resources/cloud.ts | Cloud API wrapper module. |
| packages/backend.ai-client/src/resources/compute-session.ts | Compute session API wrapper module. |
| packages/backend.ai-client/src/resources/container-image.ts | Container image API wrapper module. |
| packages/backend.ai-client/src/resources/domain.ts | Domain API wrapper module. |
| packages/backend.ai-client/src/resources/edu-app.ts | EduApp API wrapper module. |
| packages/backend.ai-client/src/resources/enterprise.ts | Enterprise license API wrapper module. |
| packages/backend.ai-client/src/resources/group.ts | Group API wrapper module. |
| packages/backend.ai-client/src/resources/keypair.ts | Keypair API wrapper module. |
| packages/backend.ai-client/src/resources/maintenance.ts | Maintenance API wrapper module. |
| packages/backend.ai-client/src/resources/model-service.ts | Model service wrapper skeleton (TODO methods). |
| packages/backend.ai-client/src/resources/pipeline.ts | Pipeline / PipelineJob / PipelineTaskInstance API wrappers. |
| packages/backend.ai-client/src/resources/registry.ts | Registry config API wrapper module. |
| packages/backend.ai-client/src/resources/resource-policy.ts | Resource policy API wrapper module. |
| packages/backend.ai-client/src/resources/resource-preset.ts | Resource preset API wrapper module. |
| packages/backend.ai-client/src/resources/resources.ts | Cluster resources aggregation helper. |
| packages/backend.ai-client/src/resources/scaling-group.ts | Scaling group API wrapper module. |
| packages/backend.ai-client/src/resources/service.ts | Service API wrapper module. |
| packages/backend.ai-client/src/resources/session-template.ts | Session template API wrapper module. |
| packages/backend.ai-client/src/resources/setting.ts | Settings API wrapper module. |
| packages/backend.ai-client/src/resources/storage-proxy.ts | Storage proxy API wrapper module. |
| packages/backend.ai-client/src/resources/user.ts | User API wrapper module. |
| packages/backend.ai-client/src/resources/user-config.ts | User config (dotfiles/bootstrap script) API wrapper module. |
| packages/backend.ai-client/src/resources/utils.ts | Misc SDK utility helpers. |
| packages/backend.ai-client/src/resources/vfolder.ts | VFolder API wrapper module. |
| AGENTS.md | Updates developer docs to reflect the new client package location/build. |
30fe95d to
a409bd8
Compare
Contributor
Coverage Report for root-coverage
File CoverageNo changed files found. |
Contributor
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
2 tasks
This was referenced Apr 30, 2026
This was referenced Apr 30, 2026
Merged
This was referenced Apr 30, 2026
a409bd8 to
ead7e3e
Compare
c72fccf to
90f2d85
Compare
d337c21 to
3819eea
Compare
Merge activity
|
…package (#6614) Resolves #6612(FR-2529) ## Summary - Extract `src/lib/backend.ai-client-esm.ts` (6,015 lines) into `packages/backend.ai-client/` as a standalone workspace package - Split monolithic file into 28 modular resource class files under `src/resources/` - Build with **tsup**: ESM output, `.d.ts` auto-generation, sourcemaps - Update all consumers: craco alias, global-stores import, jest mock, react-app-env.d.ts - Replace original file with thin re-export shim for backward compatibility - Follow `backend.ai-ui` patterns: naming (`backend.ai-client`), versioning (`26.4.0-alpha.0`), license (`LGPL-3.0-or-later`) ## Verification ``` === Relay: PASS === === Lint: PASS === === Format: PASS === === TypeScript: PASS === === ALL PASS === ``` Package build: `dist/index.js` (174.5KB) + `dist/index.d.ts` (65.4KB) ## Test plan - [x] `bash scripts/verify.sh` → ALL PASS - [x] `pnpm build` in `packages/backend.ai-client/` succeeds - [x] E2E smoke test: login form renders correctly (backend auth tests skipped — server unavailable in CI worktree) - [ ] Manual: verify `pnpm run dev` starts correctly and login works 🤖 Generated with [Claude Code](https://claude.com/claude-code)
3819eea to
7849a9a
Compare
This was referenced Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #6612(FR-2529)
Summary
src/lib/backend.ai-client-esm.ts(6,015 lines) intopackages/backend.ai-client/as a standalone workspace packagesrc/resources/.d.tsauto-generation, sourcemapsbackend.ai-uipatterns: naming (backend.ai-client), versioning (26.4.0-alpha.0), license (LGPL-3.0-or-later)Verification
Package build:
dist/index.js(174.5KB) +dist/index.d.ts(65.4KB)Test plan
bash scripts/verify.sh→ ALL PASSpnpm buildinpackages/backend.ai-client/succeedspnpm run devstarts correctly and login works🤖 Generated with Claude Code