feat: Expose per-mount subpath/alias/permission on legacy ComputeSession GraphQL node#11967
feat: Expose per-mount subpath/alias/permission on legacy ComputeSession GraphQL node#11967rapsealk wants to merge 4 commits into
Conversation
…ion GraphQL node Add a read-only vfolder_mount_infos field to the legacy Graphene ComputeSession and ComputeSessionNode types, surfacing per-mount subpath, alias (mount destination), and permission from the stored VFolderMount objects. The existing mounts and vfolder_mounts fields are unchanged. Resolves #11964 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the legacy Graphene (v1) GraphQL ComputeSession and ComputeSessionNode types with a new read-only vfolder_mount_infos field so the current WebUI can access per-mount vfolder metadata (subpath, in-container destination/alias, permission, usage_mode) that is already persisted on sessions but not exposed in the legacy schema.
Changes:
- Added a legacy Graphene output type
VFolderMountInfoplus mapping helpers to convert storedVFolderMount/VFolderMountDataentries into GraphQL-friendly objects (including"."→nullnormalization for root subpath). - Populated
vfolder_mount_infosfrom all legacyComputeSessionconstruction paths (ComputeSessionNode.from_row,ComputeSessionNode.from_dataclass,ComputeSession.parse_row) without modifying existingmounts/vfolder_mounts. - Regenerated the published GraphQL schema docs and added unit tests for the mount-info mapping behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/unit/manager/test_vfolder_mount_info.py |
Adds unit tests validating the mount-to-GraphQL mapping and "." → null subpath normalization. |
src/ai/backend/manager/api/gql_legacy/session.py |
Introduces VFolderMountInfo, mapping helpers, and exposes vfolder_mount_infos on legacy session types. |
docs/manager/graphql-reference/supergraph.graphql |
Updates the federated supergraph schema docs to include the new field and type. |
docs/manager/graphql-reference/schema.graphql |
Updates the legacy schema docs to include the new field and type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The graphql-inspector CI rule (gql-inspector-checker.js) requires every newly added GraphQL type to carry a description containing a version in the 'Added in XX.X.X.' format. Graphene emits the class docstring as the type description, so the version string is added to the docstring (and the regenerated schema dumps) to satisfy the TYPE_ADDED check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This PR has had no activity for 14 days and has been marked as stale. It will be closed on 2026-07-09 (in 14 days) if no further activity occurs. Push a commit or leave a comment to keep it open. |
seedspirit
left a comment
There was a problem hiding this comment.
Rather than expanding legacy graphene based schema, let's migrate to v2 schema(based on strawberry)
Summary
The current WebUI still consumes the legacy Graphene GraphQL schema, where a session only exposes
mounts(vfolder names) andvfolder_mounts(vfolder UUIDs) — both of which drop per-mount details such as the mounted subpath, the in-container mount destination (alias), and the granted permission.This PR adds a read-only
vfolder_mount_infosfield to the legacyComputeSessionandComputeSessionNodetypes, surfacing those per-mount details directly from the storedVFolderMountobjects (viarow.vfolders_sorted_by_id) so the UI can render them without waiting for the SessionV2 migration.This is a deliberate, scoped exception to the v2-first rule, justified by the UI still consuming the legacy schema. It is limited to read-only mount fields.
New type
VFolderMountInfoVFolderMount/VFolderMountData)vfolder_idstr(m.vfid.folder_id)namem.namesubpathstr(m.vfsubpath)nullwhen mounting the vfolder root (".")mount_destinationstr(m.kernel_path)permissionm.mount_perm.valueusage_modem.usage_mode.valueThe existing
mountsandvfolder_mountsfields are unchanged for backward compatibility. The new field is populated at every construction site:ComputeSessionNode.from_row,ComputeSessionNode.from_dataclass, andComputeSession.parse_row.Test plan
pants fmt --changed-since=mainpants fix --changed-since=mainpants lint --changed-since=mainpants check --changed-since=mainpants test --changed-since=mainscripts/generate-graphql-schema.sh);schema.graphqlandsupergraph.graphqlupdatedtests/unit/manager/test_vfolder_mount_info.py) covering the per-mount mapping helper, including thesubpath == "."→nullcase and custommount_destination/permissionPart of #11962
Resolves #11964
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--11967.org.readthedocs.build/en/11967/
📚 Documentation preview 📚: https://sorna-ko--11967.org.readthedocs.build/ko/11967/