← Back to Pull requests

feat(volumes): add Filestore Volume API and Box mount dispatch #2732

Closed
unknown closed this pull request without merging on Nov 26, 2026 03:43 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 09:37 UTC
Author

Summary

Expose Filestore as a Volume backend and carry its mount references through Box create, start, and restart. This PR owns the public API and dispatch layer.

Design doc: https://github.com/boxlite-ai/boxlite/issues/2695
Documentation: Volume and Box lifecycle.

Runner NFS mounting and capability reporting from #2722, and instance lookup, placement configuration, and IAM from #2731, are already in main.

POST /v1/volumes
  storageBackend="filestore" [, instance]
  → validate or select a configured instance
  → persist volume.instance
  → return the Volume as READY

create/start/restart Box
  → validate the organization’s Volume references
  → resolve the instance’s current server/export through #2731
  → require runner capabilities to include "filestore" (#2722)
  → dispatch {volumeId, mountPath, filestore:{instance, server, export}}
  → runner performs the NFS mount and Box bind

public Box/Volume responses and errors
  → expose the logical instance only; never server/export

Included:

  • Filestore Volume creation and listing, optional explicit instance selection, deterministic configured placement, and READY persistence.

  • An additive nullable volume.instance migration and Filestore handling in the existing Volume lifecycle.

  • Box create/start/restart metadata and v2 dispatch mapping. Create and start dispatch share the same freshly resolved Filestore target.

  • Runner capability admission before create/start/restart dispatch and v0 rejection.

  • Retryable stopped-Box behavior for temporary lookup failures and capability loss; these failures no longer move existing Boxes to terminal ERROR.

  • A stopped Filestore Box waiting for restart can be deleted without resolving its configured instance. Other pending restarts retain the existing lifecycle guard.

  • A Runner start guard that uses the persisted mount record to reject old-API metadata missing its Filestore reference, before object-storage fallback or native Box start. No rollout flag or GCP lookup is involved.

  • Structured internal diagnostics and safe public errors for lookup, capability, job-insert, and mount-preparation failures.

  • Public-response and error filtering so resolved server/export remain internal dispatch data. Job creation and final reconciliation logs use allowlisted fields rather than raw database errors.

  • OpenAPI and generated Go/TypeScript client updates, with the public instance grammar aligned to server-side validation.
  • Excluded:

  • Runner NFS mounting, mount-record writes, rollback, and reclaim: merged in #2722. This PR only reads the record for the start fallback guard.

  • GCP lookup, placement configuration, and deployment IAM: merged in #2731.

  • Dashboard controls and lifecycle E2E: #2701.
  • Evidence

  • Before: Clients could not create a Filestore Volume or carry its reference to a Box. The runner capability introduced by #2722 had no API consumer, and an old runner could otherwise drop an unknown Filestore reference.

  • After: The API persists the logical instance, resolves a fresh target for each dispatch, rejects runners without the filestore capability, and sends the complete internal mount reference. Public responses and errors expose only logical identifiers.
  • Regression tests prove that v0 or capability-missing runners receive no start dispatch, CREATE uses the refreshed target, temporary lookup/capability failures can recover on a later attempt, database parameters stay out of the final logs, NFS targets stay out of public errors, and the OpenAPI instance grammar matches the DTO.

  • Additional defect tests failed before the fixes and now cover final Pino log sanitization, deletion of a Filestore Box whose instance is unavailable, and fail-closed Start with old-API metadata while preserving object-storage fallback.

  • Current head b984c7abc:

  • - 38 related non-integration API suites / 457 tests passed.
    - Config routing and capability discovery: 37 tests passed.
    - Runner Start regression group passed: old-API Filestore reference rejection, Filestore preparation error propagation, and object-storage fallback preservation.
    - Unreadable-record regression coverage was added; final post-fix local execution was stopped by request and platform validation is delegated to CI.
    - 40 OpenAPI tests passed.
    - make build:apps:api passed, including all 37 production entity metadata checks.
    - TypeScript lint passed with 0 errors; Go formatting passed.
  • No live GCP, NFS, or end-to-end validation is claimed here; those checks remain with deployment validation and #2701.
  • Merge Danger

    Door: Two-way before external adoption. The volume.instance migration is additive and can remain if the code is reverted; the public backend contract still needs compatibility care once clients use it.

    Blast Radius: Filestore Volume lifecycle and Box create/start/restart/delete dispatch, plus the Runner start metadata replay guard.

    Object-storage Volumes retain their existing provisioning and mount fallback. Runner-side mount safety comes from #2722, while this PR prevents dispatch to runners that have not declared support, keeps stopped Boxes retryable when support is temporarily unavailable, and refuses to silently convert a recorded Filestore mount into an object-storage start after API version skew.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: DorianZheng Review duration: 14046m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2732"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%