Skip to content

Use FilePath for ContainerResource.Bundle#26

Open
chrisgeo wants to merge 1 commit into
mainfrom
feat/chaos-1460-bundle-filepath
Open

Use FilePath for ContainerResource.Bundle#26
chrisgeo wants to merge 1 commit into
mainfrom
feat/chaos-1460-bundle-filepath

Conversation

@chrisgeo

@chrisgeo chrisgeo commented May 9, 2026

Copy link
Copy Markdown

Summary

Public API delta

Member Before After
Bundle.path URL FilePath
Bundle.init(path:) URL FilePath
Bundle.bootlog URL FilePath
Bundle.containerRootfsBlock URL FilePath
Bundle.filePath(for:) -> URL -> FilePath
Bundle.create(path:…) URL FilePath
Bundle.containerLog (in ContainerSandboxServiceClient) URL FilePath

containerRootfsConfig (internal accessor) follows.

Caller sites updated

  • Sources/Services/ContainerAPIService/Server/Containers/ContainersService.swift — 7 sites: lines 122, 791-794, 924-926, 962, 1065, 1109, 1168.
  • Sources/Services/ContainerSandboxService/Server/SandboxService.swift — 6 sites: 156, 206, 248, 1236, 1451, 1465.

Bundle+Log.swift extension also migrated (containerLog: URL -> FilePath).

URL boundaries preserved (with reason)

All Foundation APIs that only accept URL get a localized bridge with a one-line comment justifying the leak:

  • Sources/ContainerResource/Container/Bundle.swift:53Data(contentsOf:) for containerRootfs getter.
  • Sources/ContainerResource/Container/Bundle.swift:93,95FileManager.copyItem(at:to:) and Kernel.path (Containerization API still URL).
  • Sources/ContainerResource/Container/Bundle.swift:144Data.write(to:) for setContainerRootFs.
  • Sources/ContainerResource/Container/Bundle.swift:170Data.write(to:) (private static write).
  • Sources/ContainerResource/Container/Bundle.swift:178Data(contentsOf:) (private load).
  • Sources/Services/ContainerAPIService/Server/Containers/ContainersService.swift:793-794FileHandle(forReadingFrom:) for container log + bootlog.
  • Sources/Services/ContainerSandboxService/Server/SandboxService.swift:206FileHandle(forWritingTo:) for container log.
  • Sources/Services/ContainerSandboxService/Server/SandboxService.swift:248BootLog.file(path: URL, append: Bool) is a Containerization API still URL.
  • Sources/Services/ContainerSandboxService/Server/SandboxService.swift:1465RuntimeConfiguration.path is still URL (out of scope, separate ticket).
  • Sources/Services/ContainerSandboxService/Server/SandboxService.swift:156, 1451, ContainersService.swift:122, 791, 924, 962, 1065, 1109, 1168 — call sites where containerRoot/self.root/dir are still URL (private fields, out of scope) bridged via FilePath(url.path) at Bundle construction.

Test plan

  • swift build succeeds with no warnings.
  • swift test --filter ContainerResource — 36/36 pass.
  • swift test --filter ContainerAPIService — 2/2 pass (RuntimeConfigurationTests).
  • swift test --filter ContainerSandboxService — no dedicated unit tests target this module.
  • lsp_diagnostics clean on all 4 changed files.

Closes CHAOS-1460. Part of CHAOS-1448 epic. Unblocks CHAOS-1467 (server-side catch-all).

@linear

linear Bot commented May 9, 2026

Copy link
Copy Markdown

CHAOS-1460

CHAOS-1448

Closes CHAOS-1460. Unblocks CHAOS-1467 (server-side catch-all).
@chrisgeo chrisgeo force-pushed the feat/chaos-1460-bundle-filepath branch from bb488af to 31b529a Compare May 24, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant