Skip to content

Migrate waterfall allowed_vfolder_hosts merge to myStorageHostPermissions (Strawberry V2) #8084

Description

@agatha197

Summary

Migrate the existing client-side allowed_vfolder_hosts merge ("which storage hosts can the current user mount") from the legacy request-waterfall pattern onto the myStorageHostPermissions GraphQL field (Strawberry V2, added in 26.4.2).

Background

The legacy pattern resolves the keypair's resource-policy name first, then issues a second query for domain / group / keypair_resource_policy allowed_vfolder_hosts, then merges three JSON blobs client-side and filters by mount-in-session. This is a request waterfall plus duplicated merge logic.

myStorageHostPermissions returns the union of domain + the user's projects + keypair permissions in a single server-side query, already intersected with registered volumes. FR-1436 introduced the useMountableVFolderHosts hook on top of it for the deployment model-folder selector; this issue generalizes that adoption.

Candidate consumers (Pattern A — "current user's mountable hosts")

  • react/src/components/VFolderTable.tsx (session mount picker; inline VFolderTableProjectQuery + _.merge + mount-in-session)
  • react/src/hooks/useMergedAllowedStorageHostPermission.ts and its consumers:
    • FileBrowserButton.tsx, FileBrowserButtonV2.tsx
    • FolderExplorerModal.tsx, FolderExplorerModalV2.tsx
    • SFTPServerButton.tsx, SFTPServerButtonV2.tsx

Explicitly OUT of scope (Pattern B — admin entity config)

Code that reads/writes a specific entity's allowed_vfolder_hosts (admin settings) must NOT be migrated — it is not "the current user's union": BAIProjectSettingModal, BAIProjectTable, KeypairResourcePolicy*, DomainStoragePermissionTable, ProjectStoragePermissionTable, helper/storageHostPermission.ts, BAIAllowedVfolderHostsWithPermission.

Key open decision — version floor

myStorageHostPermissions requires manager >= 26.4.2. Unlike the deployment modal (already gated >= 26.4.3), the Pattern A flows above (session mount, file browser, SFTP) currently support older managers and are NOT version-gated. Migrating them requires either:

  • (a) keeping a fallback to the legacy merge for managers < 26.4.2 (keeps both code paths), or
  • (b) declaring 26.4.2 the minimum supported manager and deleting the legacy path.

Decide the support matrix before implementing.

Acceptance criteria

  • Pattern A consumers compute mountable hosts via myStorageHostPermissions (directly or by reimplementing useMergedAllowedStorageHostPermission internals while preserving its return shape).
  • No behavioral regression for the chosen support floor.
  • scripts/verify.sh passes.

Notes

JIRA Issue: FR-3229

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions